summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8712/rtl871x_cmd.c
AgeCommit message (Collapse)Author
2015-05-31staging: rtl8712: fix stack dumpSudip Mukherjee
del_timer_sync() is not to be called in the interrupt context unless the timer is irqsafe. but most of the functions where commits 6501c8e7d86cca5f and 382d020f4459cd77 touched were called in interrupt context. And as a result the WARN_ON was getting triggered. Changed to del_timer() in places which were called from interrupt. Fixes: 382d020f4459cd77 ("Staging: rtl8712: Eliminate use of _cancel_timer" Fixes: 6501c8e7d86cca5f ("Staging: rtl8712: Eliminate use of _cancel_timer_ex") Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=97711 Reported-by: Arek Rusniak <arek.rusi@gmail.com> Tested-by: Arek Rusniak <arek.rusi@gmail.com> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16Staging: rtl8712: Eliminate use of _cancel_timerVaishali Thakkar
Use timer API function del_timer_sync instead of driver specific function _cancel_timer as besides deactivating a timer, it also ensures that the timer is stopped on all CPUs before the driver exists. Also, variables timer_cancelled and bool are removed as they are no longer needed. @a@ expression x; identifier y; @@ - _cancel_timer (&x, &y); + del_timer_sync (&x); @@type T; identifier a.y;@@ - T y; ...when != y Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01Staging: rtl8712: Eliminate use of _set_timerVaishali Thakkar
This patch introduces the use of API function mod_timer instead of driver specific function _set_timer as it is a more efficient and standard way to update the expire field of an active timer. Also, definition of function _set_timer is removed as it is no longer needed after this change. Here, these cases are handled using Coccinelle and semantic patch used for this is as follows: @@ expression x; expression y;@@ - _set_timer (&x, y); + mod_timer (&x, jiffies + msecs_to_jiffies (y)); Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8712: replace memcpy() by ether_addr_copy() using coccinelle and ↵Melike Yurtoglu
pack variable This patch focuses on fixing the following warning generated by checkpatch.pl for the file rtl871x_cmd.c Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2) @@ expression e1, e2; @@ - memcpy(e1, e2, ETH_ALEN); + ether_addr_copy(e1, e2); struct _adapter { struct dvobj_priv dvobjpriv; /* 0 40*/ struct mlme_priv mlmepriv; /* 40 1560*/ /* --- cacheline 25 boundary (1600 bytes) --- */ struct cmd_priv cmdpriv; /* 1600 136*/ /* --- cacheline 27 boundary (1728 bytes) was 8 bytes ago --- */ struct evt_priv evtpriv; /* 1736 96*/ /* --- cacheline 28 boundary (1792 bytes) was 40 bytes ago --- * */ struct io_queue * pio_queue; /* 1832 8*/ struct xmit_priv xmitpriv; /* 1840 912*/ /* --- cacheline 43 boundary (2752 bytes) --- */ struct recv_priv recvpriv; /* 2752 1088*/ /* --- cacheline 60 boundary (3840 bytes) --- */ struct sta_priv stapriv; /* 3840 672*/ /* --- cacheline 70 boundary (4480 bytes) was 32 bytes ago --- * */ struct security_priv securitypriv; /* 4512 4816*/ /* --- cacheline 145 boundary (9280 bytes) was 48 bytes ago --- * */ struct registry_priv registrypriv; /* 9328 968*/ /* --- cacheline 160 boundary (10240 bytes) was 56 bytes ago --- * */ struct wlan_acl_pool acl_list; /* 10296 1536*/ /* --- cacheline 184 boundary (11776 bytes) was 56 bytes ago --- * */ struct pwrctrl_priv pwrctrlpriv; /* 11832 224*/ /* --- cacheline 188 boundary (12032 bytes) was 24 bytes ago --- * */ struct eeprom_priv eeprompriv; /* 12056 508*/ /* XXX 4 bytes hole, try to pack */ /* --- cacheline 196 boundary (12544 bytes) was 24 bytes ago --- * */ struct hal_priv halpriv; /* 12568 88*/ /* --- cacheline 197 boundary (12608 bytes) was 48 bytes ago --- * */ struct led_priv ledpriv; /* 12656 304*/ /* --- cacheline 202 boundary (12928 bytes) was 32 bytes ago --- * */ struct mp_priv mppriv; /* 12960 1080*/ /* --- cacheline 219 boundary (14016 bytes) was 24 bytes ago * --- */ s32 bDriverStopped; /* 14040 4*/ s32 bSurpriseRemoved; /* 14044 4*/ u32 IsrContent; /* 14048 4*/ u32 ImrContent; /* 14052 4*/ u8 EepromAddressSize; /* 14056 1*/ u8 hw_init_completed; /* 14057 1*/ /* XXX 6 bytes hole, try to pack */ struct task_struct * cmdThread; /* 14064 8*/ pid_t evtThread; /* 14072 4*/ /* XXX 4 bytes hole, try to pack */ /* --- cacheline 220 boundary (14080 bytes) --- */ struct task_struct * xmitThread; /* 14080 8*/ pid_t recvThread; /* 14088 4*/ /* XXX 4 bytes hole, try to pack */ uint (*dvobj_init)(struct _adapter *); /*14096 8 */ void (*dvobj_deinit)(struct _adapter *);/* 14104 8 */ struct net_device * pnetdev; /* 14112 8*/ int bup; /* 14120 4*/ /* XXX 4 bytes hole, try to pack */ struct net_device_stats stats; /* 14128 184*/ /* --- cacheline 223 boundary (14272 bytes) was 40 bytes ago --- * */ struct iw_statistics iwstats; /* 14312 32*/ /* --- cacheline 224 boundary (14336 bytes) was 8 bytes ago --- * */ int pid; /* 14344 4*/ /* XXX 4 bytes hole, try to pack */ struct work_struct wkFilterRxFF0; /* 14352 32*/ u8 blnEnableRxFF0Filter; /* 14384 1*/ /* XXX 3 bytes hole, try to pack */ spinlock_t lockRxFF0Filter; /* 14388 4*/ const struct firmware * fw; /* 14392 8*/ /* --- cacheline 225 boundary (14400 bytes) --- */ struct usb_interface * pusb_intf; /* 14400 8*/ struct mutex mutex_start; /* 14408 40*/ /* XXX last struct has 4 bytes of padding */ struct completion rtl8712_fw_ready; /* 14448 32*/ /* --- cacheline 226 boundary (14464 bytes) was 16 bytes ago --- * */ /* size: 14480, cachelines: 227, members: 40 */ /* sum members: 14451, holes: 7, sum holes: 29 */ /* paddings: 1, sum paddings: 4 */ /* last cacheline: 16 bytes */ }; Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29staging: rtl8712: remove unused variablesSudip Mukherjee
unused variables are removed. These variables were only assigned some values and after that they were never being used. So they are safe to be removed , and it has been build tested. I left a call to r8712_read32(padapter, TCR) and r8712_read8(padapter, SDIO_HCPWM) . r8712_read32() and r8712_read8() is ultimately calling usb_read32() and usb_read8() respectively. and they are again calling r8712_usbctrl_vendorreq(). this r8712_usbctrl_vendorreq() is communicating through the usb bus and is sending and receiving the control msg. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20staging: rtl8712: Remove unnecessary cast for argument of kfreeTapasweni Pathak
This patch removes all occurrences of unnecessary cast on the argument to kfree, all over in rtl8712. There is no need of the cast on the argument to kfree. Greped to find occurrences. Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20staging: rtl8712: Replace "the the " with "the"Tapasweni Pathak
This patch replace "the the " with "the". The replacement couldn't be automated because sometimes the first "the" was meant to be another word. Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Acked-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26staging: rtl8712: remove wrapper function get_nextJames A Shackleford
get_next is just an inline wrapper around return list->next. This patch removes the wrapper and directly uses list->next where applicable. Signed-off-by: James A Shackleford <shack@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26staging: rtl8712: remove wrapper function list_deleteJames A Shackleford
list_delete is just an inline wrapper around list_del_init. This patch removes the wrapper and directly uses list_del_init. Signed-off-by: James A Shackleford <shack@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26staging: rtl8712: remove wrapper function list_insert_tailJames A Shackleford
list_insert_tail is just an inline wrapper around list_add_tail. This patch removes the wrapper and directly uses list_add_tail. Signed-off-by: James A Shackleford <shack@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26staging: rtl8712: remove wrapper function is_list_emptyJames A Shackleford
is_list_empty is just an inline wrapper around list_empty. This patch removes the wrapper and directly uses list_empty instead. Signed-off-by: James A Shackleford <shack@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26staging: rtl8712: remove wrapper function _init_listheadJames A Shackleford
_init_listhead is just an inline wrapper around INIT_LIST_HEAD. This patch removes the wrapper and directly uses INIT_LIST_HEAD instead. Signed-off-by: James A Shackleford <shack@linux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19staging: rtl8712: replace kmalloc(..., sizeof(T))Vitaly Osipov
As suggested by Andy Shevchenko on driverdev-devel, replace v = ... sizeof(struct type_of_v) -> sizeof(*v) Based on a cocci patch along the lines of @@ type T; expression E; identifier V; @@ T *V; ... - V = kmalloc(sizeof(T), E); + V = kmalloc(sizeof(*V), E); @@ type T; expression E; identifier V; @@ T *V; ... - V = kzalloc(sizeof(T), E); + V = kzalloc(sizeof(*V), E); Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-27staging: rtl8712: fix kmalloc parametersVitaly Osipov
After the commit 91d435f replaced _malloc with kmalloc, smatch picked up a couple of new warnings. This fixes warnings: warn: struct type mismatch 'writePTM_parm vs setdig_parm' warn: struct type mismatch 'writePTM_parm vs setra_parm' The difference is u8 vs unsigned char. Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-25staging: rtl8712: remove _malloc()Vitaly Osipov
This patch removes all usage of _malloc() and the function itself. Most uses are straightforward replacements by kmalloc(..., GFP_ATOMIC), because this was the definition of _malloc(). In a few places it was possible to use kzalloc() or memdup_user. A further improvement would be to replace GFP_ATOMIC with GFP_KERNEL where possible. Verified by compilation only. Initial replacement done by running a Coccinelle script along the lines of: @@ type T; expression E; identifier V; @@ - V = (T) _malloc(E); + V = kmalloc(E, GFP_ATOMIC); @@ expression E, E1; @@ - E1 = _malloc(E); + E1 = kmalloc(E, GFP_ATOMIC); Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-13staging: rtl8712: Remove unnecessary parentheses.Gulsah Kose
Remove unnecessary parentheses from rtl871x_cmd.c Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-07staging:rtl8712: Fix sparse warning incorrect type in assignmentHimangi Saraogi
This patch fixes the following sparse warnings: drivers/staging/rtl8712/rtl871x_cmd.c:471:30: warning: incorrect type in assignment (different base types) drivers/staging/rtl8712/rtl871x_cmd.c:471:30: expected unsigned int [unsigned] [usertype] Length drivers/staging/rtl8712/rtl871x_cmd.c:471:30: got restricted __le32 [usertype] <noident> drivers/staging/rtl8712/rtl871x_cmd.c:472:32: warning: incorrect type in assignment (different base types) drivers/staging/rtl8712/rtl871x_cmd.c:472:32: expected unsigned int [unsigned] [usertype] IELength drivers/staging/rtl8712/rtl871x_cmd.c:472:32: got restricted __le32 [usertype] <noident> drivers/staging/rtl8712/rtl871x_cmd.c:473:39: warning: incorrect type in assignment (different base types) drivers/staging/rtl8712/rtl871x_cmd.c:473:39: expected unsigned int [unsigned] [usertype] SsidLength drivers/staging/rtl8712/rtl871x_cmd.c:473:39: got restricted __le32 [usertype] <noident> Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17staging: delete non-required instances of include <linux/init.h>Paul Gortmaker
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03Staging: rtl8712: fix spaces before semicolonsThomas Cort
Resolve all of the 'WARNING: space prohibited before semicolon' checkpatch warnings for rtl8712. Signed-off-by: Thomas Cort <linuxgeek@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-11rtl8712: remove useless calls to memset().Cyril Roelandt
These calls are followed by calls to memcpy() on the same memory area, so they can be safely removed. Signed-off-by: Cyril Roelandt <tipecaml@gmail.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-26staging: r8712u: cleanup pointer type in r8712_setassocsta_cmd()Dan Carpenter
This seems like a cut and paste bug. Smatch complains that we don't allocate enough memory for a set_stakey_rsp struct. In fact this is used as a set_assocsta_rsp struct throughout and that also matches the name of the function. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-10staging: delete all duplicated endian crap from rtl8712 driverPaul Gortmaker
This driver had headers like big_endian.h, little_endian.h, swab.h and yet we can throw them all in the trash can and the thing still builds on x86-64 and ppc, just by deleting the references to the deleted files. Cc: Larry Finger <Larry.Finger@lwfinger.net> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-09-06staging: r8712u: Merging Realtek's latest (v2.6.6). Various fixes.Ali Bahar
In r8712_generate_ie(), HT check is no longer done. Removed r8712_add_ht_addt_info(). Changes to defragmentation handling, and queue selection. Get TSSI command. Added an Ad-Hoc check to is_desired_network() r8712_ind_disconnect() now checks for Linked state. r8712_xmit_bh() now schedules an xmit tasklet. Signed-off-by: Ali Bahar <ali@internetDog.org> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06staging: r8712u: Merging Realtek's latest (v2.6.6). Various fixes.Ali Bahar
passive_mode added to private ioctls. New private ioctls added for RSSI, link speed, mac address, scan type, and DCE-D. In r8711_wx_get_scan(), we now sleep only 100 times, instead of 1000. In r8711_wx_set_essid(), added a check for Ad-Hoc state. In r8711_wx_get_rate(), added a check for RTL8712_RF_2T2R RF type. Added Set chplan. In r871x_get_wireless_stats(), updated the mechanism for displaying link quality. Added SetDIG and SetRA commands. r8712_joinbss_cmd() no longer checks for Ad-Hoc mode. Signed-off-by: Ali Bahar <ali@internetDog.org> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06staging: r8712u: Merging Realtek's latest (v2.6.6). New decl's and defines.Ali Bahar
Removed unnecessary casts in kfree calls. A few new types, defines and prototypes. Signed-off-by: Ali Bahar <ali@internetDog.org> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06staging: r8712u: Merging Realtek's latest (v2.6.6). Updated include directives.Ali Bahar
These are the new include directives for header files. The following were (somehow!) not explicity in Realtek's, but proved necessary: "linux/usb.h" is needed for usb_alloc_urb(); "linux/interrupt.h" is needed for tasklet_struct. It was often a nested include. Signed-off-by: Ali Bahar <ali@internetDog.org> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-20staging: rtl8712: fixed coding style issuesJavier M. Mellid
Fixed some style and format issues with code. Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-20Staging: rtl8712: redundant null check before kfree()Alexander Beregalov
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31staging: r8712u: Use 802.11bg mode to make a WEP connectionLarry Finger
There are some IOT issues when 802.11bgn mode is used to make a WEP connection. Signed-off-by: Albert Wang <albert_wang@realtek.com.tw> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-20staging: r8712u: Add the new driver to the mainline kernelLarry Finger
This code is for a completely new version of the Realtek 8192 USB devices such as the D-Link DWA-130. The Realtek code, which was originally for Linux, Windows XP and Windows CE, has been stripped of all code not needed for Linux. In addition, only one additional configuration variable, which enables AP mode, remains. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Florian Schilhabel <florian.c.schilhabel@googlemail.com> Tested-by: Frederic Leroy <fredo@starox.org>