diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_set.c b/drivers/staging/rtl8712/rtl871x_ioctl_set.c index 0aaf2aab6dd0..01a150446f5a 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_set.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_set.c @@ -139,9 +139,10 @@ u8 r8712_set_802_11_bssid(struct _adapter *padapter, u8 *bssid) if (!memcmp(&pmlmepriv->cur_network.network.MacAddress, bssid, ETH_ALEN)) { if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE)) - goto _Abort_Set_BSSID; /* driver is in - * WIFI_ADHOC_MASTER_STATE - */ + /* driver is in + * WIFI_ADHOC_MASTER_STATE + */ + goto _Abort_Set_BSSID; } else { r8712_disassoc_cmd(padapter); if (check_fwstate(pmlmepriv, _FW_LINKED)) @@ -203,9 +204,10 @@ void r8712_set_802_11_ssid(struct _adapter *padapter, WIFI_ADHOC_STATE); } } else { - goto _Abort_Set_SSID; /* driver is in - * WIFI_ADHOC_MASTER_STATE - */ + /* driver is in + * WIFI_ADHOC_MASTER_STATE + */ + goto _Abort_Set_SSID; } } } else { diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c index c1feef3da26c..5df1273e75cd 100644 --- a/drivers/staging/rtl8712/rtl871x_mlme.c +++ b/drivers/staging/rtl8712/rtl871x_mlme.c @@ -137,11 +137,10 @@ static void free_network_nolock(struct mlme_priv *pmlmepriv, } -/* - return the wlan_network with the matching addr - Shall be called under atomic context... - to avoid possible racing condition... -*/ +/* return the wlan_network with the matching addr + * Shall be called under atomic context... + * to avoid possible racing condition... + */ static struct wlan_network *_r8712_find_network(struct __queue *scanned_queue, u8 *addr) { @@ -239,11 +238,10 @@ void r8712_free_network_queue(struct _adapter *dev) } /* - return the wlan_network with the matching addr - - Shall be called under atomic context... - to avoid possible racing condition... -*/ + * return the wlan_network with the matching addr + * Shall be called under atomic context... + * to avoid possible racing condition... + */ static struct wlan_network *r8712_find_network(struct __queue *scanned_queue, u8 *addr) { @@ -369,9 +367,7 @@ static void update_current_network(struct _adapter *adapter, } } -/* -Caller must hold pmlmepriv->lock first. -*/ +/* Caller must hold pmlmepriv->lock first */ static void update_scanned_network(struct _adapter *adapter, struct wlan_bssid_ex *target) { @@ -651,8 +647,8 @@ void r8712_free_assoc_resources(struct _adapter *adapter) } /* -*r8712_indicate_connect: the caller has to lock pmlmepriv->lock -*/ + * r8712_indicate_connect: the caller has to lock pmlmepriv->lock + */ void r8712_indicate_connect(struct _adapter *padapter) { struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -668,8 +664,8 @@ void r8712_indicate_connect(struct _adapter *padapter) /* -*r8712_ind_disconnect: the caller has to lock pmlmepriv->lock -*/ + * r8712_ind_disconnect: the caller has to lock pmlmepriv->lock + */ void r8712_ind_disconnect(struct _adapter *padapter) { struct mlme_priv *pmlmepriv = &padapter->mlmepriv; diff --git a/drivers/staging/rtl8712/rtl871x_pwrctrl.c b/drivers/staging/rtl8712/rtl871x_pwrctrl.c index d464c136dd98..e42fc1404c35 100644 --- a/drivers/staging/rtl8712/rtl871x_pwrctrl.c +++ b/drivers/staging/rtl8712/rtl871x_pwrctrl.c @@ -190,19 +190,15 @@ void r8712_init_pwrctrl_priv(struct _adapter *padapter) } /* -Caller: r8712_cmd_thread - -Check if the fw_pwrstate is okay for issuing cmd. -If not (cpwm should be is less than P2 state), then the sub-routine -will raise the cpwm to be greater than or equal to P2. - -Calling Context: Passive - -Return Value: - -_SUCCESS: r8712_cmd_thread can issue cmds to firmware afterwards. -_FAIL: r8712_cmd_thread can not do anything. -*/ + * Caller: r8712_cmd_thread + * Check if the fw_pwrstate is okay for issuing cmd. + * If not (cpwm should be is less than P2 state), then the sub-routine + * will raise the cpwm to be greater than or equal to P2. + * Calling Context: Passive + * Return Value: + * _SUCCESS: r8712_cmd_thread can issue cmds to firmware afterwards. + * _FAIL: r8712_cmd_thread can not do anything. + */ sint r8712_register_cmd_alive(struct _adapter *padapter) { uint res = _SUCCESS; @@ -219,13 +215,11 @@ sint r8712_register_cmd_alive(struct _adapter *padapter) } /* -Caller: ISR - -If ISR's txdone, -No more pkts for TX, -Then driver shall call this fun. to power down firmware again. -*/ - + * Caller: ISR + * If ISR's txdone, + * No more pkts for TX, + * Then driver shall call this fun. to power down firmware again. + */ void r8712_unregister_cmd_alive(struct _adapter *padapter) { struct pwrctrl_priv *pwrctrl = &padapter->pwrctrlpriv; diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c index de80f0c01d2c..35c721a50598 100644 --- a/drivers/staging/rtl8712/rtl871x_recv.c +++ b/drivers/staging/rtl8712/rtl871x_recv.c @@ -125,13 +125,10 @@ union recv_frame *r8712_alloc_recvframe(struct __queue *pfree_recv_queue) } /* -caller : defrag; recvframe_chk_defrag in recv_thread (passive) -pframequeue: defrag_queue : will be accessed in recv_thread (passive) - -using spin_lock to protect - -*/ - + * caller : defrag; recvframe_chk_defrag in recv_thread (passive) + * pframequeue: defrag_queue : will be accessed in recv_thread (passive) + * using spin_lock to protect + */ void r8712_free_recvframe_queue(struct __queue *pframequeue, struct __queue *pfree_recv_queue) { diff --git a/drivers/staging/rtl8712/rtl871x_security.c b/drivers/staging/rtl8712/rtl871x_security.c index 09242425dad4..a7f04a4b089d 100644 --- a/drivers/staging/rtl8712/rtl871x_security.c +++ b/drivers/staging/rtl8712/rtl871x_security.c @@ -159,8 +159,8 @@ static u32 getcrc32(u8 *buf, u32 len) } /* - Need to consider the fragment situation -*/ + * Need to consider the fragment situation + */ void r8712_wep_encrypt(struct _adapter *padapter, u8 *pxmitframe) { /* exclude ICV */ unsigned char crc[4]; @@ -467,22 +467,22 @@ static const unsigned short Sbox1[2][256] = {/* Sbox for hash (can be in ROM) */ }; /* -********************************************************************** -* Routine: Phase 1 -- generate P1K, given TA, TK, IV32 -* -* Inputs: -* tk[] = temporal key [128 bits] -* ta[] = transmitter's MAC address [ 48 bits] -* iv32 = upper 32 bits of IV [ 32 bits] -* Output: -* p1k[] = Phase 1 key [ 80 bits] -* -* Note: -* This function only needs to be called every 2**16 packets, -* although in theory it could be called every packet. -* -********************************************************************** -*/ + ********************************************************************** + * Routine: Phase 1 -- generate P1K, given TA, TK, IV32 + * + * Inputs: + * tk[] = temporal key [128 bits] + * ta[] = transmitter's MAC address [ 48 bits] + * iv32 = upper 32 bits of IV [ 32 bits] + * Output: + * p1k[] = Phase 1 key [ 80 bits] + * + * Note: + * This function only needs to be called every 2**16 packets, + * although in theory it could be called every packet. + * + ********************************************************************** + */ static void phase1(u16 *p1k, const u8 *tk, const u8 *ta, u32 iv32) { sint i; @@ -506,28 +506,28 @@ static void phase1(u16 *p1k, const u8 *tk, const u8 *ta, u32 iv32) } /* -********************************************************************** -* Routine: Phase 2 -- generate RC4KEY, given TK, P1K, IV16 -* -* Inputs: -* tk[] = Temporal key [128 bits] -* p1k[] = Phase 1 output key [ 80 bits] -* iv16 = low 16 bits of IV counter [ 16 bits] -* Output: -* rc4key[] = the key used to encrypt the packet [128 bits] -* -* Note: -* The value {TA,IV32,IV16} for Phase1/Phase2 must be unique -* across all packets using the same key TK value. Then, for a -* given value of TK[], this TKIP48 construction guarantees that -* the final RC4KEY value is unique across all packets. -* -* Suggested implementation optimization: if PPK[] is "overlaid" -* appropriately on RC4KEY[], there is no need for the final -* for loop below that copies the PPK[] result into RC4KEY[]. -* -********************************************************************** -*/ + ********************************************************************** + * Routine: Phase 2 -- generate RC4KEY, given TK, P1K, IV16 + * + * Inputs: + * tk[] = Temporal key [128 bits] + * p1k[] = Phase 1 output key [ 80 bits] + * iv16 = low 16 bits of IV counter [ 16 bits] + * Output: + * rc4key[] = the key used to encrypt the packet [128 bits] + * + * Note: + * The value {TA,IV32,IV16} for Phase1/Phase2 must be unique + * across all packets using the same key TK value. Then, for a + * given value of TK[], this TKIP48 construction guarantees that + * the final RC4KEY value is unique across all packets. + * + * Suggested implementation optimization: if PPK[] is "overlaid" + * appropriately on RC4KEY[], there is no need for the final + * for loop below that copies the PPK[] result into RC4KEY[]. + * + ********************************************************************** + */ static void phase2(u8 *rc4key, const u8 *tk, const u16 *p1k, u16 iv16) { sint i; diff --git a/drivers/staging/rtl8712/rtl871x_xmit.c b/drivers/staging/rtl8712/rtl871x_xmit.c index 484d2f2d2449..4ab82ba9bb3f 100644 --- a/drivers/staging/rtl8712/rtl871x_xmit.c +++ b/drivers/staging/rtl8712/rtl871x_xmit.c @@ -71,8 +71,8 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv, memset((unsigned char *)pxmitpriv, 0, sizeof(struct xmit_priv)); spin_lock_init(&pxmitpriv->lock); /* - Please insert all the queue initialization using _init_queue below - */ + *Please insert all the queue initialization using _init_queue below + */ pxmitpriv->adapter = padapter; _init_queue(&pxmitpriv->be_pending); _init_queue(&pxmitpriv->bk_pending); @@ -83,10 +83,10 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv, _init_queue(&pxmitpriv->apsd_queue); _init_queue(&pxmitpriv->free_xmit_queue); /* - Please allocate memory with the sz = (struct xmit_frame) * NR_XMITFRAME, - and initialize free_xmit_frame below. - Please also apply free_txobj to link_up all the xmit_frames... - */ + * Please allocate memory with the sz = (struct xmit_frame) * NR_XMITFRAME, + * and initialize free_xmit_frame below. + * Please also apply free_txobj to link_up all the xmit_frames... + */ pxmitpriv->pallocated_frame_buf = kmalloc(NR_XMITFRAME * sizeof(struct xmit_frame) + 4, GFP_ATOMIC); if (!pxmitpriv->pallocated_frame_buf) { @@ -109,8 +109,8 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv, } pxmitpriv->free_xmitframe_cnt = NR_XMITFRAME; /* - init xmit hw_txqueue - */ + * init xmit hw_txqueue + */ _r8712_init_hw_txqueue(&pxmitpriv->be_txqueue, BE_QUEUE_INX); _r8712_init_hw_txqueue(&pxmitpriv->bk_txqueue, BK_QUEUE_INX); _r8712_init_hw_txqueue(&pxmitpriv->vi_txqueue, VI_QUEUE_INX); @@ -780,24 +780,23 @@ int r8712_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf) } /* -Calling context: -1. OS_TXENTRY -2. RXENTRY (rx_thread or RX_ISR/RX_CallBack) - -If we turn on USE_RXTHREAD, then, no need for critical section. -Otherwise, we must use _enter/_exit critical to protect free_xmit_queue... - -Must be very very cautious... - -*/ - + * Calling context: + * 1. OS_TXENTRY + * 2. RXENTRY (rx_thread or RX_ISR/RX_CallBack) + * + * If we turn on USE_RXTHREAD, then, no need for critical section. + * Otherwise, we must use _enter/_exit critical to protect free_xmit_queue... + * + * Must be very very cautious... + * + */ struct xmit_frame *r8712_alloc_xmitframe(struct xmit_priv *pxmitpriv) { /* - Please remember to use all the osdep_service api, - and lock/unlock or _enter/_exit critical to protect - pfree_xmit_queue - */ + * Please remember to use all the osdep_service api, + * and lock/unlock or _enter/_exit critical to protect + * pfree_xmit_queue + */ unsigned long irqL; struct xmit_frame *pxframe; struct __queue *pfree_xmit_queue = &pxmitpriv->free_xmit_queue;