Re: WiFi+BT AR5B22. When starting linux - BT disappears. Disappears at all.
May I ask that noobish question: is there a distro with kernel.org released kernel? (my fast search in google failed) Maybe Knoppix? If no - then i'll search somewhere how to make it in known distro :) Thanks. 2014-07-02 8:39 GMT+03:00 Greg KH g...@kroah.com: On Tue, Jul 01, 2014 at 08:53:27AM +0300, Антон Мацюк wrote: I have a problem with my laptop wireless card in linux (I tried xubuntu and kali). Then I would recomment asking on your distro support group. If you are using a kernel.org released kernel, then we can help you. Well, we can't, the Linux network driver developers can, their mailing list is listed in the kernel, but they will also require you to use a kernel.org release, and not a distro release kernel. best of luck, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: WiFi+BT AR5B22. When starting linux - BT disappears. Disappears at all.
On Wed, Jul 02, 2014 at 09:27:07AM +0300, Антон Мацюк wrote: May I ask that noobish question: is there a distro with kernel.org released kernel? Some distros provide vanilla kernel packages. I know Gentoo and openSUSE do, and I think Fedora also does. Check with your distro to see if they provide this or not. (my fast search in google failed) Maybe Knoppix? If no - then i'll search somewhere how to make it in known distro :) There's a whole book on how to build your own kernel, Linux Kernel in a Nutshell. It's free online and should help you out in that area. good luck, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] staging: dgap: remove return statement in void function
clean up checkpatch warning: WARNING: void function return statements are not generally useful Signed-off-by: Daeseok Youn daeseok.y...@gmail.com --- drivers/staging/dgap/dgap.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index 0036f35..b5ea9ff 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -3077,8 +3077,6 @@ static void dgap_tty_send_xchar(struct tty_struct *tty, char c) spin_unlock_irqrestore(ch-ch_lock, lock_flags2); spin_unlock_irqrestore(bd-bd_lock, lock_flags); - - return; } /* -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] staging: dgap: fixed foo* bar should be foo * bar in dgap.c
clean up checkpatch.pl error: ERROR: foo* bar should be foo *bar Signed-off-by: Daeseok Youn daeseok.y...@gmail.com --- drivers/staging/dgap/dgap.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index d4f80af..0036f35 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -202,7 +202,7 @@ static int dgap_test_bios(struct board_t *brd); static int dgap_test_fep(struct board_t *brd); static int dgap_tty_register_ports(struct board_t *brd); static int dgap_firmware_load(struct pci_dev *pdev, int card_type, - struct board_t* brd); + struct board_t *brd); static void dgap_cleanup_module(void); @@ -574,7 +574,7 @@ static int dgap_init_pci(void) static int dgap_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { int rc; - struct board_t* brd; + struct board_t *brd; if (dgap_numboards = MAXBOARDS) return -EPERM; @@ -872,7 +872,7 @@ static void dgap_free_irq(struct board_t *brd) } static int dgap_firmware_load(struct pci_dev *pdev, int card_type, - struct board_t* brd) + struct board_t *brd) { const struct firmware *fw; char *tmp_ptr; -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: WiFi+BT AR5B22. When starting linux - BT disappears. Disappears at all.
Big thanks, I'll do some research at weekend, maybe :) 2014-07-02 9:36 GMT+03:00 Greg KH g...@kroah.com: On Wed, Jul 02, 2014 at 09:27:07AM +0300, Антон Мацюк wrote: May I ask that noobish question: is there a distro with kernel.org released kernel? Some distros provide vanilla kernel packages. I know Gentoo and openSUSE do, and I think Fedora also does. Check with your distro to see if they provide this or not. (my fast search in google failed) Maybe Knoppix? If no - then i'll search somewhere how to make it in known distro :) There's a whole book on how to build your own kernel, Linux Kernel in a Nutshell. It's free online and should help you out in that area. good luck, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/3] staging: dgap: Adds a blank line after declaration
clean up checkpatch.pl warning: WARNING: Missing a blank line after declarations Signed-off-by: Daeseok Youn daeseok.y...@gmail.com --- drivers/staging/dgap/dgap.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index b5ea9ff..5bccd14 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -5388,6 +5388,7 @@ static int dgap_param(struct tty_struct *tty) */ if (bd-bd_flags BD_FEP5PLUS) { u16 hflow2 = 0; + if (ch-ch_digi.digi_flags DIGI_RTS_TOGGLE) hflow2 |= (D_RTS(ch)); if (ch-ch_digi.digi_flags DIGI_DTR_TOGGLE) @@ -5797,6 +5798,7 @@ static int dgap_create_driver_sysfiles(struct pci_driver *dgap_driver) static void dgap_remove_driver_sysfiles(struct pci_driver *dgap_driver) { struct device_driver *driverfs = dgap_driver-driver; + driver_remove_file(driverfs, driver_attr_version); driver_remove_file(driverfs, driver_attr_boards); driver_remove_file(driverfs, driver_attr_maxboards); @@ -6390,6 +6392,7 @@ static ssize_t dgap_tty_name_show(struct device *d, if (cptr-type == TNODE found == TRUE) { char *ptr1; + if (strstr(cptr-u.ttyname, tty)) { ptr1 = cptr-u.ttyname; ptr1 += 3; -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: gdm72xx: add help text to Kconfig
The descriptions are provided by GCT Semiconductor, Inc. Signed-off-by: Ben Chan benc...@chromium.org --- drivers/staging/gdm72xx/Kconfig | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/staging/gdm72xx/Kconfig b/drivers/staging/gdm72xx/Kconfig index dd8a391..5836503 100644 --- a/drivers/staging/gdm72xx/Kconfig +++ b/drivers/staging/gdm72xx/Kconfig @@ -6,21 +6,29 @@ menuconfig WIMAX_GDM72XX tristate GCT GDM72xx WiMAX support depends on NET (USB || MMC) help - Support for the GCT GDM72xx WiMAX chip + Support a WiMAX module based on the GCT GDM72xx WiMAX chip. if WIMAX_GDM72XX config WIMAX_GDM72XX_QOS bool Enable QoS support default n + help + Enable Quality of Service support based on the data protocol of + transmitting packets. config WIMAX_GDM72XX_K_MODE bool Enable K mode default n + help + Enable support for proprietary functions for KT (Korea Telecom). config WIMAX_GDM72XX_WIMAX2 bool Enable WiMAX2 support default n + help + Enable support for transmitting multiple packets (packet + aggregation) from the WiMAX module to the host processor. choice prompt Select interface @@ -28,10 +36,16 @@ choice config WIMAX_GDM72XX_USB bool USB interface depends on (USB = y || USB = WIMAX_GDM72XX) + help + Select this option if the WiMAX module interfaces with the host + processor via USB. config WIMAX_GDM72XX_SDIO bool SDIO interface depends on (MMC = y || MMC = WIMAX_GDM72XX) + help + Select this option if the WiMAX module interfaces with the host + processor via SDIO. endchoice @@ -40,6 +54,9 @@ if WIMAX_GDM72XX_USB config WIMAX_GDM72XX_USB_PM bool Enable power management support depends on PM_RUNTIME + help + Enable USB power management in order to reduce power consumption + while the interface is not in use. endif # WIMAX_GDM72XX_USB -- 2.0.0.526.g5318336 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] mmc: rtsx: add support for async request
On 6 June 2014 09:05, micky_ch...@realsil.com.cn wrote: From: Micky Ching micky_ch...@realsil.com.cn Add support for non-blocking request, pre_req() runs dma_map_sg() and post_req() runs dma_unmap_sg(). This patch can increase card read/write speed, especially for high speed card and slow speed CPU. Test on intel i3(800MHz - 2.3GHz) performance mode(2.3GHz), SD card clock 208MHz run dd if=/dev/mmcblk0 of=/dev/null bs=64k count=1024 before: 67108864 bytes (67 MB) copied, 0.85427 s, 78.6 MB/s after: 67108864 bytes (67 MB) copied, 0.74799 s, 89.7 MB/s Signed-off-by: Micky Ching micky_ch...@realsil.com.cn Acked-by: Ulf Hansson ulf.hans...@linaro.org I assume Lee will pick this patchset through his mfd tree then. If not, ping me and I will help. Kind regards Uffe --- drivers/mmc/host/rtsx_pci_sdmmc.c | 133 +++-- 1 file changed, 127 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c index 1c68e0d..a2c0858 100644 --- a/drivers/mmc/host/rtsx_pci_sdmmc.c +++ b/drivers/mmc/host/rtsx_pci_sdmmc.c @@ -24,6 +24,7 @@ #include linux/highmem.h #include linux/delay.h #include linux/platform_device.h +#include linux/workqueue.h #include linux/mmc/host.h #include linux/mmc/mmc.h #include linux/mmc/sd.h @@ -36,7 +37,10 @@ struct realtek_pci_sdmmc { struct rtsx_pcr *pcr; struct mmc_host *mmc; struct mmc_request *mrq; + struct workqueue_struct *workq; +#define SDMMC_WORKQ_NAME rtsx_pci_sdmmc_workq + struct work_struct work; struct mutexhost_mutex; u8 ssc_depth; @@ -48,6 +52,11 @@ struct realtek_pci_sdmmc { int power_state; #define SDMMC_POWER_ON 1 #define SDMMC_POWER_OFF0 + + unsigned intsg_count; + s32 cookie; + unsigned intcookie_sg_count; + boolusing_cookie; }; static inline struct device *sdmmc_dev(struct realtek_pci_sdmmc *host) @@ -86,6 +95,77 @@ static void sd_print_debug_regs(struct realtek_pci_sdmmc *host) #define sd_print_debug_regs(host) #endif /* DEBUG */ +/* + * sd_pre_dma_transfer - do dma_map_sg() or using cookie + * + * @pre: if called in pre_req() + * return: + * 0 - do dma_map_sg() + * 1 - using cookie + */ +static int sd_pre_dma_transfer(struct realtek_pci_sdmmc *host, + struct mmc_data *data, bool pre) +{ + struct rtsx_pcr *pcr = host-pcr; + int read = data-flags MMC_DATA_READ; + int count = 0; + int using_cookie = 0; + + if (!pre data-host_cookie data-host_cookie != host-cookie) { + dev_err(sdmmc_dev(host), + error: data-host_cookie = %d, host-cookie = %d\n, + data-host_cookie, host-cookie); + data-host_cookie = 0; + } + + if (pre || data-host_cookie != host-cookie) { + count = rtsx_pci_dma_map_sg(pcr, data-sg, data-sg_len, read); + } else { + count = host-cookie_sg_count; + using_cookie = 1; + } + + if (pre) { + host-cookie_sg_count = count; + if (++host-cookie 0) + host-cookie = 1; + data-host_cookie = host-cookie; + } else { + host-sg_count = count; + } + + return using_cookie; +} + +static void sdmmc_pre_req(struct mmc_host *mmc, struct mmc_request *mrq, + bool is_first_req) +{ + struct realtek_pci_sdmmc *host = mmc_priv(mmc); + struct mmc_data *data = mrq-data; + + if (data-host_cookie) { + dev_err(sdmmc_dev(host), + error: reset data-host_cookie = %d\n, + data-host_cookie); + data-host_cookie = 0; + } + + sd_pre_dma_transfer(host, data, true); + dev_dbg(sdmmc_dev(host), pre dma sg: %d\n, host-cookie_sg_count); +} + +static void sdmmc_post_req(struct mmc_host *mmc, struct mmc_request *mrq, + int err) +{ + struct realtek_pci_sdmmc *host = mmc_priv(mmc); + struct rtsx_pcr *pcr = host-pcr; + struct mmc_data *data = mrq-data; + int read = data-flags MMC_DATA_READ; + + rtsx_pci_dma_unmap_sg(pcr, data-sg, data-sg_len, read); + data-host_cookie = 0; +} + static int sd_read_data(struct realtek_pci_sdmmc *host, u8 *cmd, u16 byte_cnt, u8 *buf, int buf_len, int timeout) { @@ -415,7 +495,7 @@ static int sd_rw_multi(struct realtek_pci_sdmmc *host, struct mmc_request *mrq) rtsx_pci_send_cmd_no_wait(pcr); - err = rtsx_pci_transfer_data(pcr, data-sg, data-sg_len, read, 1); + err =
Re: [PATCH 1/2] mfd: rtsx: add dma transfer function
On 06/18/2014 04:00 PM, Lee Jones wrote: On Mon, 16 Jun 2014, Ulf Hansson wrote: On 16 June 2014 14:20, Lee Jones lee.jo...@linaro.org wrote: From: Micky Ching micky_ch...@realsil.com.cn rtsx driver using a single function for transfer data, dma map/unmap are placed in one fix function. We need map/unmap dma in different place(for mmc async driver), so add three function for dma map, dma transfer and dma unmap. Signed-off-by: Micky Ching micky_ch...@realsil.com.cn --- drivers/mfd/rtsx_pcr.c | 76 ++ include/linux/mfd/rtsx_pci.h |6 2 files changed, 54 insertions(+), 28 deletions(-) I don't see any glaring issues with this patch. Does it rely on the first patch, or vise versa, or can it just be applied? The mmc part in patch2 relies on this one, but please go ahead and apply the mfd patch if you see it good. I can later provide my ack for the mmc parts, in patch2, when it's a reviewed properly and thus you can take it through your tree. There's no rush. Once you're happy with the MMC patch, Micky can submit them both again with my Ack on the MFD part and I'll take them as a set. Hi Lee, Can you pick this patch directly? need resend it now? Thanks. Best Regards. micky. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: rtl8192e: Fix potential NULL pointer dereference
We need to make sure the struct rtllib_device pointer ieee is not NULL after the goto rx_dropped label since it is dereferenced there. Signed-off-by: Emil Goode emilgo...@gmail.com --- drivers/staging/rtl8192e/rtllib_rx.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 60de54c..7db3e74 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1496,7 +1496,8 @@ int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb, return ret; rx_dropped: - ieee-stats.rx_dropped++; + if (ieee) + ieee-stats.rx_dropped++; return 0; } EXPORT_SYMBOL(rtllib_rx); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[Q] Removed cxt1e1 module in staging branch
Hi, all. I saw your change which removes cxt1e1 in staging tree. Actually, I have been cleaning up coding style and fixing minor issues without real cxt1e1 hardware. And I am not cleaning up all of files in cxt1e1 but some files already done and have plans for other files. may be.. I cannot fix major issues because I don't have a real device but minor issues can be fixed and coding style also. If you want to fix majors' which can be with real device, stay removed. But if it can be reverted for fixing minor issues including coding style, please revert. I cannot focus all of my time on making patches, but I can make patches steadily for that module. Thanks. regards, Daeseok Youn. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V2] staging: gdm72xx: move T_CAPABILITY definitions to hci.h
Signed-off-by: Michalis Pappas mpap...@fastmail.fm --- drivers/staging/gdm72xx/gdm_wimax.c | 11 --- drivers/staging/gdm72xx/hci.h | 6 ++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c index 4148013..50b7bf0 100644 --- a/drivers/staging/gdm72xx/gdm_wimax.c +++ b/drivers/staging/gdm72xx/gdm_wimax.c @@ -609,10 +609,7 @@ static void gdm_wimax_prepare_device(struct net_device *dev) u16 len = 0; u32 val = 0; - #define BIT_MULTI_CS0 - #define BIT_WIMAX 1 - #define BIT_QOS 2 - #define BIT_AGGREGATION 3 + /* GetInformation mac address */ len = 0; @@ -621,12 +618,12 @@ static void gdm_wimax_prepare_device(struct net_device *dev) hci-length = H2B(len); gdm_wimax_send(nic, hci, HCI_HEADER_SIZE+len); - val = (1BIT_WIMAX) | (1BIT_MULTI_CS); + val = (1 T_CAPABILITY_WIMAX) | (1 T_CAPABILITY_MULTI_CS); #if defined(CONFIG_WIMAX_GDM72XX_QOS) - val |= (1BIT_QOS); + val |= (1 T_CAPABILITY_QOS); #endif #if defined(CONFIG_WIMAX_GDM72XX_WIMAX2) - val |= (1BIT_AGGREGATION); + val |= (1 T_CAPABILITY_AGGREGATION); #endif /* Set capability */ diff --git a/drivers/staging/gdm72xx/hci.h b/drivers/staging/gdm72xx/hci.h index 059ba00..4dd253d 100644 --- a/drivers/staging/gdm72xx/hci.h +++ b/drivers/staging/gdm72xx/hci.h @@ -198,6 +198,12 @@ #define T_FFTSIZE (0xda | (4 16)) #define T_DUPLEX_MODE (0xdb | (4 16)) +/* T_CAPABILITY */ +#define T_CAPABILITY_MULTI_CS (1 0) +#define T_CAPABILITY_WIMAX (1 1) +#define T_CAPABILITY_QOS (1 2) +#define T_CAPABILITY_AGGREGATION (1 3) + struct hci_s { unsigned short cmd_evt; unsigned short length; -- 1.8.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/1] staging: lustre: libcfs: nidstrings.c - use ARRAY_SIZE macro
From: Anil Belur ask...@gmail.com - this patch replaces sizeof(a)/sizeof(a[0]) with the ARRAY_SIZE macro to get the number of nidstrings (and netstrfns) - v2: also for netstrfns Signed-off-by: Anil Belur ask...@gmail.com --- drivers/staging/lustre/lustre/libcfs/nidstrings.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/nidstrings.c b/drivers/staging/lustre/lustre/libcfs/nidstrings.c index 87705ae..4fc7b45 100644 --- a/drivers/staging/lustre/lustre/libcfs/nidstrings.c +++ b/drivers/staging/lustre/lustre/libcfs/nidstrings.c @@ -74,8 +74,7 @@ libcfs_next_nidstring(void) spin_lock_irqsave(libcfs_nidstring_lock, flags); str = libcfs_nidstrings[libcfs_nidstring_idx++]; - if (libcfs_nidstring_idx == - sizeof(libcfs_nidstrings)/sizeof(libcfs_nidstrings[0])) + if (libcfs_nidstring_idx == ARRAY_SIZE(libcfs_nidstrings)) libcfs_nidstring_idx = 0; spin_unlock_irqrestore(libcfs_nidstring_lock, flags); @@ -198,7 +197,7 @@ static struct netstrfns libcfs_netstrfns[] = { {/* .nf_type */ -1}, }; -const int libcfs_nnetstrfns = sizeof(libcfs_netstrfns)/sizeof(libcfs_netstrfns[0]); +const int libcfs_nnetstrfns = ARRAY_SIZE(libcfs_netstrfns); int libcfs_lo_str2addr(const char *str, int nob, __u32 *addr) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: allow COMEDI_BUFINFO, COMEDI_CANCEL and COMEDI_POLL on locked subdevice
Comedi subdevices can be locked for mostly exclusive access by a particular file object by means of the COMEDI_LOCK ioctl. Some operations disregard the lock. For example, the read() and write() file operations are allowed for the file object that set up an asynchronous command on the subdevice (making it busy) regardless of whether it is locked. The COMEDI_BUFINFO, COMEDI_CANCEL and COMEDI_POLL ioctls are also associated with the file object that made the subdevice busy with a command. They currently obey the exclusive access lock on the subdevice as well, but it makes more sense for them to ignore it like the read() and write() file operations. Remove the exclusive subdevice access checks for these ioctls. Signed-off-by: Ian Abbott abbo...@mev.co.uk --- drivers/staging/comedi/comedi_fops.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index d4904cc..e8e3809 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -968,9 +968,6 @@ static int do_bufinfo_ioctl(struct comedi_device *dev, s = dev-subdevices[bi.subdevice]; - if (s-lock s-lock != file) - return -EACCES; - async = s-async; if (!async) { @@ -1744,9 +1741,6 @@ static int do_cancel_ioctl(struct comedi_device *dev, unsigned int arg, if (s-async == NULL) return -EINVAL; - if (s-lock s-lock != file) - return -EACCES; - if (!s-busy) return 0; @@ -1781,9 +1775,6 @@ static int do_poll_ioctl(struct comedi_device *dev, unsigned int arg, return -EINVAL; s = dev-subdevices[arg]; - if (s-lock s-lock != file) - return -EACCES; - if (!s-busy) return 0; -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [RFC PATCH 0/8] component helper improvements
On Wed, May 14, 2014 at 08:42:17PM +0200, Thierry Reding wrote: I've been looking at converting the Tegra DRM driver to the component helpers for a while now and had to make some changes to make it work for that particular use-case. While updating the imx-drm and msm DRM drivers for those changes I noticed an oddity. Both of the existing drivers use the following pattern: static int driver_component_bind(struct device *dev, struct device *master, void *data) { allocate memory request resources ... hook up to subsystem ... enable hardware } static const struct component_ops driver_component_ops = { .bind = driver_component_bind, }; static int driver_probe(struct platform_device *pdev) { return component_add(pdev-dev, driver_component_ops); } While converting Tegra DRM, what I intuitively did (I didn't actually look at the other drivers for inspiration) was something more along the lines of the following: static int driver_component_bind(struct device *dev, struct device *master, void *data) { hook up to subsystem ... enable hardware } static const struct component_ops driver_component_ops = { .bind = driver_component_bind, }; static int driver_probe(struct platform_device *pdev) { allocate memory request resources ... return component_add(pdev-dev, driver_component_ops); } Since usually deferred probing is caused by resource allocations failing this has the side-effect of handling deferred probing before the master device is even bound (the component_add() happens as the very last step) and therefore there is less risk for component_bind_all() to fail. I've actually never seen it fail at all. Failure at that point is almost certainly irrecoverable anyway. It isn't irrecoverable - that case is handled. I really don't like two-stage driver initialisation - it increases the chances of bugs creeping in. Take for example this code: probe() { priv = devm_kzalloc(dev, whatever); priv-mem = devm_ioremap_resource(dev, res); dev_set_drvdata(dev, priv); return component_add(dev, ops); } So far so good, not much can go wrong at that point - we know exactly what state the 'priv' structure is at the point where the component_add call is made. Now, when the ops' bind method is called, we retrieve the private data. At this point, we can no longer rely on the initialisation state of many of the members. We can't assume that they were zero when we're called, because we can have this sequence of events: - driver is probed - component is bound - component is unbound - component is bound At this point, the private data will be dirty. This actually makes the use of devm_kzalloc() a joke in the probe function - although it does initialise all members to zero, we can't rely on that at all when the component is bound. While the driver itself may be coded for this to be safe, can we say the same for any structures which are embedded into the private data, which may be private to other subsystems? By way of illustration, ASoC can also have this two stage approach. I'll draw your attention to SGTL5000, and the recent patch I submitted (which I don't think will be taken.) This driver suffers badly if the ASoC card is bound, then unbound, and an attempt to rebind it again. That's because the driver gets some managed resources in both the first stage and the second stage, and expects them to be automatically released in when the second stage is torn down. This bug has existed for a very long time, and has gone unnoticed (it will be unnoticed until you try to debug by removing modules and trying to load replacements, which is how I found it.) That exact bug can't happen with the component helpers, because I explicitly thought about the handling of managed resources, and added the necessary support to deal with these correctly. However, it serves as an example that, despite comments from people saying that my fear is unlikely to happen, we already have code which suffers from issues with two-stage initialisation. The unfortunate thing is that validation testing for Linux tends not to venture much past does it boot, are my devices present and can I run some programs. It doesn't cover system shutdown/reboot very often (we've had bugs which have been present for ages there - my test farm explicitly does a power off after boot testing now) and it hardly ever covers drivers being unbound or module removal. -- FTTC broadband for 0.8mile line: now at 9.7Mbps
Re: [PATCH 1/2] mfd: rtsx: add dma transfer function
On Wed, 02 Jul 2014, micky wrote: On 06/18/2014 04:00 PM, Lee Jones wrote: On Mon, 16 Jun 2014, Ulf Hansson wrote: On 16 June 2014 14:20, Lee Jones lee.jo...@linaro.org wrote: From: Micky Ching micky_ch...@realsil.com.cn rtsx driver using a single function for transfer data, dma map/unmap are placed in one fix function. We need map/unmap dma in different place(for mmc async driver), so add three function for dma map, dma transfer and dma unmap. Signed-off-by: Micky Ching micky_ch...@realsil.com.cn --- drivers/mfd/rtsx_pcr.c | 76 ++ include/linux/mfd/rtsx_pci.h |6 2 files changed, 54 insertions(+), 28 deletions(-) I don't see any glaring issues with this patch. Does it rely on the first patch, or vise versa, or can it just be applied? The mmc part in patch2 relies on this one, but please go ahead and apply the mfd patch if you see it good. I can later provide my ack for the mmc parts, in patch2, when it's a reviewed properly and thus you can take it through your tree. There's no rush. Once you're happy with the MMC patch, Micky can submit them both again with my Ack on the MFD part and I'll take them as a set. Hi Lee, Can you pick this patch directly? need resend it now? No need to resend, I'll get round to applying it from here. -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/6] lib80211: re-use string_escape_mem_any_np()
In kernel we have function to escape a given string. Let's use it instead of custom approach. This fixes a bug. The current implementation wrongly prints octal numbers: only two first digits are used in case when 3 are required and the rest of the string ends up cut off. Additionally the \f, \v, \a, and \e are escaped to their alphabetic representation. It's safe to do since the print_ssid() is currently used for messaging only. Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- net/wireless/lib80211.c | 24 ++-- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/net/wireless/lib80211.c b/net/wireless/lib80211.c index a55c27b..0c2f67b 100644 --- a/net/wireless/lib80211.c +++ b/net/wireless/lib80211.c @@ -22,6 +22,7 @@ #include linux/init.h #include linux/slab.h #include linux/string.h +#include linux/string_helpers.h #include net/lib80211.h @@ -48,31 +49,10 @@ static void lib80211_crypt_deinit_handler(unsigned long data); const char *print_ssid(char *buf, const char *ssid, u8 ssid_len) { - const char *s = ssid; char *d = buf; ssid_len = min_t(u8, ssid_len, IEEE80211_MAX_SSID_LEN); - while (ssid_len--) { - if (isprint(*s)) { - *d++ = *s++; - continue; - } - - *d++ = '\\'; - if (*s == '\0') - *d++ = '0'; - else if (*s == '\n') - *d++ = 'n'; - else if (*s == '\r') - *d++ = 'r'; - else if (*s == '\t') - *d++ = 't'; - else if (*s == '\\') - *d++ = '\\'; - else - d += snprintf(d, 3, %03o, *s); - s++; - } + d += string_escape_mem_any_np(ssid, ssid_len, buf, ~0UL, NULL); *d = '\0'; return buf; } -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/6] lib / string_helpers: introduce string_escape_mem()
This is almost the opposite function to string_unescape(). Nevertheless it handles \0 and could be used for any byte buffer. The documentation is supplied together with the function prototype. The test cases covers most of the scenarios and would be expanded later on. Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- include/linux/string_helpers.h | 83 lib/string_helpers.c | 215 + lib/test-string_helpers.c | 213 3 files changed, 511 insertions(+) diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h index 396..db13f20 100644 --- a/include/linux/string_helpers.h +++ b/include/linux/string_helpers.h @@ -71,4 +71,87 @@ static inline int string_unescape_any_inplace(char *buf) return string_unescape_any(buf, buf, 0); } +#define ESCAPE_SPACE 0x01 +#define ESCAPE_SPECIAL 0x02 +#define ESCAPE_NULL0x04 +#define ESCAPE_OCTAL 0x08 +#define ESCAPE_ANY \ + (ESCAPE_SPACE | ESCAPE_OCTAL | ESCAPE_SPECIAL | ESCAPE_NULL) +#define ESCAPE_NP 0x10 +#define ESCAPE_ANY_NP (ESCAPE_ANY | ESCAPE_NP) +#define ESCAPE_HEX 0x20 + +/** + * string_escape_mem - quote characters in the given memory buffer + * @src: source buffer (unescaped) + * @isz: source buffer size + * @dst: destination buffer (escaped) + * @osz: destination buffer size + * @flags: combination of the flags (bitwise OR): + * %ESCAPE_SPACE: + * '\f' - form feed + * '\n' - new line + * '\r' - carriage return + * '\t' - horizontal tab + * '\v' - vertical tab + * %ESCAPE_SPECIAL: + * '\\' - backslash + * '\a' - alert (BEL) + * '\e' - escape + * %ESCAPE_NULL: + * '\0' - null + * %ESCAPE_OCTAL: + * '\NNN' - byte with octal value NNN (3 digits) + * %ESCAPE_ANY: + * all previous together + * %ESCAPE_NP: + * escape only non-printable characters (checked by isprint) + * %ESCAPE_ANY_NP: + * all previous together + * %ESCAPE_HEX: + * '\xHH' - byte with hexadecimal value HH (2 digits) + * @esc: NULL-terminated string of characters any of which, if found in + * the source, has to be escaped + * + * Description: + * The process of escaping byte buffer includes several parts. They are applied + * in the following sequence. + * 1. The character is matched to the printable class, if asked, and in + *case of match it passes through to the output. + * 2. The character is not matched to the one from @esc string and thus + *must go as is to the output. + * 3. The character is checked if it falls into the class given by @flags. + *%ESCAPE_OCTAL and %ESCAPE_HEX are going last since they cover any + *character. Note that they actually can't go together, otherwise + *%ESCAPE_HEX will be ignored. + * + * Caller must provide valid source and destination pointers. Be aware that + * destination buffer will not be NULL-terminated, thus caller have to append + * it if needs. + * + * Return: amount of characters processed to the destination buffer, or + *%-ENOMEM if the size of buffer is not enough to put an escaped + *character. + */ +int string_escape_mem(const char *src, size_t isz, char *dst, size_t osz, + unsigned int flags, const char *esc); + +static inline int string_escape_mem_any_np(const char *src, size_t isz, + char *dst, size_t osz, const char *esc) +{ + return string_escape_mem(src, isz, dst, osz, ESCAPE_ANY_NP, esc); +} + +static inline int string_escape_str(const char *src, char *dst, size_t sz, + unsigned int flags, const char *esc) +{ + return string_escape_mem(src, strlen(src), dst, sz, flags, esc); +} + +static inline int string_escape_str_any_np(const char *src, char *dst, + size_t sz, const char *esc) +{ + return string_escape_str(src, dst, sz, ESCAPE_ANY_NP, esc); +} + #endif diff --git a/lib/string_helpers.c b/lib/string_helpers.c index 29033f3..00112eb 100644 --- a/lib/string_helpers.c +++ b/lib/string_helpers.c @@ -8,6 +8,8 @@ #include linux/math64.h #include linux/export.h #include linux/ctype.h +#include linux/errno.h +#include linux/string.h #include linux/string_helpers.h /** @@ -202,3 +204,216 @@ int string_unescape(char *src, char *dst, size_t size, unsigned int flags) return out - dst; } EXPORT_SYMBOL(string_unescape); + +static int escape_passthrough(unsigned char c, char **dst, size_t *osz) +{ + char *out = *dst; + + if (*osz 1) + return -ENOMEM; + + *out++ = c; + + *dst = out; + *osz -= 1; + + return 1; +} + +static int escape_space(unsigned char c,
[PATCH 5/6] staging: rtl8192e: re-use string_escape_mem()
Let's use kernel's library function to escape a buffer. Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- drivers/staging/rtl8192e/rtllib.h | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 83f5f57..cb99160 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -31,6 +31,7 @@ #include linux/timer.h #include linux/sched.h #include linux/semaphore.h +#include linux/string_helpers.h #include linux/delay.h #include linux/wireless.h @@ -2956,7 +2957,6 @@ extern inline int rtllib_get_scans(struct rtllib_device *ieee) static inline const char *escape_essid(const char *essid, u8 essid_len) { static char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; - const char *s = essid; char *d = escaped; if (rtllib_is_empty_essid(essid, essid_len)) { @@ -2965,15 +2965,8 @@ static inline const char *escape_essid(const char *essid, u8 essid_len) } essid_len = min(essid_len, (u8)IW_ESSID_MAX_SIZE); - while (essid_len--) { - if (*s == '\0') { - *d++ = '\\'; - *d++ = '0'; - s++; - } else { - *d++ = *s++; - } - } + d += string_escape_mem(essid, essid_len, escaped, sizeof(escaped) - 1, + ESCAPE_NULL, NULL); *d = '\0'; return escaped; } -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/6] lib / string_helpers: introduce string_escape_mem
The introduced function is a kind of opposite to string_unescape. We have several users of such functionality each of them created custom implementation. The series contains clean up of test suite, adding new call, and switching few users to use it. Test suite covers all of existing and most of potential use cases. Andy Shevchenko (6): lib / string_helpers: clean up test suite lib / string_helpers: introduce string_escape_mem() lib80211: re-use string_escape_mem_any_np() staging: wlan-ng: re-use string_escape_mem() staging: rtl8192e: re-use string_escape_mem() staging: rtl8192u: re-use string_escape_mem() drivers/staging/rtl8192e/rtllib.h | 13 +- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 13 +- drivers/staging/wlan-ng/prism2sta.c| 29 +-- include/linux/string_helpers.h | 83 lib/string_helpers.c | 215 + lib/test-string_helpers.c | 250 +++-- net/wireless/lib80211.c| 24 +-- 7 files changed, 551 insertions(+), 76 deletions(-) -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/6] lib / string_helpers: clean up test suite
This patch prepares test suite for a following update. It introduces test_string_check_buf() helper which checks the result and dumps an error. Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- lib/test-string_helpers.c | 39 +++ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/lib/test-string_helpers.c b/lib/test-string_helpers.c index 6ac48de..ea86e02 100644 --- a/lib/test-string_helpers.c +++ b/lib/test-string_helpers.c @@ -10,6 +10,26 @@ #include linux/string.h #include linux/string_helpers.h +static __init bool test_string_check_buf(const char *name, unsigned int flags, +char *in, size_t p, +char *out_real, size_t q_real, +char *out_test, size_t q_test) +{ + if (q_real == q_test !memcmp(out_test, out_real, q_test)) + return true; + + pr_err(Test '%s' failed: flags = %u\n, name, flags); + + print_hex_dump(KERN_WARNING, Input: , DUMP_PREFIX_NONE, 16, 1, + in, p, true); + print_hex_dump(KERN_WARNING, Expected: , DUMP_PREFIX_NONE, 16, 1, + out_test, q_test, true); + print_hex_dump(KERN_WARNING, Got: , DUMP_PREFIX_NONE, 16, 1, + out_real, q_real, true); + + return false; +} + struct test_string { const char *in; const char *out; @@ -39,7 +59,8 @@ static const struct test_string strings[] __initconst = { }, }; -static void __init test_string_unescape(unsigned int flags, bool inplace) +static void __init test_string_unescape(const char *name, unsigned int flags, + bool inplace) { char in[256]; char out_test[256]; @@ -77,15 +98,8 @@ static void __init test_string_unescape(unsigned int flags, bool inplace) q_real = string_unescape(in, out_real, q_real, flags); } - if (q_real != q_test || memcmp(out_test, out_real, q_test)) { - pr_warn(Test failed: flags = %u\n, flags); - print_hex_dump(KERN_WARNING, Input: , - DUMP_PREFIX_NONE, 16, 1, in, p - 1, true); - print_hex_dump(KERN_WARNING, Expected: , - DUMP_PREFIX_NONE, 16, 1, out_test, q_test, true); - print_hex_dump(KERN_WARNING, Got: , - DUMP_PREFIX_NONE, 16, 1, out_real, q_real, true); - } + test_string_check_buf(name, flags, in, p - 1, out_real, q_real, + out_test, q_test); } static int __init test_string_helpers_init(void) @@ -94,8 +108,9 @@ static int __init test_string_helpers_init(void) pr_info(Running tests...\n); for (i = 0; i UNESCAPE_ANY + 1; i++) - test_string_unescape(i, false); - test_string_unescape(get_random_int() % (UNESCAPE_ANY + 1), true); + test_string_unescape(unescape, i, false); + test_string_unescape(unescape inplace, +get_random_int() % (UNESCAPE_ANY + 1), true); return -EINVAL; } -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/6] staging: wlan-ng: re-use string_escape_mem()
This is a generic function to escape strings by given criteria. Let's use it instead of custom approach. Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- drivers/staging/wlan-ng/prism2sta.c | 29 ++--- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c index 209e4db..1e44c09 100644 --- a/drivers/staging/wlan-ng/prism2sta.c +++ b/drivers/staging/wlan-ng/prism2sta.c @@ -61,6 +61,7 @@ #include linux/workqueue.h #include linux/byteorder/generic.h #include linux/ctype.h +#include linux/string_helpers.h #include linux/io.h #include linux/delay.h @@ -81,27 +82,6 @@ #include hfa384x.h #include prism2mgmt.h -/* Create a string of printable chars from something that might not be */ -/* It's recommended that the str be 4*len + 1 bytes long */ -#define wlan_mkprintstr(buf, buflen, str, strlen) \ -{ \ - int i = 0; \ - int j = 0; \ - memset(str, 0, (strlen)); \ - for (i = 0; i (buflen); i++) { \ - if (isprint((buf)[i])) { \ - (str)[j] = (buf)[i]; \ - j++; \ - } else { \ - (str)[j] = '\\'; \ - (str)[j+1] = 'x'; \ - (str)[j+2] = hex_asc_hi((buf)[i]); \ - (str)[j+3] = hex_asc_lo((buf)[i]); \ - j += 4; \ - } \ - } \ -} - static char *dev_info = prism2_usb; static wlandevice_t *create_wlan(void); @@ -862,8 +842,11 @@ static int prism2sta_getcardinfo(wlandevice_t *wlandev) result = hfa384x_drvr_getconfig(hw, HFA384x_RID_NICSERIALNUMBER, snum, HFA384x_RID_NICSERIALNUMBER_LEN); if (!result) { - wlan_mkprintstr(snum, HFA384x_RID_NICSERIALNUMBER_LEN, - pstr, sizeof(pstr)); + result = string_escape_mem(snum, + HFA384x_RID_NICSERIALNUMBER_LEN, + pstr, sizeof(pstr), ESCAPE_HEX | ESCAPE_NP, + NULL); + pstr[result] = '\0'; netdev_info(wlandev-netdev, Prism2 card SN: %s\n, pstr); } else { netdev_err(wlandev-netdev, Failed to retrieve Prism2 Card SN\n); -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/6] staging: rtl8192u: re-use string_escape_mem()
Let's use kernel's library function to escape a buffer instead of custom code. Signed-off-by: Andy Shevchenko andriy.shevche...@linux.intel.com --- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index 1040bab..bb5f604 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -31,6 +31,7 @@ #include linux/sched.h #include linux/semaphore.h #include linux/interrupt.h +#include linux/string_helpers.h #include linux/delay.h #include linux/wireless.h @@ -2576,7 +2577,6 @@ static inline int ieee80211_get_scans(struct ieee80211_device *ieee) static inline const char *escape_essid(const char *essid, u8 essid_len) { static char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; - const char *s = essid; char *d = escaped; if (ieee80211_is_empty_essid(essid, essid_len)) { @@ -2585,15 +2585,8 @@ static inline const char *escape_essid(const char *essid, u8 essid_len) { } essid_len = min(essid_len, (u8)IW_ESSID_MAX_SIZE); - while (essid_len--) { - if (*s == '\0') { - *d++ = '\\'; - *d++ = '0'; - s++; - } else { - *d++ = *s++; - } - } + d += string_escape_mem(essid, essid_len, escaped, sizeof(escaped) - 1, + ESCAPE_NULL, NULL); *d = '\0'; return escaped; } -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: omap4iss: Fix type of struct iss_device::crashed
The crashed member of struct iss_device is documented to be a bitmask, but a bool doesn't hold that many (usable) bits. Lines 589 and 659 of iss.c strongly suggest that unsigned int was meant (the same type as struct iss_pipeline::entities). Currently, any crashed entity will be blamed on index 0, which is unlikely to be what was intended. Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk --- drivers/staging/media/omap4iss/iss.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/omap4iss/iss.h b/drivers/staging/media/omap4iss/iss.h index 05cd9bf..734cfee 100644 --- a/drivers/staging/media/omap4iss/iss.h +++ b/drivers/staging/media/omap4iss/iss.h @@ -97,7 +97,7 @@ struct iss_device { u64 raw_dmamask; struct mutex iss_mutex; /* For handling ref_count field */ - bool crashed; + unsigned int crashed; int has_context; int ref_count; -- 1.9.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/5] staging:iio:hmc5843: Add support for spi hmc5983
This patch adds support for the hmc5983 spi interface. This chip is almost identical to the hmc5883. The difference being added temperature compensation, additional available sample rate (220Hz) and an SPI interface. Signed-off-by: Josef Gajdusek a...@atx.name --- drivers/staging/iio/magnetometer/Kconfig | 8 ++ drivers/staging/iio/magnetometer/Makefile | 1 + drivers/staging/iio/magnetometer/hmc5843_spi.c | 105 + 3 files changed, 114 insertions(+) create mode 100644 drivers/staging/iio/magnetometer/hmc5843_spi.c diff --git a/drivers/staging/iio/magnetometer/Kconfig b/drivers/staging/iio/magnetometer/Kconfig index 32c69c0..bc5c355 100644 --- a/drivers/staging/iio/magnetometer/Kconfig +++ b/drivers/staging/iio/magnetometer/Kconfig @@ -9,6 +9,7 @@ config SENSORS_HMC5843 select IIO_BUFFER select IIO_TRIGGERED_BUFFER select SENSORS_HMC5843_I2C if (I2C) + select SENSORS_HMC5843_SPI if (SPI_MASTER) help Say Y here to add support for the Honeywell HMC5843, HMC5883 and HMC5883L 3-Axis Magnetometer (digital compass). @@ -17,6 +18,7 @@ config SENSORS_HMC5843 If so, these modules will be created: - hmc5843_core (core functions) - hmc5843_i2c (support for HMC5843, HMC5883, HMC5883L and HMC5983) + - hmc5843_spi (support for HMC5983) config SENSORS_HMC5843_I2C tristate @@ -24,4 +26,10 @@ config SENSORS_HMC5843_I2C depends on SENSORS_HMC5843 select REGMAP_I2C +config SENSORS_HMC5843_SPI + tristate + depends on SPI_MASTER + depends on SENSORS_HMC5843 + select REGMAP_SPI + endmenu diff --git a/drivers/staging/iio/magnetometer/Makefile b/drivers/staging/iio/magnetometer/Makefile index 65baf1c..33761a1 100644 --- a/drivers/staging/iio/magnetometer/Makefile +++ b/drivers/staging/iio/magnetometer/Makefile @@ -4,3 +4,4 @@ obj-$(CONFIG_SENSORS_HMC5843) += hmc5843_core.o obj-$(CONFIG_SENSORS_HMC5843_I2C) += hmc5843_i2c.o +obj-$(CONFIG_SENSORS_HMC5843_SPI) += hmc5843_spi.o diff --git a/drivers/staging/iio/magnetometer/hmc5843_spi.c b/drivers/staging/iio/magnetometer/hmc5843_spi.c new file mode 100644 index 000..3f71ee0 --- /dev/null +++ b/drivers/staging/iio/magnetometer/hmc5843_spi.c @@ -0,0 +1,105 @@ +/* + * SPI driver for hmc5983 + * + * Copyright (C) Josef Gajdusek a...@atx.name + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * */ + +#include linux/module.h +#include linux/spi/spi.h +#include linux/iio/iio.h + +#include hmc5843.h + +struct regmap_config hmc5843_spi_regmap_config = { + .reg_bits = 8, + .val_bits = 8, + + .rd_table = hmc5843_readable_table, + .wr_table = hmc5843_writable_table, + .volatile_table = hmc5843_volatile_table, + + /* Autoincrement address pointer */ + .read_flag_mask = 0xc0, + + .cache_type = REGCACHE_RBTREE, +}; + +static int hmc5843_spi_probe(struct spi_device *spi) +{ + struct hmc5843_data *data; + struct iio_dev *indio_dev; + int ret; + + indio_dev = devm_iio_device_alloc(spi-dev, sizeof(*data)); + if (indio_dev == NULL) + return -ENOMEM; + + spi-mode = SPI_MODE_3; + spi-max_speed_hz = 800; + spi-bits_per_word = 8; + ret = spi_setup(spi); + if (ret) + return ret; + + spi_set_drvdata(spi, indio_dev); + + data = iio_priv(indio_dev); + data-dev = spi-dev; + data-regmap = devm_regmap_init_spi(spi, hmc5843_spi_regmap_config); + + indio_dev-dev.parent = spi-dev; + + return hmc5843_common_probe(indio_dev, HMC5983_ID); +} + +static int hmc5843_spi_remove(struct spi_device *spi) +{ + struct iio_dev *indio_dev = spi_get_drvdata(spi); + return hmc5843_common_remove(indio_dev); +} + +#ifdef CONFIG_PM_SLEEP +static int hmc5843_spi_suspend(struct device *dev) +{ + return hmc5843_common_suspend(spi_get_drvdata(to_spi_device(dev))); +} + +static int hmc5843_spi_resume(struct device *dev) +{ + return hmc5843_common_resume(spi_get_drvdata(to_spi_device(dev))); +} + +static SIMPLE_DEV_PM_OPS(hmc5843_pm_ops, + hmc5843_spi_suspend, hmc5843_spi_resume); +#define HMC5843_PM_OPS (hmc5843_pm_ops) +#else +#define HMC5843_PM_OPS NULL +#endif + + +static const struct spi_device_id hmc5843_id[] = { + { hmc5983, HMC5983_ID }, + { } +}; + +static struct spi_driver hmc5843_driver = { + .driver = { + .name = hmc5843, + .pm = HMC5843_PM_OPS, + .owner = THIS_MODULE, + }, + .id_table = hmc5843_id, + .probe = hmc5843_spi_probe, +
[PATCH 3/5] staging:iio:hmc5843: register - value arrays now can have different lengths
Changed structure of struct hmc5843_chip_info to include length of translation arrays. Code previously using #defined constant has been changed accordingly. This allows to integrate devices which do have different amounts of available rates/scales. Signed-off-by: Josef Gajdusek a...@atx.name --- drivers/staging/iio/magnetometer/hmc5843_core.c | 34 + 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/drivers/staging/iio/magnetometer/hmc5843_core.c b/drivers/staging/iio/magnetometer/hmc5843_core.c index 4ad309b..b26ac9f 100644 --- a/drivers/staging/iio/magnetometer/hmc5843_core.c +++ b/drivers/staging/iio/magnetometer/hmc5843_core.c @@ -39,7 +39,6 @@ */ #define HMC5843_RANGE_GAIN_OFFSET 0x05 #define HMC5843_RANGE_GAIN_DEFAULT 0x01 -#define HMC5843_RANGE_GAINS8 #define HMC5843_RANGE_GAIN_MASK0xe0 /* Device status */ @@ -59,7 +58,6 @@ */ #define HMC5843_RATE_OFFSET0x02 #define HMC5843_RATE_DEFAULT 0x04 -#define HMC5843_RATES 7 #define HMC5843_RATE_MASK 0x1c /* Device measurement configuration */ @@ -69,15 +67,15 @@ #define HMC5843_MEAS_CONF_MASK 0x03 /* Scaling factors: 1000/Gain */ -static const int hmc5843_regval_to_nanoscale[HMC5843_RANGE_GAINS] = { +static const int hmc5843_regval_to_nanoscale[] = { 6173, 7692, 10309, 12821, 18868, 21739, 25641, 35714 }; -static const int hmc5883_regval_to_nanoscale[HMC5843_RANGE_GAINS] = { +static const int hmc5883_regval_to_nanoscale[] = { 7812, 9766, 13021, 16287, 24096, 27701, 32573, 45662 }; -static const int hmc5883l_regval_to_nanoscale[HMC5843_RANGE_GAINS] = { +static const int hmc5883l_regval_to_nanoscale[] = { 7299, 9174, 12195, 15152, 22727, 25641, 30303, 43478 }; @@ -94,11 +92,11 @@ static const int hmc5883l_regval_to_nanoscale[HMC5843_RANGE_GAINS] = { * 6 | 50| 75 * 7 | Not used | Not used */ -static const int hmc5843_regval_to_samp_freq[7][2] = { +static const int hmc5843_regval_to_samp_freq[][2] = { {0, 50}, {1, 0}, {2, 0}, {5, 0}, {10, 0}, {20, 0}, {50, 0} }; -static const int hmc5883_regval_to_samp_freq[7][2] = { +static const int hmc5883_regval_to_samp_freq[][2] = { {0, 75}, {1, 50}, {3, 0}, {7, 50}, {15, 0}, {30, 0}, {75, 0} }; @@ -107,7 +105,9 @@ static const int hmc5883_regval_to_samp_freq[7][2] = { struct hmc5843_chip_info { const struct iio_chan_spec *channels; const int (*regval_to_samp_freq)[2]; + const int n_regval_to_samp_freq; const int *regval_to_nanoscale; + const int n_regval_to_nanoscale; }; /* The lower two bits contain the current conversion mode */ @@ -248,7 +248,7 @@ static ssize_t hmc5843_show_samp_freq_avail(struct device *dev, size_t len = 0; int i; - for (i = 0; i HMC5843_RATES; i++) + for (i = 0; i data-variant-n_regval_to_samp_freq; i++) len += scnprintf(buf + len, PAGE_SIZE - len, %d.%d , data-variant-regval_to_samp_freq[i][0], data-variant-regval_to_samp_freq[i][1]); @@ -278,7 +278,7 @@ static int hmc5843_get_samp_freq_index(struct hmc5843_data *data, { int i; - for (i = 0; i HMC5843_RATES; i++) + for (i = 0; i data-variant-n_regval_to_samp_freq; i++) if (val == data-variant-regval_to_samp_freq[i][0] val2 == data-variant-regval_to_samp_freq[i][1]) return i; @@ -307,7 +307,7 @@ static ssize_t hmc5843_show_scale_avail(struct device *dev, size_t len = 0; int i; - for (i = 0; i HMC5843_RANGE_GAINS; i++) + for (i = 0; i data-variant-n_regval_to_nanoscale; i++) len += scnprintf(buf + len, PAGE_SIZE - len, 0.%09d , data-variant-regval_to_nanoscale[i]); @@ -327,7 +327,7 @@ static int hmc5843_get_scale_index(struct hmc5843_data *data, int val, int val2) if (val != 0) return -EINVAL; - for (i = 0; i HMC5843_RANGE_GAINS; i++) + for (i = 0; i data-variant-n_regval_to_nanoscale; i++) if (val2 == data-variant-regval_to_nanoscale[i]) return i; @@ -480,17 +480,29 @@ static const struct hmc5843_chip_info hmc5843_chip_info_tbl[] = { [HMC5843_ID] = { .channels = hmc5843_channels, .regval_to_samp_freq = hmc5843_regval_to_samp_freq, + .n_regval_to_samp_freq = + ARRAY_SIZE(hmc5843_regval_to_samp_freq), .regval_to_nanoscale = hmc5843_regval_to_nanoscale, + .n_regval_to_nanoscale = + ARRAY_SIZE(hmc5843_regval_to_nanoscale), }, [HMC5883_ID] = { .channels
[PATCH 4/5] staging:iio:hmc5843: Add support for i2c hmc5983
This patch adds support for the hmc5983 i2c interface. This chip is almost identical to the hmc5883. The difference being added temperature compensation, additional available sample rate (220Hz) and an SPI interface. Signed-off-by: Josef Gajdusek a...@atx.name --- drivers/staging/iio/magnetometer/Kconfig| 2 +- drivers/staging/iio/magnetometer/hmc5843.h | 1 + drivers/staging/iio/magnetometer/hmc5843_core.c | 20 +--- drivers/staging/iio/magnetometer/hmc5843_i2c.c | 5 +++-- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/drivers/staging/iio/magnetometer/Kconfig b/drivers/staging/iio/magnetometer/Kconfig index 28c2612..32c69c0 100644 --- a/drivers/staging/iio/magnetometer/Kconfig +++ b/drivers/staging/iio/magnetometer/Kconfig @@ -16,7 +16,7 @@ config SENSORS_HMC5843 This driver can also be compiled as a set of modules. If so, these modules will be created: - hmc5843_core (core functions) - - hmc5843_i2c (support for HMC5843, HMC5883 and HMC5883L) + - hmc5843_i2c (support for HMC5843, HMC5883, HMC5883L and HMC5983) config SENSORS_HMC5843_I2C tristate diff --git a/drivers/staging/iio/magnetometer/hmc5843.h b/drivers/staging/iio/magnetometer/hmc5843.h index 4e3cce3..c36041a 100644 --- a/drivers/staging/iio/magnetometer/hmc5843.h +++ b/drivers/staging/iio/magnetometer/hmc5843.h @@ -29,6 +29,7 @@ enum hmc5843_ids { HMC5843_ID, HMC5883_ID, HMC5883L_ID, + HMC5983_ID, }; struct hmc5843_data { diff --git a/drivers/staging/iio/magnetometer/hmc5843_core.c b/drivers/staging/iio/magnetometer/hmc5843_core.c index b26ac9f..21f8efd 100644 --- a/drivers/staging/iio/magnetometer/hmc5843_core.c +++ b/drivers/staging/iio/magnetometer/hmc5843_core.c @@ -101,6 +101,11 @@ static const int hmc5883_regval_to_samp_freq[][2] = { {75, 0} }; +static const int hmc5983_regval_to_samp_freq[][2] = { + {0, 75}, {1, 50}, {3, 0}, {7, 50}, {15, 0}, {30, 0}, + {75, 0}, {220, 0} +}; + /* Describe chip variants */ struct hmc5843_chip_info { const struct iio_chan_spec *channels; @@ -457,7 +462,7 @@ static const struct iio_chan_spec hmc5843_channels[] = { IIO_CHAN_SOFT_TIMESTAMP(3), }; -/* Beware: Y and Z are exchanged on HMC5883 */ +/* Beware: Y and Z are exchanged on HMC5883 and 5983 */ static const struct iio_chan_spec hmc5883_channels[] = { HMC5843_CHANNEL(X, 0), HMC5843_CHANNEL(Z, 1), @@ -504,6 +509,15 @@ static const struct hmc5843_chip_info hmc5843_chip_info_tbl[] = { .n_regval_to_nanoscale = ARRAY_SIZE(hmc5883l_regval_to_nanoscale), }, + [HMC5983_ID] = { + .channels = hmc5883_channels, + .regval_to_samp_freq = hmc5983_regval_to_samp_freq, + .n_regval_to_samp_freq = + ARRAY_SIZE(hmc5983_regval_to_samp_freq), + .regval_to_nanoscale = hmc5883l_regval_to_nanoscale, + .n_regval_to_nanoscale = + ARRAY_SIZE(hmc5883l_regval_to_nanoscale), + } }; static int hmc5843_init(struct hmc5843_data *data) @@ -516,7 +530,7 @@ static int hmc5843_init(struct hmc5843_data *data) if (ret 0) return ret; if (id[0] != 'H' || id[1] != '4' || id[2] != '3') { - dev_err(data-dev, no HMC5843/5883/5883L sensor\n); + dev_err(data-dev, no HMC5843/5883/5883L/5983 sensor\n); return -ENODEV; } @@ -606,5 +620,5 @@ int hmc5843_common_remove(struct iio_dev *indio_dev) EXPORT_SYMBOL(hmc5843_common_remove); MODULE_AUTHOR(Shubhrajyoti Datta shubhrajy...@ti.com); -MODULE_DESCRIPTION(HMC5843/5883/5883L core driver); +MODULE_DESCRIPTION(HMC5843/5883/5883L/5983 core driver); MODULE_LICENSE(GPL); diff --git a/drivers/staging/iio/magnetometer/hmc5843_i2c.c b/drivers/staging/iio/magnetometer/hmc5843_i2c.c index b3c92d9..753c914 100644 --- a/drivers/staging/iio/magnetometer/hmc5843_i2c.c +++ b/drivers/staging/iio/magnetometer/hmc5843_i2c.c @@ -1,5 +1,5 @@ /* - * i2c driver for hmc5843/5843/5883/5883l + * i2c driver for hmc5843/5843/5883/5883l/5983 * * Split from hmc5843.c * Copyright (C) Josef Gajdusek a...@atx.name @@ -79,6 +79,7 @@ static const struct i2c_device_id hmc5843_id[] = { { hmc5843, HMC5843_ID }, { hmc5883, HMC5883_ID }, { hmc5883l, HMC5883L_ID }, + { hmc5983, HMC5983_ID }, { } }; MODULE_DEVICE_TABLE(i2c, hmc5843_id); @@ -102,5 +103,5 @@ static struct i2c_driver hmc5843_driver = { module_i2c_driver(hmc5843_driver); MODULE_AUTHOR(Josef Gajdusek a...@atx.name); -MODULE_DESCRIPTION(HMC5843/5883/5883L i2c driver); +MODULE_DESCRIPTION(HMC5843/5883/5883L/5983 i2c driver); MODULE_LICENSE(GPL); -- 1.8.5.5 ___ devel mailing list de...@linuxdriverproject.org
[PATCH 0/5] staging:iio:hmc5843: Few adjustments and support for hmc5983
This patch series modifies the hmc5843 driver to support the hmc5983 i2c and spi interfaces. Josef Gajdusek (5): staging:iio:hmc5843: Added regmap support staging:iio:hmc5843: Split hmc5843.c to multiple files staging:iio:hmc5843: register - value arrays now can have different lengths staging:iio:hmc5843: Add support for i2c hmc5983 staging:iio:hmc5843: Add support for spi hmc5983 drivers/staging/iio/magnetometer/Kconfig| 23 +- drivers/staging/iio/magnetometer/Makefile | 4 +- drivers/staging/iio/magnetometer/hmc5843.c | 652 drivers/staging/iio/magnetometer/hmc5843.h | 76 +++ drivers/staging/iio/magnetometer/hmc5843_core.c | 624 +++ drivers/staging/iio/magnetometer/hmc5843_i2c.c | 107 drivers/staging/iio/magnetometer/hmc5843_spi.c | 105 7 files changed, 935 insertions(+), 656 deletions(-) delete mode 100644 drivers/staging/iio/magnetometer/hmc5843.c create mode 100644 drivers/staging/iio/magnetometer/hmc5843.h create mode 100644 drivers/staging/iio/magnetometer/hmc5843_core.c create mode 100644 drivers/staging/iio/magnetometer/hmc5843_i2c.c create mode 100644 drivers/staging/iio/magnetometer/hmc5843_spi.c -- 1.8.5.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/5] staging:iio:hmc5843: Added regmap support
This patch changes hmc5843.c to use regmap. This provides transparent caching to the code as well as abstraction necessary to add support for SPI-based hmc5983. Signed-off-by: Josef Gajdusek a...@atx.name --- drivers/staging/iio/magnetometer/Kconfig | 1 + drivers/staging/iio/magnetometer/hmc5843.c | 145 +++-- 2 files changed, 98 insertions(+), 48 deletions(-) diff --git a/drivers/staging/iio/magnetometer/Kconfig b/drivers/staging/iio/magnetometer/Kconfig index 34634da..ad88d61 100644 --- a/drivers/staging/iio/magnetometer/Kconfig +++ b/drivers/staging/iio/magnetometer/Kconfig @@ -8,6 +8,7 @@ config SENSORS_HMC5843 depends on I2C select IIO_BUFFER select IIO_TRIGGERED_BUFFER + select REGMAP_I2C help Say Y here to add support for the Honeywell HMC5843, HMC5883 and HMC5883L 3-Axis Magnetometer (digital compass). diff --git a/drivers/staging/iio/magnetometer/hmc5843.c b/drivers/staging/iio/magnetometer/hmc5843.c index d4f4dd9..cc12308 100644 --- a/drivers/staging/iio/magnetometer/hmc5843.c +++ b/drivers/staging/iio/magnetometer/hmc5843.c @@ -21,6 +21,7 @@ #include linux/module.h #include linux/i2c.h +#include linux/regmap.h #include linux/iio/iio.h #include linux/iio/sysfs.h #include linux/iio/trigger_consumer.h @@ -34,6 +35,7 @@ #define HMC5843_DATA_OUT_MSB_REGS 0x03 #define HMC5843_STATUS_REG 0x09 #define HMC5843_ID_REG 0x0a +#define HMC5843_ID_END 0x0c enum hmc5843_ids { HMC5843_ID, @@ -49,6 +51,7 @@ enum hmc5843_ids { #define HMC5843_RANGE_GAIN_OFFSET 0x05 #define HMC5843_RANGE_GAIN_DEFAULT 0x01 #define HMC5843_RANGE_GAINS8 +#define HMC5843_RANGE_GAIN_MASK0xe0 /* Device status */ #define HMC5843_DATA_READY 0x01 @@ -68,6 +71,7 @@ enum hmc5843_ids { #define HMC5843_RATE_OFFSET0x02 #define HMC5843_RATE_DEFAULT 0x04 #define HMC5843_RATES 7 +#define HMC5843_RATE_MASK 0x1c /* Device measurement configuration */ #define HMC5843_MEAS_CONF_NORMAL 0x00 @@ -121,10 +125,7 @@ struct hmc5843_chip_info { struct hmc5843_data { struct i2c_client *client; struct mutex lock; - u8 rate; - u8 meas_conf; - u8 operating_mode; - u8 range; + struct regmap *regmap; const struct hmc5843_chip_info *variant; __be16 buffer[8]; /* 3x 16-bit channels + padding + 64-bit timestamp */ }; @@ -135,10 +136,8 @@ static s32 hmc5843_set_mode(struct hmc5843_data *data, u8 operating_mode) int ret; mutex_lock(data-lock); - ret = i2c_smbus_write_byte_data(data-client, HMC5843_MODE_REG, - operating_mode HMC5843_MODE_MASK); - if (ret = 0) - data-operating_mode = operating_mode; + ret = regmap_update_bits(data-regmap, HMC5843_MODE_REG, + HMC5843_MODE_MASK, operating_mode); mutex_unlock(data-lock); return ret; @@ -146,15 +145,15 @@ static s32 hmc5843_set_mode(struct hmc5843_data *data, u8 operating_mode) static int hmc5843_wait_measurement(struct hmc5843_data *data) { - s32 result; int tries = 150; + int val; + int ret; while (tries-- 0) { - result = i2c_smbus_read_byte_data(data-client, - HMC5843_STATUS_REG); - if (result 0) - return result; - if (result HMC5843_DATA_READY) + ret = regmap_read(data-regmap, HMC5843_STATUS_REG, val); + if (ret 0) + return ret; + if (val HMC5843_DATA_READY) break; msleep(20); } @@ -171,20 +170,20 @@ static int hmc5843_wait_measurement(struct hmc5843_data *data) static int hmc5843_read_measurement(struct hmc5843_data *data, int idx, int *val) { - s32 result; __be16 values[3]; + int ret; mutex_lock(data-lock); - result = hmc5843_wait_measurement(data); - if (result 0) { + ret = hmc5843_wait_measurement(data); + if (ret 0) { mutex_unlock(data-lock); - return result; + return ret; } - result = i2c_smbus_read_i2c_block_data(data-client, - HMC5843_DATA_OUT_MSB_REGS, sizeof(values), (u8 *) values); + ret = regmap_bulk_read(data-regmap, HMC5843_DATA_OUT_MSB_REGS, + values, sizeof(values)); mutex_unlock(data-lock); - if (result 0) - return -EINVAL; + if (ret 0) + return ret; *val = sign_extend32(be16_to_cpu(values[idx]), 15); return IIO_VAL_INT; @@ -208,16 +207,13 @@
[PATCH 2/5] staging:iio:hmc5843: Split hmc5843.c to multiple files
This patch splits hmc5843.c to multiple files - the interface-agnostic hmc5843_core.c, i2c specific hmc5843_i2c.c and header file hmc5843.h. This is another step to add support of SPI-enabled hmc5983. Signed-off-by: Josef Gajdusek a...@atx.name --- drivers/staging/iio/magnetometer/Kconfig| 16 +- drivers/staging/iio/magnetometer/Makefile | 3 +- drivers/staging/iio/magnetometer/hmc5843.c | 701 drivers/staging/iio/magnetometer/hmc5843.h | 75 +++ drivers/staging/iio/magnetometer/hmc5843_core.c | 598 drivers/staging/iio/magnetometer/hmc5843_i2c.c | 106 6 files changed, 793 insertions(+), 706 deletions(-) delete mode 100644 drivers/staging/iio/magnetometer/hmc5843.c create mode 100644 drivers/staging/iio/magnetometer/hmc5843.h create mode 100644 drivers/staging/iio/magnetometer/hmc5843_core.c create mode 100644 drivers/staging/iio/magnetometer/hmc5843_i2c.c diff --git a/drivers/staging/iio/magnetometer/Kconfig b/drivers/staging/iio/magnetometer/Kconfig index ad88d61..28c2612 100644 --- a/drivers/staging/iio/magnetometer/Kconfig +++ b/drivers/staging/iio/magnetometer/Kconfig @@ -5,15 +5,23 @@ menu Magnetometer sensors config SENSORS_HMC5843 tristate Honeywell HMC5843/5883/5883L 3-Axis Magnetometer - depends on I2C + depends on (I2C || SPI_MASTER) select IIO_BUFFER select IIO_TRIGGERED_BUFFER - select REGMAP_I2C + select SENSORS_HMC5843_I2C if (I2C) help Say Y here to add support for the Honeywell HMC5843, HMC5883 and HMC5883L 3-Axis Magnetometer (digital compass). - To compile this driver as a module, choose M here: the module - will be called hmc5843. + This driver can also be compiled as a set of modules. + If so, these modules will be created: + - hmc5843_core (core functions) + - hmc5843_i2c (support for HMC5843, HMC5883 and HMC5883L) + +config SENSORS_HMC5843_I2C + tristate + depends on I2C + depends on SENSORS_HMC5843 + select REGMAP_I2C endmenu diff --git a/drivers/staging/iio/magnetometer/Makefile b/drivers/staging/iio/magnetometer/Makefile index f9bfb2e..65baf1c 100644 --- a/drivers/staging/iio/magnetometer/Makefile +++ b/drivers/staging/iio/magnetometer/Makefile @@ -2,4 +2,5 @@ # Makefile for industrial I/O Magnetometer sensors # -obj-$(CONFIG_SENSORS_HMC5843) += hmc5843.o +obj-$(CONFIG_SENSORS_HMC5843) += hmc5843_core.o +obj-$(CONFIG_SENSORS_HMC5843_I2C) += hmc5843_i2c.o diff --git a/drivers/staging/iio/magnetometer/hmc5843.c b/drivers/staging/iio/magnetometer/hmc5843.c deleted file mode 100644 index cc12308..000 --- a/drivers/staging/iio/magnetometer/hmc5843.c +++ /dev/null @@ -1,701 +0,0 @@ -/* Copyright (C) 2010 Texas Instruments -Author: Shubhrajyoti Datta shubhrajy...@ti.com -Acknowledgement: Jonathan Cameron ji...@kernel.org for valuable inputs. - -Support for HMC5883 and HMC5883L by Peter Meerwald pme...@pmeerw.net. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include linux/module.h -#include linux/i2c.h -#include linux/regmap.h -#include linux/iio/iio.h -#include linux/iio/sysfs.h -#include linux/iio/trigger_consumer.h -#include linux/iio/buffer.h -#include linux/iio/triggered_buffer.h -#include linux/delay.h - -#define HMC5843_CONFIG_REG_A 0x00 -#define HMC5843_CONFIG_REG_B 0x01 -#define HMC5843_MODE_REG 0x02 -#define HMC5843_DATA_OUT_MSB_REGS 0x03 -#define HMC5843_STATUS_REG 0x09 -#define HMC5843_ID_REG 0x0a -#define HMC5843_ID_END 0x0c - -enum hmc5843_ids { - HMC5843_ID, - HMC5883_ID, - HMC5883L_ID, -}; - -/* - * Range gain settings in (+-)Ga - * Beware: HMC5843 and HMC5883 have different recommended sensor field - * ranges; default corresponds to +-1.0 Ga and +-1.3 Ga, respectively - */ -#define HMC5843_RANGE_GAIN_OFFSET 0x05 -#define HMC5843_RANGE_GAIN_DEFAULT 0x01 -#define HMC5843_RANGE_GAINS8 -#define HMC5843_RANGE_GAIN_MASK0xe0 - -/* Device status */ -#define HMC5843_DATA_READY 0x01 -#define
Re: [PATCH 3/6] lib80211: re-use string_escape_mem_any_np()
On Wed, 2014-07-02 at 06:43 -0700, Joe Perches wrote: On Wed, 2014-07-02 at 16:20 +0300, Andy Shevchenko wrote: In kernel we have function to escape a given string. Let's use it instead of custom approach. This fixes a bug. The current implementation wrongly prints octal numbers: only two first digits are used in case when 3 are required and the rest of the string ends up cut off. [] This code looks like it was adapted from the old print_mac ethernet code that was eventually replaced by a vsprintf pointer extension %pM So a better way to do this might be to add and use yet another vsprintf %pfoo extension for ssids. Might be, but it - doesn't reduce necessity of string_escape_mem (not only ssid are escaped in kernel) - prevents user to choose a rule what exactly their would like to escape (look at the other patches against ssid escaping) -- Andy Shevchenko andriy.shevche...@intel.com Intel Finland Oy ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 5/6] staging: rtl8192e: re-use string_escape_mem()
On Wed, 2014-07-02 at 06:35 -0700, Joe Perches wrote: On Wed, 2014-07-02 at 16:20 +0300, Andy Shevchenko wrote: Let's use kernel's library function to escape a buffer. [] @@ -2965,15 +2965,8 @@ static inline const char *escape_essid(const char *essid, u8 essid_len) } essid_len = min(essid_len, (u8)IW_ESSID_MAX_SIZE); - while (essid_len--) { - if (*s == '\0') { - *d++ = '\\'; - *d++ = '0'; - s++; - } else { - *d++ = *s++; - } - } + d += string_escape_mem(essid, essid_len, escaped, sizeof(escaped) - 1, + ESCAPE_NULL, NULL); I'd've probably used d += string_escape_mem(essid, essid_len, d, ... or d = escaped + string_escap_mem(essid, essid_len, escaped, ... so there's some relation between the thing being added to *d = '\0'; or maybe not used d at all with escaped[1 + string_escape_mem(etc...)] = 0; Perhaps without '1 + ' part. I could update this as well if someone insists. return escaped; } Unrelated but this isn't a thread safe or multiple instance safe function. Do you mean escape_ssid() or string_escape_mem() or both? For the string_escape_mem() I think caller should take care of. It seems it's used only in debugging message output though. -- Andy Shevchenko andriy.shevche...@intel.com Intel Finland Oy ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/6] lib80211: re-use string_escape_mem_any_np()
On Wed, 2014-07-02 at 16:20 +0300, Andy Shevchenko wrote: In kernel we have function to escape a given string. Let's use it instead of custom approach. This fixes a bug. The current implementation wrongly prints octal numbers: only two first digits are used in case when 3 are required and the rest of the string ends up cut off. [] diff --git a/net/wireless/lib80211.c b/net/wireless/lib80211.c [] @@ -48,31 +49,10 @@ static void lib80211_crypt_deinit_handler(unsigned long data); const char *print_ssid(char *buf, const char *ssid, u8 ssid_len) { - const char *s = ssid; char *d = buf; ssid_len = min_t(u8, ssid_len, IEEE80211_MAX_SSID_LEN); - while (ssid_len--) { - if (isprint(*s)) { - *d++ = *s++; - continue; - } - - *d++ = '\\'; - if (*s == '\0') - *d++ = '0'; - else if (*s == '\n') - *d++ = 'n'; - else if (*s == '\r') - *d++ = 'r'; - else if (*s == '\t') - *d++ = 't'; - else if (*s == '\\') - *d++ = '\\'; - else - d += snprintf(d, 3, %03o, *s); - s++; - } + d += string_escape_mem_any_np(ssid, ssid_len, buf, ~0UL, NULL); *d = '\0'; return buf; } This code looks like it was adapted from the old print_mac ethernet code that was eventually replaced by a vsprintf pointer extension %pM So a better way to do this might be to add and use yet another vsprintf %pfoo extension for ssids. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 5/6] staging: rtl8192e: re-use string_escape_mem()
On Wed, 2014-07-02 at 16:20 +0300, Andy Shevchenko wrote: Let's use kernel's library function to escape a buffer. [] diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h [] @@ -2956,7 +2957,6 @@ extern inline int rtllib_get_scans(struct rtllib_device *ieee) static inline const char *escape_essid(const char *essid, u8 essid_len) { static char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; - const char *s = essid; char *d = escaped; if (rtllib_is_empty_essid(essid, essid_len)) { @@ -2965,15 +2965,8 @@ static inline const char *escape_essid(const char *essid, u8 essid_len) } essid_len = min(essid_len, (u8)IW_ESSID_MAX_SIZE); - while (essid_len--) { - if (*s == '\0') { - *d++ = '\\'; - *d++ = '0'; - s++; - } else { - *d++ = *s++; - } - } + d += string_escape_mem(essid, essid_len, escaped, sizeof(escaped) - 1, +ESCAPE_NULL, NULL); I'd've probably used d += string_escape_mem(essid, essid_len, d, ... or d = escaped + string_escap_mem(essid, essid_len, escaped, ... so there's some relation between the thing being added to *d = '\0'; or maybe not used d at all with escaped[1 + string_escape_mem(etc...)] = 0; return escaped; } Unrelated but this isn't a thread safe or multiple instance safe function. It seems it's used only in debugging message output though. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH RFC v2 3/8] component: add support for component match array
2014-07-01 23:22 GMT+09:00 Russell King - ARM Linux li...@arm.linux.org.uk: On Thu, Jun 26, 2014 at 03:46:01PM +0100, Russell King - ARM Linux wrote: On Thu, Jun 26, 2014 at 02:34:17PM +0200, Philipp Zabel wrote: Hi Russell, On Tue, Jun 24, 2014 at 9:29 PM, Russell King rmk+ker...@arm.linux.org.uk wrote: [...] +/* + * Add a component to be matched. + * + * The match array is first created or extended if necessary. + */ +void component_match_add(struct device *dev, struct component_match **matchptr, + int (*compare)(struct device *, void *), void *compare_data) +{ + struct component_match *match = *matchptr; + + if (IS_ERR(match)) + return; + + if (!match || match-num == match-alloc) { + size_t new_size = match ? match-alloc + 16 : 15; + + match = component_match_realloc(dev, match, new_size); + + *matchptr = match; + + if (IS_ERR(match)) + return; + } + + match-compare[match-num].fn = compare; + match-compare[match-num].data = compare_data; + match-num++; +} component_match_add should be exported. Fixed, thanks. As there's no further comments, and Inki Dae has not responded, I'm It's has been just a week. I will check and look into your patch series. I think Exynos drm should also be considered for the use of component match array. Thanks, Inki Dae going to send these out without the RFC tag in the hope that people will provide acks. This allows us to move forward with this despite the Exynos DRM blockage. The ultimate plan is for patches 1 to 3 inclusive to be merged into Greg's driver tree, 1 to 3 and 5 into Greg's staging tree, and 1 to 3 and 4 for David Airlie's DRM tree - patches 1 to 3 are needed for both patches 4 and 5. -- FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly improving, and getting towards what was expected from it. ___ dri-devel mailing list dri-de...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH RFC v2 3/8] component: add support for component match array
On Thu, Jul 03, 2014 at 12:26:39AM +0900, Inki Dae wrote: It's has been just a week. I will check and look into your patch series. I think Exynos drm should also be considered for the use of component match array. Actually, this series has been around for much longer than just a week. Your new usage introduced in the recent merge window is what has resulted in you becoming aware of this series. It was developed before April through discussions, and then shared with those people. Then, April 27th, it was posted publically to all the recipients except yourself (because Exynos hadn't visibly been converted). At that time, two reviewed-by tags were given. It was also sent out last week, with yourself added to the recepient list because there is now a dependency with some of your work. However, what I'm asking for is *not* the entire series to be merged at this point - that would break Exynos DRM. I'm asking for the first three to be merged initially by Greg, which gets the new interface in place without breaking existing users. We can then convert existing users at a slower rate, and remove the old interface once everyone has caught up. So, I'd ask that you give priority to looking at the first three patches and deciding whether you find them acceptable as a replacement interface, rather than trying to review the entire set of six core patches (1,2,3,6,7,8). What I'm trying to avoid here is for all these patches to be delayed past the next merge window, and pushed into the next cycle. That's likely to end up in the same scenario as exists with Exynos DRM today, only with other new users of the existing interface - and then have to repeat this whole try to get the new users to review this set of changes cycle again. We're half way through -rc3 right now. -final occurs anytime between -rc6 and -rc9, which could be just three and a half weeks away. I have other changes which I need to get out onto the list(s) which depend on this too (for DRM) which I'm hoping to also make this coming merge window, but I can't start that process until I know where I stand with these. -- FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly improving, and getting towards what was expected from it. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Q] Removed cxt1e1 module in staging branch
On 02/07/14 12:41, DaeSeok Youn wrote: Hi, all. I saw your change which removes cxt1e1 in staging tree. Actually, I have been cleaning up coding style and fixing minor issues without real cxt1e1 hardware. And I am not cleaning up all of files in cxt1e1 but some files already done and have plans for other files. may be.. I cannot fix major issues because I don't have a real device but minor issues can be fixed and coding style also. If you want to fix majors' which can be with real device, stay removed. But if it can be reverted for fixing minor issues including coding style, please revert. I cannot focus all of my time on making patches, but I can make patches steadily for that module. Hi DaeSeok, Thanks for the patches, but there needs to be progress made towards moving the driver out of staging. There's not much point in fixing coding style and other smaller issues if larger issues remain unfixed and the driver eventually gets deleted anyway. I don't really know what needs to be done to get it moved out at all, since the driver never had a TODO file and the original thread [1] doesn't say much, so I don't know if it requires the hardware or not, but I suspect it does. Maybe you could work on another driver? Sorry, Kristina [1] http://marc.info/?t=12565885401r=1w=4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/6] lib80211: re-use string_escape_mem_any_np()
On Wed, 2014-07-02 at 17:06 +0300, Andy Shevchenko wrote: On Wed, 2014-07-02 at 06:43 -0700, Joe Perches wrote: On Wed, 2014-07-02 at 16:20 +0300, Andy Shevchenko wrote: In kernel we have function to escape a given string. Let's use it instead of custom approach. This fixes a bug. The current implementation wrongly prints octal numbers: only two first digits are used in case when 3 are required and the rest of the string ends up cut off. [] This code looks like it was adapted from the old print_mac ethernet code that was eventually replaced by a vsprintf pointer extension %pM So a better way to do this might be to add and use yet another vsprintf %pfoo extension for ssids. Might be, but it - doesn't reduce necessity of string_escape_mem (not only ssid are escaped in kernel) - prevents user to choose a rule what exactly their would like to escape (look at the other patches against ssid escaping) %pEFLAGS would allow the same arbitrary combinations of your flags. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: rtl8192e: Fix potential NULL pointer dereference
On Wed, Jul 02, 2014 at 11:25:51AM +0200, Emil Goode wrote: We need to make sure the struct rtllib_device pointer ieee is not NULL after the goto rx_dropped label since it is dereferenced there. Signed-off-by: Emil Goode emilgo...@gmail.com --- drivers/staging/rtl8192e/rtllib_rx.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 60de54c..7db3e74 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1496,7 +1496,8 @@ int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb, return ret; rx_dropped: - ieee-stats.rx_dropped++; + if (ieee) + ieee-stats.rx_dropped++; return 0; } EXPORT_SYMBOL(rtllib_rx); Is this something that is hitting users today in the tree, or is this just a bug you found looking at the code? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/48] staging: rtl8188eu: Remove struct evt_priv and its uses
c2h_wk (work_struct) is naver scheduled to handle events, so no use of keeping event data. And also function rtw_hal_c2h_handler() responsible for handling c2h events, is a dummy function. Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 86 - drivers/staging/rtl8188eu/core/rtw_mlme_ext.c |4 -- drivers/staging/rtl8188eu/include/cmd_osdep.h |1 - drivers/staging/rtl8188eu/include/drv_types.h |1 - drivers/staging/rtl8188eu/include/rtw_cmd.h | 14 drivers/staging/rtl8188eu/os_dep/os_intfs.c |8 --- 6 files changed, 114 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 310e916..293fda4 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -72,43 +72,6 @@ exit: return res; } -static void c2h_wk_callback(struct work_struct *work); - -int _rtw_init_evt_priv(struct evt_priv *pevtpriv) -{ - int res = _SUCCESS; - - - /* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */ - atomic_set(pevtpriv-event_seq, 0); - pevtpriv-evt_done_cnt = 0; - - INIT_WORK(pevtpriv-c2h_wk, c2h_wk_callback); - pevtpriv-c2h_wk_alive = false; - pevtpriv-c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN+1); - - - return res; -} - -void rtw_free_evt_priv(struct evt_priv *pevtpriv) -{ - - RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, (+rtw_free_evt_priv\n)); - - cancel_work_sync(pevtpriv-c2h_wk); - while (pevtpriv-c2h_wk_alive) - msleep(10); - - while (!rtw_cbuf_empty(pevtpriv-c2h_queue)) { - void *c2h = rtw_cbuf_pop(pevtpriv-c2h_queue); - if (c2h != NULL c2h != (void *)pevtpriv) - kfree(c2h); - } - RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, (-rtw_free_evt_priv\n)); - -} - void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) { @@ -175,13 +138,6 @@ u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) return res; } -u32 rtw_init_evt_priv(struct evt_priv *pevtpriv) -{ - int res; - res = _rtw_init_evt_priv(pevtpriv); - return res; -} - void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) { RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, (rtw_free_cmd_priv\n)); @@ -1877,48 +1833,6 @@ exit: return ret; } -static void c2h_wk_callback(struct work_struct *work) -{ - struct evt_priv *evtpriv = container_of(work, struct evt_priv, c2h_wk); - struct adapter *adapter = container_of(evtpriv, struct adapter, evtpriv); - struct c2h_evt_hdr *c2h_evt; - c2h_id_filter ccx_id_filter = rtw_hal_c2h_id_filter_ccx(adapter); - - evtpriv-c2h_wk_alive = true; - - while (!rtw_cbuf_empty(evtpriv-c2h_queue)) { - c2h_evt = (struct c2h_evt_hdr *) - rtw_cbuf_pop(evtpriv-c2h_queue); - if (c2h_evt != NULL) - /* This C2H event is read, clear it */ - c2h_evt_clear(adapter); - else { - c2h_evt = (struct c2h_evt_hdr *)rtw_malloc(16); - /* This C2H event is not read, read clear now */ - if (c2h_evt != NULL - c2h_evt_read(adapter, (u8 *)c2h_evt) != _SUCCESS) - continue; - } - - /* Special pointer to trigger c2h_evt_clear only */ - if ((void *)c2h_evt == (void *)evtpriv) - continue; - - if (!c2h_evt_exist(c2h_evt)) { - kfree(c2h_evt); - continue; - } - - if (ccx_id_filter(c2h_evt-id) == true) { - /* Handle CCX report here */ - rtw_hal_c2h_handler(adapter, c2h_evt); - kfree(c2h_evt); - } - } - - evtpriv-c2h_wk_alive = false; -} - u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf) { struct drvextra_cmd_parm *pdrvextra_cmd; diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index c42d9fd..c4888b1 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -5461,7 +5461,6 @@ u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf) u16 evt_sz; uint*peventbuf; void (*event_callback)(struct adapter *dev, u8 *pbuf); - struct evt_priv *pevt_priv = (padapter-evtpriv); peventbuf = (uint *)pbuf; evt_sz = (u16)(*peventbuf0x); @@ -5482,15 +5481,12 @@ u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf) goto _abort_event_; } - atomic_inc(pevt_priv-event_seq); - peventbuf += 2; if (peventbuf) {
[PATCH 03/48] staging: rtl8188eu: Remove unused function c2h_evt_read()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/hal/hal_com.c | 49 --- drivers/staging/rtl8188eu/include/hal_com.h |2 -- 2 files changed, 51 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/hal_com.c b/drivers/staging/rtl8188eu/hal/hal_com.c index baefb46..c91a58c 100644 --- a/drivers/staging/rtl8188eu/hal/hal_com.c +++ b/drivers/staging/rtl8188eu/hal/hal_com.c @@ -330,52 +330,3 @@ void c2h_evt_clear(struct adapter *adapter) { usb_write8(adapter, REG_C2HEVT_CLEAR, C2H_EVT_HOST_CLOSE); } - -s32 c2h_evt_read(struct adapter *adapter, u8 *buf) -{ - s32 ret = _FAIL; - struct c2h_evt_hdr *c2h_evt; - int i; - u8 trigger; - - if (buf == NULL) - goto exit; - - trigger = usb_read8(adapter, REG_C2HEVT_CLEAR); - - if (trigger == C2H_EVT_HOST_CLOSE) - goto exit; /* Not ready */ - else if (trigger != C2H_EVT_FW_CLOSE) - goto clear_evt; /* Not a valid value */ - - c2h_evt = (struct c2h_evt_hdr *)buf; - - memset(c2h_evt, 0, 16); - - *buf = usb_read8(adapter, REG_C2HEVT_MSG_NORMAL); - *(buf+1) = usb_read8(adapter, REG_C2HEVT_MSG_NORMAL + 1); - - RT_PRINT_DATA(_module_hal_init_c_, _drv_info_, c2h_evt_read(): , - c2h_evt , sizeof(c2h_evt)); - - /* Read the content */ - for (i = 0; i c2h_evt-plen; i++) - c2h_evt-payload[i] = usb_read8(adapter, REG_C2HEVT_MSG_NORMAL + - sizeof(*c2h_evt) + i); - - RT_PRINT_DATA(_module_hal_init_c_, _drv_info_, - c2h_evt_read(): Command Content:\n, - c2h_evt-payload, c2h_evt-plen); - - ret = _SUCCESS; - -clear_evt: - /* - * Clear event to notify FW we have read the command. - * If this field isn't clear, the FW won't update the next - * command message. - */ - c2h_evt_clear(adapter); -exit: - return ret; -} diff --git a/drivers/staging/rtl8188eu/include/hal_com.h b/drivers/staging/rtl8188eu/include/hal_com.h index 81c2709..1527efa 100644 --- a/drivers/staging/rtl8188eu/include/hal_com.h +++ b/drivers/staging/rtl8188eu/include/hal_com.h @@ -168,6 +168,4 @@ bool Hal_MappingOutPipe(struct adapter *pAdapter, u8 NumOutPipe); void hal_init_macaddr(struct adapter *adapter); void c2h_evt_clear(struct adapter *adapter); -s32 c2h_evt_read(struct adapter *adapter, u8 *buf); - #endif /* __HAL_COMMON_H__ */ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/48] staging: rtl8188eu: Remove function c2h_evt_hdl()
c2h_evt_hdl() calls a dummy function rtw_hal_c2h_handler() to handle events, so no use of keeping it. Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 28 1 file changed, 28 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 293fda4..a2b355c 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -1808,31 +1808,6 @@ exit: return res; } -static s32 c2h_evt_hdl(struct adapter *adapter, struct c2h_evt_hdr *c2h_evt, c2h_id_filter filter) -{ - s32 ret = _FAIL; - u8 buf[16]; - - if (!c2h_evt) { - /* No c2h event in cmd_obj, read c2h event before handling*/ - if (c2h_evt_read(adapter, buf) == _SUCCESS) { - c2h_evt = (struct c2h_evt_hdr *)buf; - - if (filter filter(c2h_evt-id) == false) - goto exit; - - ret = rtw_hal_c2h_handler(adapter, c2h_evt); - } - } else { - if (filter filter(c2h_evt-id) == false) - goto exit; - - ret = rtw_hal_c2h_handler(adapter, c2h_evt); - } -exit: - return ret; -} - u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf) { struct drvextra_cmd_parm *pdrvextra_cmd; @@ -1863,9 +1838,6 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf) rtw_chk_hi_queue_hdl(padapter); break; #endif /* CONFIG_88EU_AP_MODE */ - case C2H_WK_CID: - c2h_evt_hdl(padapter, (struct c2h_evt_hdr *)pdrvextra_cmd-pbuf, NULL); - break; default: break; } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/48] staging: rtl8188eu: Remove unused function rtw_hal_c2h_id_filter_ccx()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/hal/hal_intf.c |5 - drivers/staging/rtl8188eu/include/hal_intf.h |4 2 files changed, 9 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/hal_intf.c b/drivers/staging/rtl8188eu/hal/hal_intf.c index 279dd0b..2faa690 100644 --- a/drivers/staging/rtl8188eu/hal/hal_intf.c +++ b/drivers/staging/rtl8188eu/hal/hal_intf.c @@ -375,8 +375,3 @@ void rtw_hal_reset_security_engine(struct adapter *adapter) if (adapter-HalFunc.hal_reset_security_engine) adapter-HalFunc.hal_reset_security_engine(adapter); } - -c2h_id_filter rtw_hal_c2h_id_filter_ccx(struct adapter *adapter) -{ - return adapter-HalFunc.c2h_id_filter_ccx; -} diff --git a/drivers/staging/rtl8188eu/include/hal_intf.h b/drivers/staging/rtl8188eu/include/hal_intf.h index f7ce9de..56d5c50 100644 --- a/drivers/staging/rtl8188eu/include/hal_intf.h +++ b/drivers/staging/rtl8188eu/include/hal_intf.h @@ -144,8 +144,6 @@ enum hal_intf_ps_func { HAL_MAX_ID, }; -typedef s32 (*c2h_id_filter)(u8 id); - struct hal_ops { u32 (*hal_power_on)(struct adapter *padapter); u32 (*hal_init)(struct adapter *padapter); @@ -236,7 +234,6 @@ struct hal_ops { void (*hal_notch_filter)(struct adapter *adapter, bool enable); void (*hal_reset_security_engine)(struct adapter *adapter); - c2h_id_filter c2h_id_filter_ccx; }; enum rt_eeprom_type { @@ -340,7 +337,6 @@ int rtw_hal_iol_cmd(struct adapter *adapter, struct xmit_frame *xmit_frame, void rtw_hal_notch_filter(struct adapter *adapter, bool enable); void rtw_hal_reset_security_engine(struct adapter *adapter); -c2h_id_filter rtw_hal_c2h_id_filter_ccx(struct adapter *adapter); void indicate_wx_scan_complete_event(struct adapter *padapter); u8 rtw_do_join(struct adapter *padapter); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/48] staging: rtl8188eu: Remove unused function rtw_c2h_wk_cmd()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c| 33 --- drivers/staging/rtl8188eu/include/rtw_cmd.h |2 -- 2 files changed, 35 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 294c9e2..ec0990f 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -1741,39 +1741,6 @@ exit: } #endif -u8 rtw_c2h_wk_cmd(struct adapter *padapter, u8 *c2h_evt) -{ - struct cmd_obj *ph2c; - struct drvextra_cmd_parm *pdrvextra_cmd_parm; - struct cmd_priv *pcmdpriv = padapter-cmdpriv; - u8 res = _SUCCESS; - - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); - if (ph2c == NULL) { - res = _FAIL; - goto exit; - } - - pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), GFP_KERNEL); - if (pdrvextra_cmd_parm == NULL) { - kfree(ph2c); - res = _FAIL; - goto exit; - } - - pdrvextra_cmd_parm-ec_id = C2H_WK_CID; - pdrvextra_cmd_parm-type_size = c2h_evt ? 16 : 0; - pdrvextra_cmd_parm-pbuf = c2h_evt; - - init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra)); - - res = rtw_enqueue_cmd(pcmdpriv, ph2c); - -exit: - - return res; -} - u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf) { struct drvextra_cmd_parm *pdrvextra_cmd; diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index bb1f8f0..ca17145 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -776,8 +776,6 @@ u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan, u8 enqueue); u8 rtw_set_csa_cmd(struct adapter *padapter, u8 new_ch_no); u8 rtw_tdls_cmd(struct adapter *padapter, u8 *addr, u8 option); -u8 rtw_c2h_wk_cmd(struct adapter *padapter, u8 *c2h_evt); - u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf); void rtw_survey_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/48] staging: rtl8188eu: Remove unused function rtw_setphy_cmd()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c| 40 --- drivers/staging/rtl8188eu/include/rtw_cmd.h |1 - 2 files changed, 41 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index cc8b82c..ba325f8 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -482,46 +482,6 @@ exit: return res; } -/* -unsigned char rtw_setphy_cmd(unsigned char *adapter) - -1. be called only after rtw_update_registrypriv_dev_network(~) or mp testing program -2. for AdHoc/Ap mode or mp mode? - -*/ -u8 rtw_setphy_cmd(struct adapter *padapter, u8 modem, u8 ch) -{ - struct cmd_obj *ph2c; - struct setphy_parm *psetphypara; - struct cmd_priv *pcmdpriv = padapter-cmdpriv; - u8 res = _SUCCESS; - - - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); - if (ph2c == NULL) { - res = _FAIL; - goto exit; - } - psetphypara = kzalloc(sizeof(struct setphy_parm), GFP_KERNEL); - - if (psetphypara == NULL) { - kfree(ph2c); - res = _FAIL; - goto exit; - } - - init_h2fwcmd_w_parm_no_rsp(ph2c, psetphypara, _SetPhy_CMD_); - - RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, (CH =%d, modem =%d, ch, modem)); - - psetphypara-modem = modem; - psetphypara-rfchannel = ch; - - res = rtw_enqueue_cmd(pcmdpriv, ph2c); -exit: - return res; -} - u8 rtw_setbbreg_cmd(struct adapter *padapter, u8 offset, u8 val) { struct cmd_obj *ph2c; diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index fb999fc..9bae5541 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -733,7 +733,6 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, u8 rtw_createbss_cmd(struct adapter *padapter); u8 rtw_createbss_cmd_ex(struct adapter *padapter, unsigned char *pbss, unsigned int sz); -u8 rtw_setphy_cmd(struct adapter *padapter, u8 modem, u8 ch); u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key); u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/48] staging: rtl8188eu: Remove unused function rtw_setbasicrate_cmd()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c| 33 --- drivers/staging/rtl8188eu/include/rtw_cmd.h |1 - 2 files changed, 34 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index ec0990f..cc8b82c 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -482,39 +482,6 @@ exit: return res; } -u8 rtw_setbasicrate_cmd(struct adapter *padapter, u8 *rateset) -{ - struct cmd_obj *ph2c; - struct setbasicrate_parm *pssetbasicratepara; - struct cmd_priv *pcmdpriv = padapter-cmdpriv; - u8 res = _SUCCESS; - - - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); - if (ph2c == NULL) { - res = _FAIL; - goto exit; - } - pssetbasicratepara = kzalloc(sizeof(struct setbasicrate_parm), GFP_KERNEL); - - if (pssetbasicratepara == NULL) { - kfree(ph2c); - res = _FAIL; - goto exit; - } - - init_h2fwcmd_w_parm_no_rsp(ph2c, pssetbasicratepara, _SetBasicRate_CMD_); - - memcpy(pssetbasicratepara-basicrates, rateset, NumRates); - - res = rtw_enqueue_cmd(pcmdpriv, ph2c); -exit: - - - return res; -} - - /* unsigned char rtw_setphy_cmd(unsigned char *adapter) diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index ca17145..fb999fc 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -743,7 +743,6 @@ u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infra networktype); u8 rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset); -u8 rtw_setbasicrate_cmd(struct adapter *padapter, u8 *rateset); u8 rtw_setbbreg_cmd(struct adapter *padapter, u8 offset, u8 val); u8 rtw_setrfreg_cmd(struct adapter *padapter, u8 offset, u32 val); u8 rtw_getbbreg_cmd(struct adapter *padapter, u8 offset, u8 *pval); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/48] staging: rtl8188eu: Remove unused function rtw_setbbreg_cmd()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c| 30 --- drivers/staging/rtl8188eu/include/rtw_cmd.h |1 - 2 files changed, 31 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index ba325f8..4d78e23 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -482,36 +482,6 @@ exit: return res; } -u8 rtw_setbbreg_cmd(struct adapter *padapter, u8 offset, u8 val) -{ - struct cmd_obj *ph2c; - struct writeBB_parm *pwritebbparm; - struct cmd_priv *pcmdpriv = padapter-cmdpriv; - u8 res = _SUCCESS; - - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); - if (ph2c == NULL) { - res = _FAIL; - goto exit; - } - pwritebbparm = kzalloc(sizeof(struct writeBB_parm), GFP_KERNEL); - - if (pwritebbparm == NULL) { - kfree(ph2c); - res = _FAIL; - goto exit; - } - - init_h2fwcmd_w_parm_no_rsp(ph2c, pwritebbparm, GEN_CMD_CODE(_SetBBReg)); - - pwritebbparm-offset = offset; - pwritebbparm-value = val; - - res = rtw_enqueue_cmd(pcmdpriv, ph2c); -exit: - return res; -} - u8 rtw_getbbreg_cmd(struct adapter *padapter, u8 offset, u8 *pval) { struct cmd_obj *ph2c; diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index 9bae5541..fe21838 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -742,7 +742,6 @@ u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infra networktype); u8 rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset); -u8 rtw_setbbreg_cmd(struct adapter *padapter, u8 offset, u8 val); u8 rtw_setrfreg_cmd(struct adapter *padapter, u8 offset, u32 val); u8 rtw_getbbreg_cmd(struct adapter *padapter, u8 offset, u8 *pval); u8 rtw_getrfreg_cmd(struct adapter *padapter, u8 offset, u8 *pval); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/48] staging: rtl8188eu: Remove unused function rtw_[set, get]rfreg_cmd()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c| 67 --- drivers/staging/rtl8188eu/include/rtw_cmd.h |2 - 2 files changed, 69 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 96e5946..c62db33 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -482,73 +482,6 @@ exit: return res; } -u8 rtw_setrfreg_cmd(struct adapter *padapter, u8 offset, u32 val) -{ - struct cmd_obj *ph2c; - struct writeRF_parm *pwriterfparm; - struct cmd_priv *pcmdpriv = padapter-cmdpriv; - u8 res = _SUCCESS; - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); - if (ph2c == NULL) { - res = _FAIL; - goto exit; - } - pwriterfparm = kzalloc(sizeof(struct writeRF_parm), GFP_KERNEL); - - if (pwriterfparm == NULL) { - kfree(ph2c); - res = _FAIL; - goto exit; - } - - init_h2fwcmd_w_parm_no_rsp(ph2c, pwriterfparm, GEN_CMD_CODE(_SetRFReg)); - - pwriterfparm-offset = offset; - pwriterfparm-value = val; - - res = rtw_enqueue_cmd(pcmdpriv, ph2c); -exit: - return res; -} - -u8 rtw_getrfreg_cmd(struct adapter *padapter, u8 offset, u8 *pval) -{ - struct cmd_obj *ph2c; - struct readRF_parm *prdrfparm; - struct cmd_priv *pcmdpriv = padapter-cmdpriv; - u8 res = _SUCCESS; - - - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); - if (ph2c == NULL) { - res = _FAIL; - goto exit; - } - - prdrfparm = kzalloc(sizeof(struct readRF_parm), GFP_KERNEL); - if (prdrfparm == NULL) { - kfree(ph2c); - res = _FAIL; - goto exit; - } - - INIT_LIST_HEAD(ph2c-list); - ph2c-cmdcode = GEN_CMD_CODE(_GetRFReg); - ph2c-parmbuf = (unsigned char *)prdrfparm; - ph2c-cmdsz = sizeof(struct readRF_parm); - ph2c-rsp = pval; - ph2c-rspsz = sizeof(struct readRF_rsp); - - prdrfparm-offset = offset; - - res = rtw_enqueue_cmd(pcmdpriv, ph2c); - -exit: - - - return res; -} - void rtw_getbbrfreg_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *pcmd) { diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index f2ddb8a..432fbd2 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -742,8 +742,6 @@ u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infra networktype); u8 rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset); -u8 rtw_setrfreg_cmd(struct adapter *padapter, u8 offset, u32 val); -u8 rtw_getrfreg_cmd(struct adapter *padapter, u8 offset, u8 *pval); u8 rtw_setrfintfs_cmd(struct adapter *padapter, u8 mode); u8 rtw_setrttbl_cmd(struct adapter *padapter, struct setratable_parm *prate_table); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/48] staging: rtl8188eu: Remove unused function rtw_getbbreg_cmd()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c| 33 --- drivers/staging/rtl8188eu/include/rtw_cmd.h |1 - 2 files changed, 34 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 4d78e23..96e5946 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -482,39 +482,6 @@ exit: return res; } -u8 rtw_getbbreg_cmd(struct adapter *padapter, u8 offset, u8 *pval) -{ - struct cmd_obj *ph2c; - struct readBB_parm *prdbbparm; - struct cmd_priv *pcmdpriv = padapter-cmdpriv; - u8 res = _SUCCESS; - - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); - if (ph2c == NULL) { - res = _FAIL; - goto exit; - } - prdbbparm = kzalloc(sizeof(struct readBB_parm), GFP_KERNEL); - - if (prdbbparm == NULL) { - kfree(ph2c); - return _FAIL; - } - - INIT_LIST_HEAD(ph2c-list); - ph2c-cmdcode = GEN_CMD_CODE(_GetBBReg); - ph2c-parmbuf = (unsigned char *)prdbbparm; - ph2c-cmdsz = sizeof(struct readBB_parm); - ph2c-rsp = pval; - ph2c-rspsz = sizeof(struct readBB_rsp); - - prdbbparm-offset = offset; - - res = rtw_enqueue_cmd(pcmdpriv, ph2c); -exit: - return res; -} - u8 rtw_setrfreg_cmd(struct adapter *padapter, u8 offset, u32 val) { struct cmd_obj *ph2c; diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index fe21838..f2ddb8a 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -743,7 +743,6 @@ u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infra networktype); u8 rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset); u8 rtw_setrfreg_cmd(struct adapter *padapter, u8 offset, u32 val); -u8 rtw_getbbreg_cmd(struct adapter *padapter, u8 offset, u8 *pval); u8 rtw_getrfreg_cmd(struct adapter *padapter, u8 offset, u8 *pval); u8 rtw_setrfintfs_cmd(struct adapter *padapter, u8 mode); u8 rtw_setrttbl_cmd(struct adapter *padapter, -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/48] staging: rtl8188eu: Remove unused function rtw_setrttbl_cmd()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c| 29 --- drivers/staging/rtl8188eu/include/rtw_cmd.h |9 - 2 files changed, 38 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index c62db33..51f624d 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -890,35 +890,6 @@ exit: return res; } -u8 rtw_setrttbl_cmd(struct adapter *padapter, struct setratable_parm *prate_table) -{ - struct cmd_obj *ph2c; - struct setratable_parm *psetrttblparm; - struct cmd_priv *pcmdpriv = padapter-cmdpriv; - u8 res = _SUCCESS; - - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); - if (ph2c == NULL) { - res = _FAIL; - goto exit; - } - psetrttblparm = kzalloc(sizeof(struct setratable_parm), GFP_KERNEL); - - if (psetrttblparm == NULL) { - kfree(ph2c); - res = _FAIL; - goto exit; - } - - init_h2fwcmd_w_parm_no_rsp(ph2c, psetrttblparm, GEN_CMD_CODE(_SetRaTable)); - - memcpy(psetrttblparm, prate_table, sizeof(struct setratable_parm)); - - res = rtw_enqueue_cmd(pcmdpriv, ph2c); -exit: - return res; -} - u8 rtw_setassocsta_cmd(struct adapter *padapter, u8 *mac_addr) { struct cmd_priv *pcmdpriv = padapter-cmdpriv; diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index 432fbd2..af18c75 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -590,13 +590,6 @@ struct getcountjudge_rsp { u8 count_judge[MAX_RATES_LENGTH]; }; -struct setratable_parm { - u8 ss_ForceUp[NumRates]; - u8 ss_ULevel[NumRates]; - u8 ss_DLevel[NumRates]; - u8 count_judge[NumRates]; -}; - struct getratable_parm { uint rsvd; }; @@ -743,8 +736,6 @@ u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infra networktype); u8 rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset); u8 rtw_setrfintfs_cmd(struct adapter *padapter, u8 mode); -u8 rtw_setrttbl_cmd(struct adapter *padapter, - struct setratable_parm *prate_table); u8 rtw_gettssi_cmd(struct adapter *padapter, u8 offset, u8 *pval); u8 rtw_setfwdig_cmd(struct adapter *padapter, u8 type); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 20/48] staging: rtl8188eu: Remove unused function rtw_setstandby_cmd()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c| 34 --- drivers/staging/rtl8188eu/include/rtw_cmd.h |1 - 2 files changed, 35 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index bf7a81d..5fab194 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -339,40 +339,6 @@ post_process: complete_and_exit(NULL, 0); } -u8 rtw_setstandby_cmd(struct adapter *padapter, uint action) -{ - struct cmd_obj *ph2c; - struct usb_suspend_parm *psetusbsuspend; - struct cmd_priv *pcmdpriv = padapter-cmdpriv; - - u8 ret = _SUCCESS; - - - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); - if (ph2c == NULL) { - ret = _FAIL; - goto exit; - } - - psetusbsuspend = kzalloc(sizeof(struct usb_suspend_parm), GFP_KERNEL); - if (psetusbsuspend == NULL) { - kfree(ph2c); - ret = _FAIL; - goto exit; - } - - psetusbsuspend-action = action; - - init_h2fwcmd_w_parm_no_rsp(ph2c, psetusbsuspend, GEN_CMD_CODE(_SetUsbSuspend)); - - ret = rtw_enqueue_cmd(pcmdpriv, ph2c); - -exit: - - - return ret; -} - /* rtw_sitesurvey_cmd(~) ### NOTE: () diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index 278208df..77981cd 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -718,7 +718,6 @@ Result: #define H2C_CMD_OVERFLOW 0x06 #define H2C_RESERVED 0x07 -u8 rtw_setstandby_cmd(struct adapter *padapter, uint action); u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, int ssid_num, struct rtw_ieee80211_channel *ch, int ch_num); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/48] staging: rtl8188eu: Remove unused function rtw_createbss_cmd_ex()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c| 28 --- drivers/staging/rtl8188eu/include/rtw_cmd.h |2 -- 2 files changed, 30 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 5fab194..ab3349f 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -499,34 +499,6 @@ exit: return res; } -u8 rtw_createbss_cmd_ex(struct adapter *padapter, unsigned char *pbss, unsigned int sz) -{ - struct cmd_obj *pcmd; - struct cmd_priv *pcmdpriv = padapter-cmdpriv; - u8 res = _SUCCESS; - - - pcmd = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); - if (pcmd == NULL) { - res = _FAIL; - goto exit; - } - - INIT_LIST_HEAD(pcmd-list); - pcmd-cmdcode = GEN_CMD_CODE(_CreateBss); - pcmd-parmbuf = pbss; - pcmd-cmdsz = sz; - pcmd-rsp = NULL; - pcmd-rspsz = 0; - - res = rtw_enqueue_cmd(pcmdpriv, pcmd); - -exit: - - - return res; -} - u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork) { u8 res = _SUCCESS; diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index 77981cd..d356cf4 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -722,8 +722,6 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, int ssid_num, struct rtw_ieee80211_channel *ch, int ch_num); u8 rtw_createbss_cmd(struct adapter *padapter); -u8 rtw_createbss_cmd_ex(struct adapter *padapter, unsigned char *pbss, - unsigned int sz); u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key); u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 16/48] staging: rtl8188eu: Remove unused function rtw_set_ch_cmd()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c| 53 --- drivers/staging/rtl8188eu/include/rtw_cmd.h |2 - 2 files changed, 55 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 51f624d..3762fa6 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -1005,59 +1005,6 @@ exit: return res; } -u8 rtw_set_ch_cmd(struct adapter *padapter, u8 ch, u8 bw, u8 ch_offset, u8 enqueue) -{ - struct cmd_obj *pcmdobj; - struct set_ch_parm *set_ch_parm; - struct cmd_priv *pcmdpriv = padapter-cmdpriv; - - u8 res = _SUCCESS; - - - DBG_88E(FUNC_NDEV_FMT ch:%u, bw:%u, ch_offset:%u\n, - FUNC_NDEV_ARG(padapter-pnetdev), ch, bw, ch_offset); - - /* check input parameter */ - - /* prepare cmd parameter */ - set_ch_parm = kzalloc(sizeof(*set_ch_parm), GFP_KERNEL); - if (set_ch_parm == NULL) { - res = _FAIL; - goto exit; - } - set_ch_parm-ch = ch; - set_ch_parm-bw = bw; - set_ch_parm-ch_offset = ch_offset; - - if (enqueue) { - /* need enqueue, prepare cmd_obj and enqueue */ - pcmdobj = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); - if (pcmdobj == NULL) { - kfree(set_ch_parm); - res = _FAIL; - goto exit; - } - - init_h2fwcmd_w_parm_no_rsp(pcmdobj, set_ch_parm, GEN_CMD_CODE(_SetChannel)); - res = rtw_enqueue_cmd(pcmdpriv, pcmdobj); - } else { - /* no need to enqueue, do the cmd hdl directly and free cmd parameter */ - if (H2C_SUCCESS != set_ch_hdl(padapter, (u8 *)set_ch_parm)) - res = _FAIL; - - kfree(set_ch_parm); - } - - /* do something based on res... */ - -exit: - - DBG_88E(FUNC_NDEV_FMT res:%u\n, FUNC_NDEV_ARG(padapter-pnetdev), res); - - - return res; -} - u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan, u8 enqueue) { struct cmd_obj *pcmdobj; diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index af18c75..6ed4a90 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -755,8 +755,6 @@ u8 rtw_ps_cmd(struct adapter *padapter); u8 rtw_chk_hi_queue_cmd(struct adapter *padapter); #endif -u8 rtw_set_ch_cmd(struct adapter *padapter, u8 ch, u8 bw, u8 ch_offset, - u8 enqueue); u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan, u8 enqueue); u8 rtw_set_csa_cmd(struct adapter *padapter, u8 new_ch_no); u8 rtw_tdls_cmd(struct adapter *padapter, u8 *addr, u8 option); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 17/48] staging: rtl8188eu: Remove unused function rtw_set_csa_cmd()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c| 35 --- drivers/staging/rtl8188eu/include/rtw_cmd.h |1 - 2 files changed, 36 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 3762fa6..7141ab4 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -1059,41 +1059,6 @@ exit: return res; } -u8 rtw_set_csa_cmd(struct adapter *padapter, u8 new_ch_no) -{ - struct cmd_obj *pcmdobj; - struct SetChannelSwitch_param *setChannelSwitch_param; - struct cmd_priv *pcmdpriv = padapter-cmdpriv; - - u8 res = _SUCCESS; - - - RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, (+rtw_set_csa_cmd\n)); - - pcmdobj = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); - if (pcmdobj == NULL) { - res = _FAIL; - goto exit; - } - - setChannelSwitch_param = kzalloc(sizeof(struct SetChannelSwitch_param), GFP_KERNEL); - if (setChannelSwitch_param == NULL) { - kfree(pcmdobj); - res = _FAIL; - goto exit; - } - - setChannelSwitch_param-new_ch_no = new_ch_no; - - init_h2fwcmd_w_parm_no_rsp(pcmdobj, setChannelSwitch_param, GEN_CMD_CODE(_SetChannelSwitch)); - res = rtw_enqueue_cmd(pcmdpriv, pcmdobj); - -exit: - - - return res; -} - u8 rtw_tdls_cmd(struct adapter *padapter, u8 *addr, u8 option) { return _SUCCESS; diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index 6ed4a90..108cf30 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -756,7 +756,6 @@ u8 rtw_chk_hi_queue_cmd(struct adapter *padapter); #endif u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan, u8 enqueue); -u8 rtw_set_csa_cmd(struct adapter *padapter, u8 new_ch_no); u8 rtw_tdls_cmd(struct adapter *padapter, u8 *addr, u8 option); u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 18/48] staging: rtl8188eu: Remove dummy function rtw_tdls_cmd()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c|5 - drivers/staging/rtl8188eu/include/rtw_cmd.h |1 - 2 files changed, 6 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 7141ab4..de62902 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -1059,11 +1059,6 @@ exit: return res; } -u8 rtw_tdls_cmd(struct adapter *padapter, u8 *addr, u8 option) -{ - return _SUCCESS; -} - static void traffic_status_watchdog(struct adapter *padapter) { u8 bEnterPS; diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index 108cf30..fa9d5f7 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -756,7 +756,6 @@ u8 rtw_chk_hi_queue_cmd(struct adapter *padapter); #endif u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan, u8 enqueue); -u8 rtw_tdls_cmd(struct adapter *padapter, u8 *addr, u8 option); u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 19/48] staging: rtl8188eu: Remove unused function rtw_setassocsta_cmd()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c| 44 --- drivers/staging/rtl8188eu/include/rtw_cmd.h |1 - 2 files changed, 45 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index de62902..bf7a81d 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -890,50 +890,6 @@ exit: return res; } -u8 rtw_setassocsta_cmd(struct adapter *padapter, u8 *mac_addr) -{ - struct cmd_priv *pcmdpriv = padapter-cmdpriv; - struct cmd_obj *ph2c; - struct set_assocsta_parm *psetassocsta_para; - struct set_stakey_rsp *psetassocsta_rsp = NULL; - - u8 res = _SUCCESS; - - - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); - if (ph2c == NULL) { - res = _FAIL; - goto exit; - } - - psetassocsta_para = kzalloc(sizeof(struct set_assocsta_parm), GFP_KERNEL); - if (psetassocsta_para == NULL) { - kfree(ph2c); - res = _FAIL; - goto exit; - } - - psetassocsta_rsp = kzalloc(sizeof(struct set_assocsta_rsp), GFP_KERNEL); - if (psetassocsta_rsp == NULL) { - kfree(ph2c); - kfree(psetassocsta_para); - return _FAIL; - } - - init_h2fwcmd_w_parm_no_rsp(ph2c, psetassocsta_para, _SetAssocSta_CMD_); - ph2c-rsp = (u8 *)psetassocsta_rsp; - ph2c-rspsz = sizeof(struct set_assocsta_rsp); - - ether_addr_copy(psetassocsta_para-addr, mac_addr); - - res = rtw_enqueue_cmd(pcmdpriv, ph2c); - -exit: - - - return res; -} - u8 rtw_addbareq_cmd(struct adapter *padapter, u8 tid, u8 *addr) { struct cmd_priv *pcmdpriv = padapter-cmdpriv; diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index fa9d5f7..278208df 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -718,7 +718,6 @@ Result: #define H2C_CMD_OVERFLOW 0x06 #define H2C_RESERVED 0x07 -u8 rtw_setassocsta_cmd(struct adapter *padapter, u8 *mac_addr); u8 rtw_setstandby_cmd(struct adapter *padapter, uint action); u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, int ssid_num, struct rtw_ieee80211_channel *ch, -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 23/48] staging: rtl8188eu: rtw_cmd.h: Remove unused macros
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/include/rtw_cmd.h | 15 --- 1 file changed, 15 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index 1e3161e..0803742 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -24,16 +24,11 @@ #include rtw_rf.h #include rtw_led.h -#define C2H_MEM_SZ (16*1024) - #include osdep_service.h #include ieee80211.h /* ieee80211/ieee80211.h */ -#define FREE_CMDOBJ_SZ 128 - #define MAX_CMDSZ 1024 #define MAX_RSPSZ 512 -#define MAX_EVTSZ 1024 #define CMDBUFF_ALIGN_SZ 512 @@ -707,16 +702,11 @@ Result: */ -#define H2C_RSP_OFFSET 512 - #define H2C_SUCCESS0x00 #define H2C_SUCCESS_RSP0x01 -#define H2C_DUPLICATED 0x02 #define H2C_DROPPED0x03 #define H2C_PARAMETERS_ERROR 0x04 #define H2C_REJECTED 0x05 -#define H2C_CMD_OVERFLOW 0x06 -#define H2C_RESERVED 0x07 u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, int ssid_num, struct rtw_ieee80211_channel *ch, @@ -841,11 +831,6 @@ enum rtw_h2c_cmd { MAX_H2CCMD }; -#define _GetBBReg_CMD_ _Read_BBREG_CMD_ -#define _SetBBReg_CMD_ _Write_BBREG_CMD_ -#define _GetRFReg_CMD_ _Read_RFREG_CMD_ -#define _SetRFReg_CMD_ _Write_RFREG_CMD_ - #ifdef _RTW_CMD_C_ static struct _cmd_callbackrtw_cmd_callback[] = { {GEN_CMD_CODE(_Read_MACREG), NULL}, /*0*/ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 22/48] staging: rtl8188eu: rtw_cmd.h: Remove unused function declaration
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/include/rtw_cmd.h |6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index d356cf4..1e3161e 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -731,11 +731,6 @@ u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infra networktype); u8 rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset); -u8 rtw_setrfintfs_cmd(struct adapter *padapter, u8 mode); - -u8 rtw_gettssi_cmd(struct adapter *padapter, u8 offset, u8 *pval); -u8 rtw_setfwdig_cmd(struct adapter *padapter, u8 type); -u8 rtw_setfwra_cmd(struct adapter *padapter, u8 type); u8 rtw_addbareq_cmd(struct adapter *padapter, u8 tid, u8 *addr); @@ -752,7 +747,6 @@ u8 rtw_chk_hi_queue_cmd(struct adapter *padapter); #endif u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan, u8 enqueue); - u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf); void rtw_survey_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 25/48] staging: rtl8188eu: Remove unused function rtw_cmd_clr_isr()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c|6 -- drivers/staging/rtl8188eu/include/rtw_cmd.h |2 -- 2 files changed, 8 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index ab3349f..651d809 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -205,12 +205,6 @@ struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv) return cmd_obj; } -void rtw_cmd_clr_isr(struct cmd_priv *pcmdpriv) -{ - pcmdpriv-cmd_done_cnt++; - /* up((pcmdpriv-cmd_done_sema)); */ -} - void rtw_free_cmd_obj(struct cmd_obj *pcmd) { diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index b8adc05..bfd7eaf 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -78,8 +78,6 @@ int rtw_cmd_thread(void *context); u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv); void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv); -void rtw_cmd_clr_isr(struct cmd_priv *pcmdpriv); - enum rtw_drvextra_cmd_id { NONE_WK_CID, DYNAMIC_CHK_WK_CID, -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 29/48] staging: rtl8188eu: Remove wrapper function power_saving_wk_hdl()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c |7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 5a1ee87..b9c61e3 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -1191,11 +1191,6 @@ exit: return res; } -static void power_saving_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz) -{ -rtw_ps_processor(padapter); -} - u8 rtw_ps_cmd(struct adapter *padapter) { struct cmd_obj *ppscmd; @@ -1317,7 +1312,7 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf) dynamic_chk_wk_hdl(padapter, pdrvextra_cmd-pbuf, pdrvextra_cmd-type_size); break; case POWER_SAVING_CTRL_WK_CID: - power_saving_wk_hdl(padapter, pdrvextra_cmd-pbuf, pdrvextra_cmd-type_size); + rtw_ps_processor(padapter); break; case LPS_CTRL_WK_CID: lps_ctrl_wk_hdl(padapter, (u8)pdrvextra_cmd-type_size); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 27/48] staging: rtl8188eu: rtw_cmd.h: Remove struct Tx_Beacon_param
struct Tx_Beacon_param has only one member. Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c| 12 ++-- drivers/staging/rtl8188eu/include/rtw_cmd.h |4 drivers/staging/rtl8188eu/include/rtw_mlme_ext.h |2 +- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index 3bd3962..b4dd14e 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -5416,7 +5416,7 @@ u8 add_ba_hdl(struct adapter *padapter, unsigned char *pbuf) u8 set_tx_beacon_cmd(struct adapter *padapter) { struct cmd_obj *ph2c; - struct Tx_Beacon_param *ptxBeacon_parm; + struct wlan_bssid_ex*ptxBeacon_parm; struct cmd_priv *pcmdpriv = (padapter-cmdpriv); struct mlme_ext_priv*pmlmeext = padapter-mlmeextpriv; struct mlme_ext_info*pmlmeinfo = (pmlmeext-mlmext_info); @@ -5430,19 +5430,19 @@ u8 set_tx_beacon_cmd(struct adapter *padapter) goto exit; } - ptxBeacon_parm = kzalloc(sizeof(struct Tx_Beacon_param), GFP_KERNEL); + ptxBeacon_parm = kzalloc(sizeof(struct wlan_bssid_ex), GFP_KERNEL); if (ptxBeacon_parm == NULL) { kfree(ph2c); res = _FAIL; goto exit; } - memcpy((ptxBeacon_parm-network), (pmlmeinfo-network), sizeof(struct wlan_bssid_ex)); + memcpy(ptxBeacon_parm, (pmlmeinfo-network), sizeof(struct wlan_bssid_ex)); - len_diff = update_hidden_ssid(ptxBeacon_parm-network.IEs+_BEACON_IE_OFFSET_, - ptxBeacon_parm-network.IELength-_BEACON_IE_OFFSET_, + len_diff = update_hidden_ssid(ptxBeacon_parm-IEs+_BEACON_IE_OFFSET_, + ptxBeacon_parm-IELength-_BEACON_IE_OFFSET_, pmlmeinfo-hidden_ssid_mode); - ptxBeacon_parm-network.IELength += len_diff; + ptxBeacon_parm-IELength += len_diff; init_h2fwcmd_w_parm_no_rsp(ph2c, ptxBeacon_parm, GEN_CMD_CODE(_TX_Beacon)); diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index 6ff500c..d6b8724 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -353,10 +353,6 @@ struct getphy_parm { }; -struct Tx_Beacon_param { - struct wlan_bssid_ex network; -}; - /* Notes: This command is used for H2C/C2H loopback testing diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h index 1fdd1f8..2a32caa 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h @@ -764,7 +764,7 @@ static struct cmd_hdl wlancmds[] = { GEN_MLME_EXT_HANDLER(0, NULL) GEN_MLME_EXT_HANDLER(0, NULL) GEN_MLME_EXT_HANDLER(0, NULL) - GEN_MLME_EXT_HANDLER(sizeof(struct Tx_Beacon_param), + GEN_MLME_EXT_HANDLER(sizeof(struct wlan_bssid_ex), tx_beacon_hdl) /*55*/ GEN_MLME_EXT_HANDLER(0, mlme_evt_hdl) /*56*/ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 26/48] staging: rtl8188eu: rtw_cmd.h: Remove struct [join, create]bss_parm
These two structures have only one member. Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c| 10 +- drivers/staging/rtl8188eu/include/rtw_cmd.h | 23 -- drivers/staging/rtl8188eu/include/rtw_mlme_ext.h |4 ++-- 3 files changed, 7 insertions(+), 30 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index c4888b1..3bd3962 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -4959,11 +4959,11 @@ u8 createbss_hdl(struct adapter *padapter, u8 *pbuf) struct mlme_ext_priv*pmlmeext = padapter-mlmeextpriv; struct mlme_ext_info*pmlmeinfo = (pmlmeext-mlmext_info); struct wlan_bssid_ex *pnetwork = (struct wlan_bssid_ex *)((pmlmeinfo-network)); - struct joinbss_parm *pparm = (struct joinbss_parm *)pbuf; + struct wlan_bssid_ex *pparm = (struct wlan_bssid_ex *)pbuf; /* u32 initialgain; */ - if (pparm-network.InfrastructureMode == Ndis802_11APMode) { + if (pparm-InfrastructureMode == Ndis802_11APMode) { #ifdef CONFIG_88EU_AP_MODE if (pmlmeinfo-state == WIFI_FW_AP_STATE) { @@ -4974,7 +4974,7 @@ u8 createbss_hdl(struct adapter *padapter, u8 *pbuf) } /* below is for ad-hoc master */ - if (pparm-network.InfrastructureMode == Ndis802_11IBSS) { + if (pparm-InfrastructureMode == Ndis802_11IBSS) { rtw_joinbss_reset(padapter); pmlmeext-cur_bwmode = HT_CHANNEL_WIDTH_20; @@ -5023,7 +5023,7 @@ u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf) struct mlme_ext_priv*pmlmeext = padapter-mlmeextpriv; struct mlme_ext_info*pmlmeinfo = (pmlmeext-mlmext_info); struct wlan_bssid_ex *pnetwork = (struct wlan_bssid_ex *)((pmlmeinfo-network)); - struct joinbss_parm *pparm = (struct joinbss_parm *)pbuf; + struct wlan_bssid_ex *pparm = (struct wlan_bssid_ex *)pbuf; u32 i; /* check already connecting to AP or not */ @@ -5045,7 +5045,7 @@ u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf) rtw_hal_set_hwreg(padapter, HW_VAR_MLME_DISCONNECT, NULL); } - rtw_antenna_select_cmd(padapter, pparm-network.PhyInfo.Optimum_antenna, false); + rtw_antenna_select_cmd(padapter, pparm-PhyInfo.Optimum_antenna, false); rtw_joinbss_reset(padapter); diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index bfd7eaf..6ff500c 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -111,18 +111,6 @@ enum RFINTFS { }; /* -Caller Mode: Infra, Ad-Hoc - -Notes: To join the specified bss - -Command Event Mode - -*/ -struct joinbss_parm { - struct wlan_bssid_ex network; -}; - -/* Caller Mode: Infra, Ad-HoC(C) Notes: To disconnect the current associated BSS @@ -134,17 +122,6 @@ struct disconnect_parm { u32 deauth_timeout_ms; }; -/* -Caller Mode: AP, Ad-HoC(M) - -Notes: To create a BSS - -Command Mode -*/ -struct createbss_parm { - struct wlan_bssid_ex network; -}; - struct setopmode_parm { u8 mode; u8 rsvd[3]; diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h index 17c680f..1fdd1f8 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h @@ -722,9 +722,9 @@ static struct cmd_hdl wlancmds[] = { GEN_MLME_EXT_HANDLER(0, NULL) GEN_MLME_EXT_HANDLER(0, NULL) GEN_MLME_EXT_HANDLER(0, NULL) - GEN_MLME_EXT_HANDLER(sizeof (struct joinbss_parm), join_cmd_hdl) /*14*/ + GEN_MLME_EXT_HANDLER(sizeof (struct wlan_bssid_ex), join_cmd_hdl) /*14*/ GEN_MLME_EXT_HANDLER(sizeof (struct disconnect_parm), disconnect_hdl) - GEN_MLME_EXT_HANDLER(sizeof (struct createbss_parm), createbss_hdl) + GEN_MLME_EXT_HANDLER(sizeof (struct wlan_bssid_ex), createbss_hdl) GEN_MLME_EXT_HANDLER(sizeof (struct setopmode_parm), setopmode_hdl) GEN_MLME_EXT_HANDLER(sizeof (struct sitesurvey_parm), sitesurvey_cmd_hdl) /*18*/ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 28/48] staging: rtl8188eu: Remove header file cmd_osdep.h
cmd_osdep.h is not required. Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c |1 - drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c |1 - drivers/staging/rtl8188eu/include/cmd_osdep.h | 31 - 3 files changed, 33 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/include/cmd_osdep.h diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 651d809..5a1ee87 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -22,7 +22,6 @@ #include osdep_service.h #include drv_types.h #include recv_osdep.h -#include cmd_osdep.h #include mlme_osdep.h #include rtw_mlme_ext.h diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c index 6ad3bd4..023a3d8 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c @@ -22,7 +22,6 @@ #include osdep_service.h #include drv_types.h #include recv_osdep.h -#include cmd_osdep.h #include mlme_osdep.h #include rtw_ioctl_set.h diff --git a/drivers/staging/rtl8188eu/include/cmd_osdep.h b/drivers/staging/rtl8188eu/include/cmd_osdep.h deleted file mode 100644 index 7a93e1d..000 --- a/drivers/staging/rtl8188eu/include/cmd_osdep.h +++ /dev/null @@ -1,31 +0,0 @@ -/** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * - **/ -#ifndef __CMD_OSDEP_H_ -#define __CMD_OSDEP_H_ - -#include osdep_service.h -#include drv_types.h - -extern int _rtw_init_cmd_priv(struct cmd_priv *pcmdpriv); -extern void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv); -extern int _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj); -extern struct cmd_obj *_rtw_dequeue_cmd(struct __queue *queue); - -#endif -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 24/48] staging: rtl8188eu: rtw_cmd.h: Remove unused structures
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/include/rtw_cmd.h | 216 --- 1 file changed, 216 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index 0803742..b8adc05 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -113,27 +113,6 @@ enum RFINTFS { }; /* -Caller Mode: Infra, Ad-HoC(C) - -Notes: To enter USB suspend mode - -Command Mode - -*/ -struct usb_suspend_parm { - u32 action;/* 1: sleep, 0:resume */ -}; - -/* -Caller Mode: Infra, Ad-HoC - -Notes: To join a known BSS. - -Command-Event Mode - -*/ - -/* Caller Mode: Infra, Ad-Hoc Notes: To join the specified bss @@ -321,10 +300,6 @@ struct getbasicrate_parm { u32 rsvd; }; -struct getbasicrate_rsp { - u8 basicrates[NumRates]; -}; - /* Caller Mode: Any @@ -376,11 +351,6 @@ struct getphyinfo_parm { u32 rsvd; }; -struct getphyinfo_rsp { - struct regulatory_class class_sets[NUM_REGULATORYS]; - u8 status; -}; - /* Caller Mode: Any @@ -407,45 +377,6 @@ struct getphy_parm { u32 rsvd; }; -struct getphy_rsp { - u8 rfchannel; - u8 modem; -}; - -struct readBB_parm { - u8 offset; -}; -struct readBB_rsp { - u8 value; -}; - -struct readTSSI_parm { - u8 offset; -}; -struct readTSSI_rsp { - u8 value; -}; - -struct writeBB_parm { - u8 offset; - u8 value; -}; - -struct readRF_parm { - u8 offset; -}; -struct readRF_rsp { - u32 value; -}; - -struct writeRF_parm { - u32 offset; - u32 value; -}; - -struct getrfintfs_parm { - u8 rfintfs; -}; struct Tx_Beacon_param { struct wlan_bssid_ex network; @@ -509,153 +440,6 @@ struct drvextra_cmd_parm { unsigned char *pbuf; }; -/*--- Below are used for RF/BB tunning -*/ - -struct setantenna_parm { - u8 tx_antset; - u8 rx_antset; - u8 tx_antenna; - u8 rx_antenna; -}; - -struct enrateadaptive_parm { - u32 en; -}; - -struct settxagctbl_parm { - u32 txagc[MAX_RATES_LENGTH]; -}; - -struct gettxagctbl_parm { - u32 rsvd; -}; -struct gettxagctbl_rsp { - u32 txagc[MAX_RATES_LENGTH]; -}; - -struct setagcctrl_parm { - u32 agcctrl;/* 0: pure hw, 1: fw */ -}; - -struct setssup_parm{ - u32 ss_ForceUp[MAX_RATES_LENGTH]; -}; - -struct getssup_parm{ - u32 rsvd; -}; - -struct getssup_rsp { - u8 ss_ForceUp[MAX_RATES_LENGTH]; -}; - -struct setssdlevel_parm{ - u8 ss_DLevel[MAX_RATES_LENGTH]; -}; - -struct getssdlevel_parm{ - u32 rsvd; -}; - -struct getssdlevel_rsp { - u8 ss_DLevel[MAX_RATES_LENGTH]; -}; - -struct setssulevel_parm{ - u8 ss_ULevel[MAX_RATES_LENGTH]; -}; - -struct getssulevel_parm{ - u32 rsvd; -}; - -struct getssulevel_rsp { - u8 ss_ULevel[MAX_RATES_LENGTH]; -}; - -struct setcountjudge_parm { - u8 count_judge[MAX_RATES_LENGTH]; -}; - -struct getcountjudge_parm { - u32 rsvd; -}; - -struct getcountjudge_rsp { - u8 count_judge[MAX_RATES_LENGTH]; -}; - -struct getratable_parm { - uint rsvd; -}; - -/* to get TX,RX retry count */ - -struct gettxretrycnt_parm { - unsigned int rsvd; -}; - -struct gettxretrycnt_rsp { - unsigned long tx_retrycnt; -}; - -struct getrxretrycnt_parm { - unsigned int rsvd; -}; - -struct getrxretrycnt_rsp { - unsigned long rx_retrycnt; -}; - -/* to get BCNOK,BCNERR count */ -struct getbcnokcnt_parm { - unsigned int rsvd; -}; - -struct getbcnokcnt_rsp { - unsigned long bcnokcnt; -}; - -struct getbcnerrcnt_parm { - unsigned int rsvd; -}; - -struct getbcnerrcnt_rsp { - unsigned long bcnerrcnt; -}; - -/* to get current TX power level */ -struct getcurtxpwrlevel_parm { - unsigned int rsvd; -}; -struct getcurtxpwrlevel_rspi { - unsigned short tx_power; -}; - -struct setprobereqextraie_parm { - unsigned char e_id; - unsigned char ie_len; - unsigned char ie[0]; -}; - -struct setassocreqextraie_parm { - unsigned char e_id; - unsigned char ie_len; - unsigned char ie[0]; -}; - -struct setproberspextraie_parm { - unsigned char e_id; - unsigned char ie_len; - unsigned char ie[0]; -}; - -struct setassocrspextraie_parm { - unsigned char e_id; - unsigned char ie_len; - unsigned char ie[0]; -}; - struct addBaReq_parm { unsigned int tid; u8 addr[ETH_ALEN]; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 34/48] staging: rtl8188eu: Remove unused member cmd_issued_cnt from struct cmd_priv
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c|3 --- drivers/staging/rtl8188eu/include/rtw_cmd.h |1 - 2 files changed, 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index ef5f507..4696713 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -64,7 +64,6 @@ int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) pcmdpriv-rsp_buf = pcmdpriv-rsp_allocated_buf + 4 - ((size_t)(pcmdpriv-rsp_allocated_buf) 3); - pcmdpriv-cmd_issued_cnt = 0; pcmdpriv-cmd_done_cnt = 0; exit: return res; @@ -246,8 +245,6 @@ _next: goto post_process; } - pcmdpriv-cmd_issued_cnt++; - pcmd-cmdsz = round_up(pcmd-cmdsz, 4); memcpy(pcmdbuf, pcmd-parmbuf, pcmd-cmdsz); diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index 60f953b..b4ee2c8 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -52,7 +52,6 @@ struct cmd_priv { u8 *cmd_allocated_buf; u8 *rsp_buf; /* shall be non-paged, and 4 bytes aligned */ u8 *rsp_allocated_buf; - u32 cmd_issued_cnt; u32 cmd_done_cnt; u8 cmdthd_running; struct adapter *padapter; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 32/48] staging: rtl8188eu: Rename _rtw_dequeue_cmd() to rtw_dequeue_cmd()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c| 16 +++- drivers/staging/rtl8188eu/include/rtw_cmd.h |2 +- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 81f4b94..1e6e52e 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -110,7 +110,7 @@ exit: return _SUCCESS; } -struct cmd_obj *_rtw_dequeue_cmd(struct __queue *queue) +struct cmd_obj * rtw_dequeue_cmd(struct __queue *queue) { unsigned long irqL; struct cmd_obj *obj; @@ -181,16 +181,6 @@ exit: return res; } -struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv) -{ - struct cmd_obj *cmd_obj; - - - cmd_obj = _rtw_dequeue_cmd(pcmdpriv-cmd_queue); - - return cmd_obj; -} - void rtw_free_cmd_obj(struct cmd_obj *pcmd) { @@ -248,7 +238,7 @@ _next: break; } - pcmd = rtw_dequeue_cmd(pcmdpriv); + pcmd = rtw_dequeue_cmd(pcmdpriv-cmd_queue); if (!pcmd) continue; @@ -304,7 +294,7 @@ post_process: /* free all cmd_obj resources */ do { - pcmd = rtw_dequeue_cmd(pcmdpriv); + pcmd = rtw_dequeue_cmd(pcmdpriv-cmd_queue); if (pcmd == NULL) break; diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index cc75c7d..b3529da 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -70,7 +70,7 @@ do {\ } while (0) u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *obj); -struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv); +struct cmd_obj *rtw_dequeue_cmd(struct __queue *queue); void rtw_free_cmd_obj(struct cmd_obj *pcmd); int rtw_cmd_thread(void *context); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 31/48] staging: rtl8188eu: Rename _rtw_free_cmd_priv() to rtw_free_cmd_priv()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c |8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index e26a582..81f4b94 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -71,7 +71,7 @@ exit: return res; } -void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) +void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) { if (pcmdpriv) { @@ -130,12 +130,6 @@ struct cmd_obj *_rtw_dequeue_cmd(struct __queue *queue) return obj; } -void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) -{ - RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, (rtw_free_cmd_priv\n)); - _rtw_free_cmd_priv(pcmdpriv); -} - static int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj) { u8 bAllow = false; /* set to true to allow enqueuing cmd when hw_init_completed is false */ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 33/48] staging: rtl8188eu: Remove unused member rsp_cnt from struct cmd_priv
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c|1 - drivers/staging/rtl8188eu/include/rtw_cmd.h |1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 1e6e52e..ef5f507 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -66,7 +66,6 @@ int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) pcmdpriv-cmd_issued_cnt = 0; pcmdpriv-cmd_done_cnt = 0; - pcmdpriv-rsp_cnt = 0; exit: return res; } diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index b3529da..60f953b 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -54,7 +54,6 @@ struct cmd_priv { u8 *rsp_allocated_buf; u32 cmd_issued_cnt; u32 cmd_done_cnt; - u32 rsp_cnt; u8 cmdthd_running; struct adapter *padapter; }; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 30/48] staging: rtl8188eu: Rename _rtw_init_cmd_priv() to rtw_init_cmd_priv()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c|9 + drivers/staging/rtl8188eu/include/rtw_cmd.h |2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index b9c61e3..e26a582 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -30,7 +30,7 @@ Caller and the rtw_cmd_thread can protect cmd_q by spin_lock. No irqsave is necessary. */ -int _rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) +int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) { int res = _SUCCESS; @@ -130,13 +130,6 @@ struct cmd_obj *_rtw_dequeue_cmd(struct __queue *queue) return obj; } -u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) -{ - u32 res; - res = _rtw_init_cmd_priv(pcmdpriv); - return res; -} - void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) { RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, (rtw_free_cmd_priv\n)); diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index d6b8724..cc75c7d 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -75,7 +75,7 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd); int rtw_cmd_thread(void *context); -u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv); +int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv); void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv); enum rtw_drvextra_cmd_id { -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 35/48] staging: rtl8188eu: Remove unused member cmd_done_cnt from struct cmd_priv
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c|1 - drivers/staging/rtl8188eu/include/rtw_cmd.h |1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 4696713..4c1abdd 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -64,7 +64,6 @@ int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) pcmdpriv-rsp_buf = pcmdpriv-rsp_allocated_buf + 4 - ((size_t)(pcmdpriv-rsp_allocated_buf) 3); - pcmdpriv-cmd_done_cnt = 0; exit: return res; } diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index b4ee2c8..ca69511 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -52,7 +52,6 @@ struct cmd_priv { u8 *cmd_allocated_buf; u8 *rsp_buf; /* shall be non-paged, and 4 bytes aligned */ u8 *rsp_allocated_buf; - u32 cmd_done_cnt; u8 cmdthd_running; struct adapter *padapter; }; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 36/48] staging: rtl8188eu: Remove unused members rsp_[allocated, ]_buf from struct cmd_priv
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c| 10 -- drivers/staging/rtl8188eu/include/rtw_cmd.h |2 -- 2 files changed, 12 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 4c1abdd..199bbae 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -55,15 +55,6 @@ int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) pcmdpriv-cmd_buf = pcmdpriv-cmd_allocated_buf + CMDBUFF_ALIGN_SZ - ((size_t)(pcmdpriv-cmd_allocated_buf) (CMDBUFF_ALIGN_SZ-1)); - pcmdpriv-rsp_allocated_buf = kzalloc(MAX_RSPSZ + 4, GFP_KERNEL); - - if (pcmdpriv-rsp_allocated_buf == NULL) { - res = _FAIL; - goto exit; - } - - pcmdpriv-rsp_buf = pcmdpriv-rsp_allocated_buf + 4 - ((size_t)(pcmdpriv-rsp_allocated_buf) 3); - exit: return res; } @@ -73,7 +64,6 @@ void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) if (pcmdpriv) { kfree(pcmdpriv-cmd_allocated_buf); - kfree(pcmdpriv-rsp_allocated_buf); } } diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index ca69511..d881710 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -50,8 +50,6 @@ struct cmd_priv { u8 cmd_seq; u8 *cmd_buf; /* shall be non-paged, and 4 bytes aligned */ u8 *cmd_allocated_buf; - u8 *rsp_buf; /* shall be non-paged, and 4 bytes aligned */ - u8 *rsp_allocated_buf; u8 cmdthd_running; struct adapter *padapter; }; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 38/48] staging: rtl8188eu: Remove function rtw_getbbrfreg_cmdrsp_callback()
rtw_getbbrfreg_cmdrsp_callback() is a callback for _Read_BBREG and _Read_RFREG commands but these commands are never issued by driver. Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c|8 drivers/staging/rtl8188eu/include/rtw_cmd.h |5 ++--- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 817f459..3e82ba4 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -375,14 +375,6 @@ exit: return res; } -void rtw_getbbrfreg_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *pcmd) -{ - - kfree(pcmd-parmbuf); - kfree(pcmd); - -} - void rtw_readtssi_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *pcmd) { diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index 08b371d..3f3f257 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -491,7 +491,6 @@ void rtw_survey_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd); void rtw_disassoc_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd); void rtw_joinbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd); void rtw_createbss_cmd_callback(struct adapter *adapt, struct cmd_obj *pcmd); -void rtw_getbbrfreg_cmdrsp_callback(struct adapter *adapt, struct cmd_obj *cmd); void rtw_readtssi_cmdrsp_callback(struct adapter *adapt, struct cmd_obj *cmd); void rtw_setstaKey_cmdrsp_callback(struct adapter *adapt, struct cmd_obj *cmd); @@ -583,9 +582,9 @@ enum rtw_h2c_cmd { static struct _cmd_callbackrtw_cmd_callback[] = { {GEN_CMD_CODE(_Read_MACREG), NULL}, /*0*/ {GEN_CMD_CODE(_Write_MACREG), NULL}, - {GEN_CMD_CODE(_Read_BBREG), rtw_getbbrfreg_cmdrsp_callback}, + {GEN_CMD_CODE(_Read_BBREG), NULL}, {GEN_CMD_CODE(_Write_BBREG), NULL}, - {GEN_CMD_CODE(_Read_RFREG), rtw_getbbrfreg_cmdrsp_callback}, + {GEN_CMD_CODE(_Read_RFREG), NULL}, {GEN_CMD_CODE(_Write_RFREG), NULL}, /*5*/ {GEN_CMD_CODE(_Read_EEPROM), NULL}, {GEN_CMD_CODE(_Write_EEPROM), NULL}, -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 37/48] staging: rtl8188eu: Remove members cmd_[allocated, ]_buf from struct cmd_priv
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c| 32 ++- drivers/staging/rtl8188eu/include/rtw_cmd.h |2 -- 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 199bbae..817f459 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -32,39 +32,18 @@ No irqsave is necessary. int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) { - int res = _SUCCESS; - - sema_init((pcmdpriv-cmd_queue_sema), 0); - /* sema_init((pcmdpriv-cmd_done_sema), 0); */ sema_init((pcmdpriv-terminate_cmdthread_sema), 0); - _rtw_init_queue((pcmdpriv-cmd_queue)); - /* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */ - pcmdpriv-cmd_seq = 1; - - pcmdpriv-cmd_allocated_buf = kzalloc(MAX_CMDSZ + CMDBUFF_ALIGN_SZ, GFP_KERNEL); - - if (pcmdpriv-cmd_allocated_buf == NULL) { - res = _FAIL; - goto exit; - } - - pcmdpriv-cmd_buf = pcmdpriv-cmd_allocated_buf + CMDBUFF_ALIGN_SZ - ((size_t)(pcmdpriv-cmd_allocated_buf) (CMDBUFF_ALIGN_SZ-1)); - -exit: - return res; + return _SUCCESS; } void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) { - if (pcmdpriv) { - kfree(pcmdpriv-cmd_allocated_buf); - } } /* @@ -192,7 +171,6 @@ int rtw_cmd_thread(void *context) { u8 ret; struct cmd_obj *pcmd; - u8 *pcmdbuf; u8 (*cmd_hdl)(struct adapter *padapter, u8 *pbuf); void (*pcmd_callback)(struct adapter *dev, struct cmd_obj *pcmd); struct adapter *padapter = (struct adapter *)context; @@ -200,8 +178,6 @@ int rtw_cmd_thread(void *context) allow_signal(SIGTERM); - pcmdbuf = pcmdpriv-cmd_buf; - pcmdpriv-cmdthd_running = true; up(pcmdpriv-terminate_cmdthread_sema); @@ -234,15 +210,11 @@ _next: goto post_process; } - pcmd-cmdsz = round_up(pcmd-cmdsz, 4); - - memcpy(pcmdbuf, pcmd-parmbuf, pcmd-cmdsz); - if (pcmd-cmdcode ARRAY_SIZE(wlancmds)) { cmd_hdl = wlancmds[pcmd-cmdcode].h2cfuns; if (cmd_hdl) { - ret = cmd_hdl(pcmd-padapter, pcmdbuf); + ret = cmd_hdl(pcmd-padapter, pcmd-parmbuf); pcmd-res = ret; } diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index d881710..08b371d 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -48,8 +48,6 @@ struct cmd_priv { struct semaphore terminate_cmdthread_sema; struct __queue cmd_queue; u8 cmd_seq; - u8 *cmd_buf; /* shall be non-paged, and 4 bytes aligned */ - u8 *cmd_allocated_buf; u8 cmdthd_running; struct adapter *padapter; }; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 40/48] staging: rtl8188eu: rtw_[cmd, mlme_ext].h: Remove unused command codes
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/include/rtw_cmd.h | 159 -- drivers/staging/rtl8188eu/include/rtw_mlme_ext.h | 77 ++- 2 files changed, 40 insertions(+), 196 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index 47fdef1..8e8092b 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -501,153 +501,50 @@ struct _cmd_callback { }; enum rtw_h2c_cmd { - GEN_CMD_CODE(_Read_MACREG), /*0*/ - GEN_CMD_CODE(_Write_MACREG), - GEN_CMD_CODE(_Read_BBREG), - GEN_CMD_CODE(_Write_BBREG), - GEN_CMD_CODE(_Read_RFREG), - GEN_CMD_CODE(_Write_RFREG), /*5*/ - GEN_CMD_CODE(_Read_EEPROM), - GEN_CMD_CODE(_Write_EEPROM), - GEN_CMD_CODE(_Read_EFUSE), - GEN_CMD_CODE(_Write_EFUSE), - - GEN_CMD_CODE(_Read_CAM),/*10*/ - GEN_CMD_CODE(_Write_CAM), - GEN_CMD_CODE(_setBCNITV), - GEN_CMD_CODE(_setMBIDCFG), - GEN_CMD_CODE(_JoinBss), /*14*/ - GEN_CMD_CODE(_DisConnect), /*15*/ + GEN_CMD_CODE(_JoinBss), + GEN_CMD_CODE(_DisConnect), GEN_CMD_CODE(_CreateBss), GEN_CMD_CODE(_SetOpMode), - GEN_CMD_CODE(_SiteSurvey), /*18*/ + GEN_CMD_CODE(_SiteSurvey), GEN_CMD_CODE(_SetAuth), - - GEN_CMD_CODE(_SetKey), /*20*/ + GEN_CMD_CODE(_SetKey), GEN_CMD_CODE(_SetStaKey), GEN_CMD_CODE(_SetAssocSta), - GEN_CMD_CODE(_DelAssocSta), - GEN_CMD_CODE(_SetStaPwrState), - GEN_CMD_CODE(_SetBasicRate), /*25*/ - GEN_CMD_CODE(_GetBasicRate), - GEN_CMD_CODE(_SetDataRate), - GEN_CMD_CODE(_GetDataRate), - GEN_CMD_CODE(_SetPhyInfo), - - GEN_CMD_CODE(_GetPhyInfo), /*30*/ - GEN_CMD_CODE(_SetPhy), - GEN_CMD_CODE(_GetPhy), - GEN_CMD_CODE(_readRssi), - GEN_CMD_CODE(_readGain), - GEN_CMD_CODE(_SetAtim), /*35*/ - GEN_CMD_CODE(_SetPwrMode), - GEN_CMD_CODE(_JoinbssRpt), - GEN_CMD_CODE(_SetRaTable), - GEN_CMD_CODE(_GetRaTable), - - GEN_CMD_CODE(_GetCCXReport), /*40*/ - GEN_CMD_CODE(_GetDTMReport), - GEN_CMD_CODE(_GetTXRateStatistics), - GEN_CMD_CODE(_SetUsbSuspend), - GEN_CMD_CODE(_SetH2cLbk), - GEN_CMD_CODE(_AddBAReq), /*45*/ - GEN_CMD_CODE(_SetChannel), /*46*/ - GEN_CMD_CODE(_SetTxPower), - GEN_CMD_CODE(_SwitchAntenna), - GEN_CMD_CODE(_SetCrystalCap), - GEN_CMD_CODE(_SetSingleCarrierTx), /*50*/ - - GEN_CMD_CODE(_SetSingleToneTx),/*51*/ - GEN_CMD_CODE(_SetCarrierSuppressionTx), - GEN_CMD_CODE(_SetContinuousTx), - GEN_CMD_CODE(_SwitchBandwidth), /*54*/ - GEN_CMD_CODE(_TX_Beacon), /*55*/ - - GEN_CMD_CODE(_Set_MLME_EVT), /*56*/ - GEN_CMD_CODE(_Set_Drv_Extra), /*57*/ - GEN_CMD_CODE(_Set_H2C_MSG), /*58*/ - - GEN_CMD_CODE(_SetChannelPlan), /*59*/ - GEN_CMD_CODE(_LedBlink), /*60*/ - - GEN_CMD_CODE(_SetChannelSwitch), /*61*/ - GEN_CMD_CODE(_TDLS), /*62*/ + GEN_CMD_CODE(_AddBAReq), + GEN_CMD_CODE(_SetChannel), + GEN_CMD_CODE(_TX_Beacon), + GEN_CMD_CODE(_Set_MLME_EVT), + GEN_CMD_CODE(_Set_Drv_Extra), + GEN_CMD_CODE(_Set_H2C_MSG), + GEN_CMD_CODE(_SetChannelPlan), + GEN_CMD_CODE(_LedBlink), + GEN_CMD_CODE(_SetChannelSwitch), + GEN_CMD_CODE(_TDLS), MAX_H2CCMD }; #ifdef _RTW_CMD_C_ static struct _cmd_callbackrtw_cmd_callback[] = { - {GEN_CMD_CODE(_Read_MACREG), NULL}, /*0*/ - {GEN_CMD_CODE(_Write_MACREG), NULL}, - {GEN_CMD_CODE(_Read_BBREG), NULL}, - {GEN_CMD_CODE(_Write_BBREG), NULL}, - {GEN_CMD_CODE(_Read_RFREG), NULL}, - {GEN_CMD_CODE(_Write_RFREG), NULL}, /*5*/ - {GEN_CMD_CODE(_Read_EEPROM), NULL}, - {GEN_CMD_CODE(_Write_EEPROM), NULL}, - {GEN_CMD_CODE(_Read_EFUSE), NULL}, - {GEN_CMD_CODE(_Write_EFUSE), NULL}, - - {GEN_CMD_CODE(_Read_CAM), NULL}, /*10*/ - {GEN_CMD_CODE(_Write_CAM), NULL}, - {GEN_CMD_CODE(_setBCNITV), NULL}, - {GEN_CMD_CODE(_setMBIDCFG), NULL}, - {GEN_CMD_CODE(_JoinBss), rtw_joinbss_cmd_callback}, /*14*/ - {GEN_CMD_CODE(_DisConnect), rtw_disassoc_cmd_callback}, /*15*/ + {GEN_CMD_CODE(_JoinBss), rtw_joinbss_cmd_callback}, + {GEN_CMD_CODE(_DisConnect), rtw_disassoc_cmd_callback}, {GEN_CMD_CODE(_CreateBss), rtw_createbss_cmd_callback}, {GEN_CMD_CODE(_SetOpMode), NULL}, - {GEN_CMD_CODE(_SiteSurvey), rtw_survey_cmd_callback}, /*18*/ + {GEN_CMD_CODE(_SiteSurvey), rtw_survey_cmd_callback}, {GEN_CMD_CODE(_SetAuth), NULL}, - - {GEN_CMD_CODE(_SetKey), NULL}, /*20*/ + {GEN_CMD_CODE(_SetKey), NULL}, {GEN_CMD_CODE(_SetStaKey), rtw_setstaKey_cmdrsp_callback}, {GEN_CMD_CODE(_SetAssocSta),
[PATCH 42/48] staging: rtl8188eu: Remove command _TDLS and its handler
_TDLS command is never issued by driver and its handler is a dummy function. Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c| 18 -- drivers/staging/rtl8188eu/include/rtw_cmd.h |2 -- drivers/staging/rtl8188eu/include/rtw_mlme_ext.h |1 - 3 files changed, 21 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index b4dd14e..54816f7 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -5605,21 +5605,3 @@ u8 set_csa_hdl(struct adapter *padapter, unsigned char *pbuf) { return H2C_REJECTED; } - -/* TDLS_WRCR : write RCR DATA BIT */ -/* TDLS_SD_PTI: issue peer traffic indication */ -/* TDLS_CS_OFF: go back to the channel linked with AP, terminating channel switch procedure */ -/* TDLS_INIT_CH_SEN : init channel sensing, receive all data and mgnt frame */ -/* TDLS_DONE_CH_SEN: channel sensing and report candidate channel */ -/* TDLS_OFF_CH: first time set channel to off channel */ -/* TDLS_BASE_CH : go back tp the channel linked with AP when set base channel as target channel */ -/* TDLS_P_OFF_CH : periodically go to off channel */ -/* TDLS_P_BASE_CH : periodically go back to base channel */ -/* TDLS_RS_RCR: restore RCR */ -/* TDLS_CKALV_PH1 : check alive timer phase1 */ -/* TDLS_CKALV_PH2 : check alive timer phase2 */ -/* TDLS_FREE_STA : free tdls sta */ -u8 tdls_hdl(struct adapter *padapter, unsigned char *pbuf) -{ - return H2C_REJECTED; -} diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index 8b0712f..1d2fc5f 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -417,7 +417,6 @@ enum rtw_h2c_cmd { GEN_CMD_CODE(_SetChannelPlan), GEN_CMD_CODE(_LedBlink), GEN_CMD_CODE(_SetChannelSwitch), - GEN_CMD_CODE(_TDLS), MAX_H2CCMD }; @@ -442,7 +441,6 @@ static struct _cmd_callback rtw_cmd_callback[] = { {GEN_CMD_CODE(_SetChannelPlan), NULL}, {GEN_CMD_CODE(_LedBlink), NULL}, {GEN_CMD_CODE(_SetChannelSwitch), NULL}, - {GEN_CMD_CODE(_TDLS), NULL}, }; #endif diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h index 484e874..43ed433 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h @@ -726,7 +726,6 @@ static struct cmd_hdl wlancmds[] = { GEN_MLME_EXT_HANDLER(sizeof(struct SetChannelPlan_param), set_chplan_hdl) GEN_MLME_EXT_HANDLER(sizeof(struct LedBlink_param), led_blink_hdl) GEN_MLME_EXT_HANDLER(sizeof(struct SetChannelSwitch_param), set_csa_hdl) - GEN_MLME_EXT_HANDLER(sizeof(struct TDLSoption_param), tdls_hdl) }; #endif -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 39/48] staging: rtl8188eu: Remove function rtw_setdatarate_cmd()
rtw_setdatarate_cmd() enqueue _SetDataRate command but there is not handler mapped in wlancmds[] to handle this command. Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 31 drivers/staging/rtl8188eu/include/rtw_cmd.h|2 -- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c |7 -- 3 files changed, 40 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 3e82ba4..be50d84 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -344,37 +344,6 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, return res; } -u8 rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset) -{ - struct cmd_obj *ph2c; - struct setdatarate_parm *pbsetdataratepara; - struct cmd_priv *pcmdpriv = padapter-cmdpriv; - u8 res = _SUCCESS; - - - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); - if (ph2c == NULL) { - res = _FAIL; - goto exit; - } - - pbsetdataratepara = kzalloc(sizeof(struct setdatarate_parm), GFP_KERNEL); - if (pbsetdataratepara == NULL) { - kfree(ph2c); - res = _FAIL; - goto exit; - } - - init_h2fwcmd_w_parm_no_rsp(ph2c, pbsetdataratepara, GEN_CMD_CODE(_SetDataRate)); - pbsetdataratepara-mac_id = 5; - memcpy(pbsetdataratepara-datarates, rateset, NumRates); - res = rtw_enqueue_cmd(pcmdpriv, ph2c); -exit: - - - return res; -} - void rtw_readtssi_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *pcmd) { diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index 3f3f257..47fdef1 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -468,8 +468,6 @@ u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueue); u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infra networktype); -u8 rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset); - u8 rtw_addbareq_cmd(struct adapter *padapter, u8 tid, u8 *addr); u8 rtw_dynamic_chk_wk_cmd(struct adapter *adapter); diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index 1f46ade..d9cee8c 100644 --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c @@ -1417,7 +1417,6 @@ static int rtw_wx_set_rate(struct net_device *dev, union iwreq_data *wrqu, char *extra) { int i, ret = 0; - struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); u8 datarates[NumRates]; u32 target_rate = wrqu-bitrate.value; u32 fixed = wrqu-bitrate.fixed; @@ -1490,12 +1489,6 @@ set_rate: RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, (datarate_inx =%d\n, datarates[i])); } - if (rtw_setdatarate_cmd(padapter, datarates) != _SUCCESS) { - RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, (rtw_wx_set_rate Fail!!!\n)); - ret = -1; - } - - return ret; } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 44/48] staging: rtl8188eu: Remove command _LedBlink and its handler
_LedBlink command is never issued by driver and its handler is a dummy function. Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c|7 --- drivers/staging/rtl8188eu/include/rtw_cmd.h |2 -- drivers/staging/rtl8188eu/include/rtw_mlme_ext.h |1 - 3 files changed, 10 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index 662096d..e774a6f 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -5593,10 +5593,3 @@ u8 set_chplan_hdl(struct adapter *padapter, unsigned char *pbuf) return H2C_SUCCESS; } - -u8 led_blink_hdl(struct adapter *padapter, unsigned char *pbuf) -{ - if (!pbuf) - return H2C_PARAMETERS_ERROR; - return H2C_SUCCESS; -} diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index 088db15..f5e2c45 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -415,7 +415,6 @@ enum rtw_h2c_cmd { GEN_CMD_CODE(_Set_Drv_Extra), GEN_CMD_CODE(_Set_H2C_MSG), GEN_CMD_CODE(_SetChannelPlan), - GEN_CMD_CODE(_LedBlink), MAX_H2CCMD }; @@ -438,7 +437,6 @@ static struct _cmd_callback rtw_cmd_callback[] = { {GEN_CMD_CODE(_Set_Drv_Extra), NULL}, {GEN_CMD_CODE(_Set_H2C_MSG), NULL}, {GEN_CMD_CODE(_SetChannelPlan), NULL}, - {GEN_CMD_CODE(_LedBlink), NULL}, }; #endif diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h index d5c02f2..7fa1c05 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h @@ -724,7 +724,6 @@ static struct cmd_hdl wlancmds[] = { GEN_MLME_EXT_HANDLER(0, rtw_drvextra_cmd_hdl) GEN_MLME_EXT_HANDLER(0, h2c_msg_hdl) GEN_MLME_EXT_HANDLER(sizeof(struct SetChannelPlan_param), set_chplan_hdl) - GEN_MLME_EXT_HANDLER(sizeof(struct LedBlink_param), led_blink_hdl) }; #endif -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 45/48] staging: rtl8188eu: Remove command _Set_H2C_MSG and its handler
_Set_H2C_MSG command is never issued by driver and its handler is a dummy function. Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c|8 drivers/staging/rtl8188eu/include/rtw_cmd.h |2 -- drivers/staging/rtl8188eu/include/rtw_mlme_ext.h |1 - 3 files changed, 11 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index e774a6f..41cfd30 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -5493,14 +5493,6 @@ _abort_event_: return H2C_SUCCESS; } -u8 h2c_msg_hdl(struct adapter *padapter, unsigned char *pbuf) -{ - if (!pbuf) - return H2C_PARAMETERS_ERROR; - - return H2C_SUCCESS; -} - u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf) { if (send_beacon(padapter) == _FAIL) { diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index f5e2c45..7dfbd8b 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -413,7 +413,6 @@ enum rtw_h2c_cmd { GEN_CMD_CODE(_TX_Beacon), GEN_CMD_CODE(_Set_MLME_EVT), GEN_CMD_CODE(_Set_Drv_Extra), - GEN_CMD_CODE(_Set_H2C_MSG), GEN_CMD_CODE(_SetChannelPlan), MAX_H2CCMD @@ -435,7 +434,6 @@ static struct _cmd_callback rtw_cmd_callback[] = { {GEN_CMD_CODE(_TX_Beacon), NULL}, {GEN_CMD_CODE(_Set_MLME_EVT), NULL}, {GEN_CMD_CODE(_Set_Drv_Extra), NULL}, - {GEN_CMD_CODE(_Set_H2C_MSG), NULL}, {GEN_CMD_CODE(_SetChannelPlan), NULL}, }; #endif diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h index 7fa1c05..654bd36 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h @@ -722,7 +722,6 @@ static struct cmd_hdl wlancmds[] = { GEN_MLME_EXT_HANDLER(sizeof(struct wlan_bssid_ex), tx_beacon_hdl) GEN_MLME_EXT_HANDLER(0, mlme_evt_hdl) GEN_MLME_EXT_HANDLER(0, rtw_drvextra_cmd_hdl) - GEN_MLME_EXT_HANDLER(0, h2c_msg_hdl) GEN_MLME_EXT_HANDLER(sizeof(struct SetChannelPlan_param), set_chplan_hdl) }; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 48/48] staging: rtl8188eu: Remove dummy function rtw_free_cmd_priv()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c|5 - drivers/staging/rtl8188eu/include/rtw_cmd.h |1 - drivers/staging/rtl8188eu/os_dep/os_intfs.c |2 -- 3 files changed, 8 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 0841de2..dd9ed74 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -39,11 +39,6 @@ int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) return _SUCCESS; } -void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) -{ - -} - /* Calling Context: diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index e59d6d4..9e9f5f4 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -68,7 +68,6 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd); int rtw_cmd_thread(void *context); int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv); -void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv); enum rtw_drvextra_cmd_id { NONE_WK_CID, diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c index f331aae..b0c38a4 100644 --- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c +++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c @@ -932,8 +932,6 @@ u8 rtw_free_drv_sw(struct adapter *padapter) free_mlme_ext_priv(padapter-mlmeextpriv); - rtw_free_cmd_priv(padapter-cmdpriv); - rtw_free_mlme_priv(padapter-mlmepriv); _rtw_free_xmit_priv(padapter-xmitpriv); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/48] staging: rtl8188eu: Remove unused function rtw_getrttbl_cmd()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c| 34 --- drivers/staging/rtl8188eu/include/rtw_cmd.h |8 --- 2 files changed, 42 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index a2b355c..294c9e2 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -1122,40 +1122,6 @@ exit: return res; } -u8 rtw_getrttbl_cmd(struct adapter *padapter, struct getratable_rsp *pval) -{ - struct cmd_obj *ph2c; - struct getratable_parm *pgetrttblparm; - struct cmd_priv *pcmdpriv = padapter-cmdpriv; - u8 res = _SUCCESS; - - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); - if (ph2c == NULL) { - res = _FAIL; - goto exit; - } - pgetrttblparm = kzalloc(sizeof(struct getratable_parm), GFP_KERNEL); - - if (pgetrttblparm == NULL) { - kfree(ph2c); - res = _FAIL; - goto exit; - } - - INIT_LIST_HEAD(ph2c-list); - ph2c-cmdcode = GEN_CMD_CODE(_GetRaTable); - ph2c-parmbuf = (unsigned char *)pgetrttblparm; - ph2c-cmdsz = sizeof(struct getratable_parm); - ph2c-rsp = (u8 *)pval; - ph2c-rspsz = sizeof(struct getratable_rsp); - - pgetrttblparm-rsvd = 0x0; - - res = rtw_enqueue_cmd(pcmdpriv, ph2c); -exit: - return res; -} - u8 rtw_setassocsta_cmd(struct adapter *padapter, u8 *mac_addr) { struct cmd_priv *pcmdpriv = padapter-cmdpriv; diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index 049e112..bb1f8f0 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -601,13 +601,6 @@ struct getratable_parm { uint rsvd; }; -struct getratable_rsp { - u8 ss_ForceUp[NumRates]; - u8 ss_ULevel[NumRates]; - u8 ss_DLevel[NumRates]; - u8 count_judge[NumRates]; -}; - /* to get TX,RX retry count */ struct gettxretrycnt_parm { @@ -758,7 +751,6 @@ u8 rtw_getrfreg_cmd(struct adapter *padapter, u8 offset, u8 *pval); u8 rtw_setrfintfs_cmd(struct adapter *padapter, u8 mode); u8 rtw_setrttbl_cmd(struct adapter *padapter, struct setratable_parm *prate_table); -u8 rtw_getrttbl_cmd(struct adapter *padapter, struct getratable_rsp *pval); u8 rtw_gettssi_cmd(struct adapter *padapter, u8 offset, u8 *pval); u8 rtw_setfwdig_cmd(struct adapter *padapter, u8 type); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/48] staging: rtl8188eu: rtw_cmd.h: Remove unused macro and structure
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/include/rtw_cmd.h |9 - 1 file changed, 9 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index 7a70f02..049e112 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -74,15 +74,6 @@ do {\ pcmd-rspsz = 0;\ } while (0) -struct c2h_evt_hdr { - u8 id:4; - u8 plen:4; - u8 seq; - u8 payload[0]; -}; - -#define c2h_evt_exist(c2h_evt) ((c2h_evt)-id || (c2h_evt)-plen) - u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *obj); struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv); void rtw_free_cmd_obj(struct cmd_obj *pcmd); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/48] staging: rtl8188eu: Remove dummy function rtw_hal_c2h_handler()
Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/hal/hal_intf.c |9 - drivers/staging/rtl8188eu/include/hal_intf.h |4 2 files changed, 13 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/hal_intf.c b/drivers/staging/rtl8188eu/hal/hal_intf.c index f002c43..279dd0b 100644 --- a/drivers/staging/rtl8188eu/hal/hal_intf.c +++ b/drivers/staging/rtl8188eu/hal/hal_intf.c @@ -376,15 +376,6 @@ void rtw_hal_reset_security_engine(struct adapter *adapter) adapter-HalFunc.hal_reset_security_engine(adapter); } -s32 rtw_hal_c2h_handler(struct adapter *adapter, struct c2h_evt_hdr *c2h_evt) -{ - s32 ret = _FAIL; - - if (adapter-HalFunc.c2h_handler) - ret = adapter-HalFunc.c2h_handler(adapter, c2h_evt); - return ret; -} - c2h_id_filter rtw_hal_c2h_id_filter_ccx(struct adapter *adapter) { return adapter-HalFunc.c2h_id_filter_ccx; diff --git a/drivers/staging/rtl8188eu/include/hal_intf.h b/drivers/staging/rtl8188eu/include/hal_intf.h index fb797c7..f7ce9de 100644 --- a/drivers/staging/rtl8188eu/include/hal_intf.h +++ b/drivers/staging/rtl8188eu/include/hal_intf.h @@ -236,8 +236,6 @@ struct hal_ops { void (*hal_notch_filter)(struct adapter *adapter, bool enable); void (*hal_reset_security_engine)(struct adapter *adapter); - s32 (*c2h_handler)(struct adapter *padapter, - struct c2h_evt_hdr *c2h_evt); c2h_id_filter c2h_id_filter_ccx; }; @@ -342,8 +340,6 @@ int rtw_hal_iol_cmd(struct adapter *adapter, struct xmit_frame *xmit_frame, void rtw_hal_notch_filter(struct adapter *adapter, bool enable); void rtw_hal_reset_security_engine(struct adapter *adapter); -s32 rtw_hal_c2h_handler(struct adapter *adapter, - struct c2h_evt_hdr *c2h_evt); c2h_id_filter rtw_hal_c2h_id_filter_ccx(struct adapter *adapter); void indicate_wx_scan_complete_event(struct adapter *padapter); u8 rtw_do_join(struct adapter *padapter); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 47/48] staging: rtl8188eu: Remove cmd_seq from struct cmd_priv
Value stored in cmd_seq isn't used by driver. Signed-off-by: navin patidar navin.pati...@gmail.com --- drivers/staging/rtl8188eu/core/rtw_cmd.c|4 drivers/staging/rtl8188eu/include/rtw_cmd.h |1 - 2 files changed, 5 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index be50d84..0841de2 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -36,8 +36,6 @@ int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) sema_init((pcmdpriv-terminate_cmdthread_sema), 0); _rtw_init_queue((pcmdpriv-cmd_queue)); - - pcmdpriv-cmd_seq = 1; return _SUCCESS; } @@ -217,8 +215,6 @@ _next: ret = cmd_hdl(pcmd-padapter, pcmd-parmbuf); pcmd-res = ret; } - - pcmdpriv-cmd_seq++; } else { pcmd-res = H2C_PARAMETERS_ERROR; } diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h index bad84b2..e59d6d4 100644 --- a/drivers/staging/rtl8188eu/include/rtw_cmd.h +++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h @@ -47,7 +47,6 @@ struct cmd_priv { struct semaphore cmd_queue_sema; struct semaphore terminate_cmdthread_sema; struct __queue cmd_queue; - u8 cmd_seq; u8 cmdthd_running; struct adapter *padapter; }; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: rtl8192e: Fix potential NULL pointer dereference
Hello Greg, On Wed, Jul 02, 2014 at 09:33:34AM -0700, Greg Kroah-Hartman wrote: On Wed, Jul 02, 2014 at 11:25:51AM +0200, Emil Goode wrote: We need to make sure the struct rtllib_device pointer ieee is not NULL after the goto rx_dropped label since it is dereferenced there. Signed-off-by: Emil Goode emilgo...@gmail.com --- drivers/staging/rtl8192e/rtllib_rx.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 60de54c..7db3e74 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1496,7 +1496,8 @@ int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb, return ret; rx_dropped: - ieee-stats.rx_dropped++; + if (ieee) + ieee-stats.rx_dropped++; return 0; } EXPORT_SYMBOL(rtllib_rx); Is this something that is hitting users today in the tree, or is this just a bug you found looking at the code? It's a static checker fix and I'm not aware of any impact on users. If you want I will resend with that information added? Best regards, Emil Goode ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: rtl8192e: Fix potential NULL pointer dereference
On Wed, Jul 02, 2014 at 07:26:20PM +0200, Emil Goode wrote: Hello Greg, On Wed, Jul 02, 2014 at 09:33:34AM -0700, Greg Kroah-Hartman wrote: On Wed, Jul 02, 2014 at 11:25:51AM +0200, Emil Goode wrote: We need to make sure the struct rtllib_device pointer ieee is not NULL after the goto rx_dropped label since it is dereferenced there. Signed-off-by: Emil Goode emilgo...@gmail.com --- drivers/staging/rtl8192e/rtllib_rx.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 60de54c..7db3e74 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1496,7 +1496,8 @@ int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb, return ret; rx_dropped: - ieee-stats.rx_dropped++; + if (ieee) + ieee-stats.rx_dropped++; return 0; } EXPORT_SYMBOL(rtllib_rx); Is this something that is hitting users today in the tree, or is this just a bug you found looking at the code? It's a static checker fix and I'm not aware of any impact on users. If you want I will resend with that information added? No, that's fine, just trying to see which kernel to apply this to... thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 5/5] staging: rtl8188eu: Remove P2P support
On Wed, Jul 2, 2014 at 10:18 PM, Arend van Spriel ar...@broadcom.com wrote: On 01-07-14 19:05, navin patidar wrote: Signed-off-by: navin patidar navin.pati...@gmail.com There is probably a reason for removing this. Care to share? I explained the reason for removing P2P support in cover letter, will add that in v2 of this patch. Driver is providing a non-standard wext private ioctl interface to userspace to use P2P functionality. In some source files I noticed CONFIG_88EU_P2P so I sort of expected Kconfig in the list of files below. thanks for pointing that out, v2 of this patch will remove CONFIG_88EU_P2P entry from Kconfig. thanks, navin patidar ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Dear Sir/Madam
It may surprise you receiving this letter from me, since there was no previous correspondence between us. Let me start by introducing myself to you. I am Mr. Paco Cortez, a senior staff working with the bank Cajasol in Spain. I have a business proposal for you; I discovered a fund (€9,500,000.00 Euros) left in the account belongs to one of our Japanese foreign customer by name: Mr. Ken Huang, who died along With His known family in a plane crash in the year October 20, 2006. I need your assistance in transferring this fund into your bank account within 8 to 10 banking days. Before the account will be declared unserviceable, and I agree that 50% of this money will be for you in respect of the provision of your account, and 50% would be for me I am contacting you independently for this deal outside my bank notice where I work, and I advice we keep it personal. I want you to come and apply for the claim of this fund of €9,500,000.00 in our bank as the deceased inheritor. I contacted you because I can present you to the bank as the beneficiary to the inheritance since there is no written will. I will give you more information upon your response to me. All papers will be processed in your acceptance to this offer, and if this business proposal is suitable to your ethnics and you accept to work with me, do furnish me with your details, Your Full Name, Your Private Telephone, Your Country, Occupation and Your Age and Sex. To enable me file necessary documents at our high court probate division for the release of this sum of money in our favor. Please send your reply to my private Email: sr.pacocor...@gmail.com Thanks and I am waiting reply. Best regards, Sr. Paco Cortez Email: sr.pacocor...@gmail.com ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/6] lib / string_helpers: clean up test suite
On Wed, 2 Jul 2014 16:20:24 +0300 Andy Shevchenko andriy.shevche...@linux.intel.com wrote: This patch prepares test suite for a following update. It introduces test_string_check_buf() helper which checks the result and dumps an error. ... --- a/lib/test-string_helpers.c +++ b/lib/test-string_helpers.c @@ -10,6 +10,26 @@ #include linux/string.h #include linux/string_helpers.h +static __init bool test_string_check_buf(const char *name, unsigned int flags, + char *in, size_t p, + char *out_real, size_t q_real, + char *out_test, size_t q_test) +{ + if (q_real == q_test !memcmp(out_test, out_real, q_test)) + return true; + + pr_err(Test '%s' failed: flags = %u\n, name, flags); + + print_hex_dump(KERN_WARNING, Input: , DUMP_PREFIX_NONE, 16, 1, +in, p, true); + print_hex_dump(KERN_WARNING, Expected: , DUMP_PREFIX_NONE, 16, 1, +out_test, q_test, true); + print_hex_dump(KERN_WARNING, Got: , DUMP_PREFIX_NONE, 16, 1, +out_real, q_real, true); Seems strange to mix KERN_ERR and KERN_WARNING. The code's always been that way, but maybe it can be improved. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/6] lib / string_helpers: introduce string_escape_mem()
On Wed, 2 Jul 2014 16:20:25 +0300 Andy Shevchenko andriy.shevche...@linux.intel.com wrote: This is almost the opposite function to string_unescape(). Nevertheless it handles \0 and could be used for any byte buffer. The documentation is supplied together with the function prototype. The test cases covers most of the scenarios and would be expanded later on. ... --- a/include/linux/string_helpers.h +++ b/include/linux/string_helpers.h @@ -71,4 +71,87 @@ static inline int string_unescape_any_inplace(char *buf) return string_unescape_any(buf, buf, 0); } +#define ESCAPE_SPACE 0x01 +#define ESCAPE_SPECIAL 0x02 +#define ESCAPE_NULL 0x04 +#define ESCAPE_OCTAL 0x08 +#define ESCAPE_ANY \ + (ESCAPE_SPACE | ESCAPE_OCTAL | ESCAPE_SPECIAL | ESCAPE_NULL) +#define ESCAPE_NP0x10 +#define ESCAPE_ANY_NP(ESCAPE_ANY | ESCAPE_NP) +#define ESCAPE_HEX 0x20 + +/** + * string_escape_mem - quote characters in the given memory buffer It drive me nuts when the kerneldoc is in the .h file. Who thinks of looking there? I realise that string_unescape() already did that, but I'd prefer that we fix string_unescape() rather than imitate it. --- a/lib/string_helpers.c +++ b/lib/string_helpers.c This is a lot of code! Adds nearly a kbyte. I'm surprised that escaping a string is so verbose. I wonder if the implementation really needs to be so comprehensive? Would a table-driven approach be more compact? static int __init test_string_helpers_init(void) { unsigned int i; @@ -112,6 +315,16 @@ static int __init test_string_helpers_init(void) test_string_unescape(unescape inplace, get_random_int() % (UNESCAPE_ANY + 1), true); + /* Without dictionary */ + for (i = 0; i (ESCAPE_ANY_NP | ESCAPE_HEX) + 1; i++) + test_string_escape(escape 0, escape0, i, TEST_STRING_2_DICT_0); + + /* With dictionary */ + for (i = 0; i (ESCAPE_ANY_NP | ESCAPE_HEX) + 1; i++) + test_string_escape(escape 1, escape1, i, TEST_STRING_2_DICT_1); + + test_string_escape_nomem(); + return -EINVAL; } I wonder why this returns -EINVAL. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Q] Removed cxt1e1 module in staging branch
Hi, Kristina, Thanks for reply. I hadn't developed for specific driver(I'm beginner to develop Linux Kernel :-) ), so I can make patches for other drivers. I just wanted to know what I have to do for revert your change. Thanks. regards, Daeseok Youn. 2014-07-03 1:25 GMT+09:00 Kristina Martšenko kristina.martse...@gmail.com: On 02/07/14 12:41, DaeSeok Youn wrote: Hi, all. I saw your change which removes cxt1e1 in staging tree. Actually, I have been cleaning up coding style and fixing minor issues without real cxt1e1 hardware. And I am not cleaning up all of files in cxt1e1 but some files already done and have plans for other files. may be.. I cannot fix major issues because I don't have a real device but minor issues can be fixed and coding style also. If you want to fix majors' which can be with real device, stay removed. But if it can be reverted for fixing minor issues including coding style, please revert. I cannot focus all of my time on making patches, but I can make patches steadily for that module. Hi DaeSeok, Thanks for the patches, but there needs to be progress made towards moving the driver out of staging. There's not much point in fixing coding style and other smaller issues if larger issues remain unfixed and the driver eventually gets deleted anyway. I don't really know what needs to be done to get it moved out at all, since the driver never had a TODO file and the original thread [1] doesn't say much, so I don't know if it requires the hardware or not, but I suspect it does. Maybe you could work on another driver? Sorry, Kristina [1] http://marc.info/?t=12565885401r=1w=4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Q] Removed cxt1e1 module in staging branch
On Thu, Jul 03, 2014 at 08:32:05AM +0900, DaeSeok Youn wrote: Hi, Kristina, Thanks for reply. I hadn't developed for specific driver(I'm beginner to develop Linux Kernel :-) ), so I can make patches for other drivers. I'd recommend picking another driver, hopefully one you can find the hardware for so you can test changes easier. Best of luck, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: XVME 6300 with TSI148 bridge on 64 bit Debian (Linux 3.2.57) vme_user issue
Hi Martyn, Thanks a lot for your guidance. I am back working on vme and I am trying it with a newer kernel, and I seem to have gone backwards! I upgraded to linux kernel 3.14.9 (on Fedora). Re-compiled the kernel with the vme support etc. I now get the below in my log, and don't see any vme related files in /dev !! [0.00] Kernel command line: BOOT_IMAGE=/vmlinuz-3.14.9 root=UUID=aee6e594-4be8-46d4-abe6-7c054ef239b0 ro vconsole.font=latarcyrheb-sun16 vme_user.bus=0vme_tsi148.err_chk=1 rhgb quiet [1.879625] vme_user: VME User Space Access Driver [1.879846] vme_tsi148 :04:04.0: Board is the VME system controller [1.879849] vme_tsi148 :04:04.0: VME geographical address is 0 [1.879851] vme_tsi148 :04:04.0: VME Write and flush and error check is enabled [1.880240] vme_tsi148 :04:04.0: CR/CSR Offset: 0 [1.880244] vme_tsi148 :04:04.0: Enabling CR/CSR space Any help is sincerely appreciated :) Cheers! On Tue, Jun 24, 2014 at 4:19 AM, Martyn Welch martyn.we...@ge.com wrote: On 23/06/14 16:05, Maurice Moss wrote: Hi All, Thanks for your reply. I have been away the last few weeks. Dan, I am using 64 bit Debian 3.2.57. So I am not using the latest kernel. Would this be a problem? That's probably quite old now. Depending on your hardware there may be important fixes. There was certainly one to get the driver working on SBCs with IOMMUs, though I'm afraid I don't know exactly which version that landed in off the top of my head. Martyn, I don't have a bus analyzer. I believe I have understood a few more things about my setup, but I still manage to hang the bus. I have the following questions for now: 1. Is there a way to find out if the tsi148 driver is working correctly? Do you have a second SBC? It would probably be easier to prove out basic accesses between 2 SBCs. 2. Addressing?! I am still not clear on the addressing scheme. From the documentation of the slave (ZMI 4104 card) given it's set in slot 2 with Geographical Addressing enabled, the 24 bits of it's VME bus address are: A(23:20) - 'b [Board jumpers set to zero] A(19:15) - 'b00010 [Geographical address set to 2, as the slave is in slot 2] A(14) - 'b0 [0 if Geo Addressing enabled] AFAIK, this sets the base of the window to, 0x1. Am I correct to assume this? Might be worth checking that the backplane supports geographical addressing. Can you put the SBC in the slot that the slave is usually in? Assuming that the SBC is wired to support geographical addressing (and they aren't always), the driver will print out the slot it detects it's in when the driver is loaded. Make sure your not forcing the geographical address via the kernel param! That'll hopefully confirm that the slots getting the expected address. Does the board expect user/data cycles? The slave board responds to address modifier codes 0x39 (A24 non-privileged data access), and 0x3D (A24 supervisory data access), hence I set: master.cycle = 0x2000 | 0x8000; // user/data access That sounds right. Martyn Cheers! On Wed, Jun 11, 2014 at 10:36 AM, Martyn Welch martyn.we...@ge.com wrote: Hi Maurice, On 04/06/14 22:43, Maurice Moss wrote: Dear All, I came across the link here and decided to write to you, as I am facing a very similar problem: http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2013-May/037941.html With the above linux, I have recompiled the kernel and booting the image with a vme_user.bus=0 vme_tsi148.geoid=1 vme_tsi148.err_chk=1 flags. I am just starting to get familiar with VME. Using XVME 6300 (sitting in Slot 1), I am trying to access a ZMI 4100 board (in slot 2, only 2 slots on the chassis whose back plane supports GA) via geographical addressing. If the backplane supports geographical addressing, you don't need to set geoid (unless your SBC doesn't support geoid that is). The ZMI board (supports only A24, D16/32, GA, NO CS/CSR). I pretty much have the same code as mentioned in the thread, however all I read are 0xff's and my system hangs every once in a while (needs hard reset). This makes debugging very hard. I am trying to read valid registers at a given offset (in this case 0x003C). My master struct is setup as below and I hope you can help me with the following questions: master.enable = 1; master.vme_addr = 0x1; master.size = 0x1; master.aspace = 2; // VME_A24 master.cycle = 0x2000 | 0x8000;// user/data access master.dwidth = 2; // 16 bit word access Is this offset 0x003C in the VME address space or 0x1003C? You have the base of the window set to 0x1. Does the board expect user/data cycles? 0. I suspect my master struct is packed wrong. struct vme_master { int enable; /* State of Window */ unsigned long long vme_addr;/* Starting
Re: [PATCH v3 0/8] component helper improvements
Hi Russell, Sorry for the late review. On Wednesday 02 July 2014 15:59:04 Russell King - ARM Linux wrote: On Tue, Jul 01, 2014 at 03:40:11PM +0100, Russell King - ARM Linux wrote: A while back, Laurent raised some comments about the component helper, which this patch set starts to address. I looked back over the two other times which this series has posted, and noticed that two patches had been reviewed, so I've added those tags. Unless there's any objections from anyone, I'll send the first three off to Greg either tonight or tomorrow night, which at least gets us moving forward on this. If anyone has any objections, please shout ASAP. Thanks. No objection from my side at all, this is a nice improvement. For the first three patches, Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com -- Regards, Laurent Pinchart ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 0/3] staging: comedi: addi_apci_1564: miscellaneous fixes and cleanups
This patchset moves a misplaced include to the proper file, swaps out an overly aggressive placement of apci1564_reset(), and cleans up apci1564_interrupt(). Chase Southwood (3): staging: comedi: addi_apci_1564: move addi_watchdog.h include to addi_apci_1564.c staging: comedi: addi_apci_1564: fix use of apci1564_reset() to disable DI interrupts staging: comedi: addi_apci_1564: clean up apci1564_interrupt() .../comedi/drivers/addi-data/hwdrv_apci1564.c | 2 - drivers/staging/comedi/drivers/addi_apci_1564.c| 139 + 2 files changed, 32 insertions(+), 109 deletions(-) -- 2.0.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/3] staging: comedi: addi_apci_1564: move addi_watchdog.h include to addi_apci_1564.c
Commit aed3f9d (staging: comedi: addi_apci_1564: absorb apci1564_reset()) moved the only use of addi_watchdog.h from hwdrv_apci1564.c to addi_apci_1564.c, but left the include statement itself in the former file. Move this include to the file which actually uses it. Signed-off-by: Chase Southwood chase.southw...@gmail.com Cc: Ian Abbott abbo...@mev.co.uk Cc: H Hartley Sweeten hswee...@visionengravers.com --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c | 2 -- drivers/staging/comedi/drivers/addi_apci_1564.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c index 4007fd2..7326f3a 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c @@ -21,8 +21,6 @@ * */ -#include ../addi_watchdog.h - #define APCI1564_ADDRESS_RANGE 128 /* Digital Input IRQ Function Selection */ diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c index f71ee02..59786e7 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1564.c +++ b/drivers/staging/comedi/drivers/addi_apci_1564.c @@ -4,6 +4,7 @@ #include ../comedidev.h #include comedi_fc.h #include amcc_s5933.h +#include addi_watchdog.h #include addi-data/addi_common.h -- 2.0.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/3] staging: comedi: addi_apci_1564: fix use of apci1564_reset() to disable DI interrupts
apci1564_cos_insn_config() is currently using apci1564_reset() to disable digital input interrupts when the configuration operation is COMEDI_DIGITAL_TRIG_DISABLE. However, this is incorrect as the device reset function also resets the registers for the digital outputs, timer, watchdog, and counters as well. Replace the reset function call with a direct disabling of just the digital input interrupts. Signed-off-by: Chase Southwood chase.southw...@gmail.com Cc: Ian Abbott abbo...@mev.co.uk Cc: H Hartley Sweeten hswee...@visionengravers.com --- drivers/staging/comedi/drivers/addi_apci_1564.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c index 59786e7..0141ed9 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1564.c +++ b/drivers/staging/comedi/drivers/addi_apci_1564.c @@ -285,7 +285,10 @@ static int apci1564_cos_insn_config(struct comedi_device *dev, devpriv-ctrl = 0; devpriv-mode1 = 0; devpriv-mode2 = 0; - apci1564_reset(dev); + outl(0x0, devpriv-amcc_iobase + APCI1564_DI_IRQ_REG); + inl(devpriv-amcc_iobase + APCI1564_DI_INT_STATUS_REG); + outl(0x0, devpriv-amcc_iobase + APCI1564_DI_INT_MODE1_REG); + outl(0x0, devpriv-amcc_iobase + APCI1564_DI_INT_MODE2_REG); break; case COMEDI_DIGITAL_TRIG_ENABLE_EDGES: if (devpriv-ctrl != (APCI1564_DI_INT_ENABLE | -- 2.0.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/3] staging: comedi: addi_apci_1564: clean up apci1564_interrupt()
Remove the checks for interrupts from unknown sources. This situation should never occur and the checks were doing nothing to help the situation. Also, the portion of the function for handling counter interrupts is reapeated four times (once for each counter), but is completely identical save for the register is is accessing, so we can handle all four counters with a for loop. Finally, the interrupt handler is incorrectly setting and then checking devpriv-timer_select_mode before processing some of the triggered interrupts, so just remove all occurrences of this. Signed-off-by: Chase Southwood chase.southw...@gmail.com Cc: Ian Abbott abbo...@mev.co.uk Cc: H Hartley Sweeten hswee...@visionengravers.com --- drivers/staging/comedi/drivers/addi_apci_1564.c | 133 +--- 1 file changed, 27 insertions(+), 106 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c index 0141ed9..5924421 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1564.c +++ b/drivers/staging/comedi/drivers/addi_apci_1564.c @@ -58,48 +58,33 @@ static irqreturn_t apci1564_interrupt(int irq, void *d) struct comedi_device *dev = d; struct apci1564_private *devpriv = dev-private; struct comedi_subdevice *s = dev-read_subdev; - unsigned int ui_DO, ui_DI; - unsigned int ui_Timer; - unsigned int ui_C1, ui_C2, ui_C3, ui_C4; - unsigned int ul_Command2 = 0; + unsigned int status; + unsigned int ctrl; + unsigned int chan; /* check interrupt is from this device */ if ((inl(devpriv-amcc_iobase + AMCC_OP_REG_INTCSR) INTCSR_INTR_ASSERTED) == 0) return IRQ_NONE; - /* check which interrupt was triggered */ - ui_DI = inl(devpriv-amcc_iobase + APCI1564_DI_IRQ_REG) - APCI1564_DI_INT_ENABLE; - ui_DO = inl(devpriv-amcc_iobase + APCI1564_DO_IRQ_REG) 0x01; - ui_Timer = inl(devpriv-amcc_iobase + APCI1564_TIMER_IRQ_REG) 0x01; - ui_C1 = - inl(dev-iobase + APCI1564_TCW_IRQ_REG(APCI1564_COUNTER1)) 0x1; - ui_C2 = - inl(dev-iobase + APCI1564_TCW_IRQ_REG(APCI1564_COUNTER2)) 0x1; - ui_C3 = - inl(dev-iobase + APCI1564_TCW_IRQ_REG(APCI1564_COUNTER3)) 0x1; - ui_C4 = - inl(dev-iobase + APCI1564_TCW_IRQ_REG(APCI1564_COUNTER4)) 0x1; - if (ui_DI == 0 ui_DO == 0 ui_Timer == 0 ui_C1 == 0 -ui_C2 == 0 ui_C3 == 0 ui_C4 == 0) { - return IRQ_HANDLED; - } - - if (ui_DI) { + status = inl(devpriv-amcc_iobase + APCI1564_DI_IRQ_REG); + if (status APCI1564_DI_INT_ENABLE) { /* disable the interrupt */ - outl(ui_DI APCI1564_DI_INT_DISABLE, devpriv-amcc_iobase + APCI1564_DI_IRQ_REG); + outl(status APCI1564_DI_INT_DISABLE, +devpriv-amcc_iobase + APCI1564_DI_IRQ_REG); - s-state = inl(dev-iobase + APCI1564_DI_INT_STATUS_REG) 0x; + s-state = inl(dev-iobase + APCI1564_DI_INT_STATUS_REG) + 0x; comedi_buf_put(s, s-state); s-async-events |= COMEDI_CB_BLOCK | COMEDI_CB_EOS; comedi_event(dev, s); /* enable the interrupt */ - outl(ui_DI, devpriv-amcc_iobase + APCI1564_DI_IRQ_REG); + outl(status, devpriv-amcc_iobase + APCI1564_DI_IRQ_REG); } - if (ui_DO == 1) { + status = inl(devpriv-amcc_iobase + APCI1564_DO_IRQ_REG); + if (status 0x01) { /* Check for Digital Output interrupt Type */ /* 1: VCC interrupt*/ /* 2: CC interrupt */ @@ -112,98 +97,34 @@ static irqreturn_t apci1564_interrupt(int irq, void *d) send_sig(SIGIO, devpriv-tsk_current, 0); } - if (ui_Timer == 1) { - devpriv-timer_select_mode = ADDIDATA_TIMER; - if (devpriv-timer_select_mode) { - - /* Disable Timer Interrupt */ - ul_Command2 = inl(devpriv-amcc_iobase + APCI1564_TIMER_CTRL_REG); - outl(0x0, devpriv-amcc_iobase + APCI1564_TIMER_CTRL_REG); - - /* Send a signal to from kernel to user space */ - send_sig(SIGIO, devpriv-tsk_current, 0); - - /* Enable Timer Interrupt */ - - outl(ul_Command2, devpriv-amcc_iobase + APCI1564_TIMER_CTRL_REG); - } - } - - if (ui_C1 == 1) { - devpriv-timer_select_mode = ADDIDATA_COUNTER; - if (devpriv-timer_select_mode) { - - /* Disable Counter Interrupt */ - ul_Command2 = - inl(dev-iobase +
Re: [Q] Removed cxt1e1 module in staging branch
2014-07-03 8:37 GMT+09:00 Greg KH gre...@linuxfoundation.org: On Thu, Jul 03, 2014 at 08:32:05AM +0900, DaeSeok Youn wrote: Hi, Kristina, Thanks for reply. I hadn't developed for specific driver(I'm beginner to develop Linux Kernel :-) ), so I can make patches for other drivers. I'd recommend picking another driver, hopefully one you can find the hardware for so you can test changes easier. OK. Thanks. regards, Daeseok Youn Best of luck, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: How to cleanup this functions?
On Tue, Jul 01, 2014 at 11:42:27AM +0200, Matthias Beyer wrote: Hi Kevin, Don't know if this mail should go to the ML, too, ... if you want, you can forward it or add the ML as recipient for your answer! I'm currently working on some cleanup patches for the drivers/staging/bcm/IPv6Protocol.c file. I want to clean up the code for the functions [0] MatchSrcIpv6Address() MatchDestIpv6Address() as this code is literally the same. They differ just in what they print via the BCM_DEBUG_PRINT() macro. Do you have an Idea how to generalize this functions? The problem I'm facing is that the named macro wants some string literals, but when outsourcing the code, I'm not able to generalize these. I think you can make the string literal in the BCM_DEBUG_PRINT() macro generic. Instead of specifying the source or destination IP Address; I would simply say the IP Address. I would make the 4 messages generic and remove one of these functions. Thereby reducing the lines of code, like you said. I have some ideas how to solve this problem: 1) Passing Function-Ptrs as debug-print callbacks to the generalized function. Not clean at all, as for each BCM_DEBUG_PRINT() call I would pass one function-ptr. 2) A static const variable which contains the strings in a struct[], passing the index of the appropriate struct to the generalized function. Not very clean. 3) Passing a simple flag, the generalized function decides which string to BCM_DEBUG_PRINT(). Clean, but not very readable. If you don't know either, I would start with the 3rd approach and look what the maintainers say. Let's take inventory for the maintainers and see what other ideas they have. Btw: This patch would result in 50 lines less in the file, which is desireable, I guess. [0]: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/staging/bcm/IPv6Protocol.c#n291 -- Mit freundlichen Grüßen, Kind regards, Matthias Beyer Proudly sent with mutt. Happily signed with gnupg. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: bcm: Add entry for bcm wimax driver support
Add myself and Matthias Beyer as maintainers for the bcm wimax driver. Signed-off-by: Kevin McKinney klmckinn...@gmail.com --- MAINTAINERS |7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index e2207f7..0853c33 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1777,6 +1777,13 @@ W: http://bcache.evilpiepirate.org S: Maintained: F: drivers/md/bcache/ +BECEEM BCS200/BCS220-3/BCSM250 WIMAX SUPPORT +M: Kevin McKinney klmckinn...@gmail.com +M: Matthias Beyer m...@beyermatthias.de +L: de...@driverdev.osuosl.org +S: Maintained +F: drivers/staging/bcm* + BEFS FILE SYSTEM S: Orphan F: Documentation/filesystems/befs.txt -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel