staging: rtl8723bs: code cleanup and style fixes
cover staging: rtl8723bs: code cleanup and style fixes
This series addresses several items from the rtl8723bs TODO list:
1. Remove dead code for other Realtek chips (RTL8188E, RTL8812, etc.) that was left over from the vendor driver.
2. Convert PSTA_INFO_T typedef to standard struct sta_info *.
3. Remove NDIS_802_11_* type aliases in favor of kernel types.
4. Remove the redundant MAC_ARG macro in favor of the kernel's standard %pM format specifier for MAC addresses.
5. Fix all LONG_LINE checkpatch warnings by refactoring lines exceeding 100 characters using proper techniques (temp variables, function signature breaks, comment placement etc.) rather than blind line wrapping.
These patches improve code readability, remove non-standard constructs, and bring the driver closer to kernel coding standards.
Luka Gejak (5):
staging: rtl8723bs: remove unused code for other Realtek chips
staging: rtl8723bs: convert PSTA_INFO_T to struct sta_info *
staging: rtl8723bs: remove NDIS type aliases
staging: rtl8723bs: remove redundant MAC_ARG macro
staging: rtl8723bs: fix LONG_LINE warnings across C files
drivers/staging/rtl8723bs/core/rtw_cmd.c | 144 ++--- .../staging/rtl8723bs/core/rtw_ieee80211.c | 36 +- drivers/staging/rtl8723bs/core/rtw_io.c | 4 +- .../staging/rtl8723bs/core/rtw_ioctl_set.c | 16 +- drivers/staging/rtl8723bs/core/rtw_mlme.c | 103 ++-- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 500 ++++++++++++------ drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 3 +- drivers/staging/rtl8723bs/core/rtw_recv.c | 123 +++-- drivers/staging/rtl8723bs/core/rtw_security.c | 11 +- drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 2 +- .../staging/rtl8723bs/core/rtw_wlan_util.c | 215 +++++--- drivers/staging/rtl8723bs/core/rtw_xmit.c | 62 ++- .../staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 35 +- .../staging/rtl8723bs/hal/HalBtc8723b2Ant.c | 29 +- drivers/staging/rtl8723bs/hal/HalPhyRf.c | 36 +- .../staging/rtl8723bs/hal/HalPhyRf_8723B.c | 166 ++++-- drivers/staging/rtl8723bs/hal/hal_com.c | 10 +- .../staging/rtl8723bs/hal/hal_com_phycfg.c | 22 +- drivers/staging/rtl8723bs/hal/hal_intf.c | 4 +- drivers/staging/rtl8723bs/hal/hal_sdio.c | 4 +- drivers/staging/rtl8723bs/hal/odm.c | 28 +- drivers/staging/rtl8723bs/hal/odm.h | 11 +- drivers/staging/rtl8723bs/hal/odm_DIG.c | 38 +- drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 19 +- drivers/staging/rtl8723bs/hal/odm_types.h | 3 - drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 103 +++- .../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 64 ++- .../staging/rtl8723bs/hal/rtl8723b_phycfg.c | 54 +- .../staging/rtl8723bs/hal/rtl8723b_rf6052.c | 6 +- .../staging/rtl8723bs/hal/rtl8723bs_recv.c | 6 +- .../staging/rtl8723bs/hal/rtl8723bs_xmit.c | 5 +- drivers/staging/rtl8723bs/hal/sdio_halinit.c | 17 +- drivers/staging/rtl8723bs/include/ieee80211.h | 2 - .../staging/rtl8723bs/include/osdep_service.h | 4 - .../staging/rtl8723bs/include/rtl8192c_recv.h | 8 - .../staging/rtl8723bs/include/rtw_ioctl_set.h | 3 - .../staging/rtl8723bs/include/rtw_mlme_ext.h | 2 +- .../staging/rtl8723bs/include/wlan_bssdef.h | 12 +- .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 136 +++-- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 17 +- drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 3 +- drivers/staging/rtl8723bs/os_dep/xmit_linux.c | 8 +- 42 files changed, 1384 insertions(+), 690 deletions(-)
Signature · 1 line
2.52.0
PATCH 1/5 staging: rtl8723bs: remove unused code for other Realtek chips
Remove unused definitions and function declarations that were left over from other Realtek chips:
- Remove rtl8192c_translate_rx_signal_stuff() and rtl8192c_query_rx_desc_status() function declarations from rtl8192c_recv.h. These functions are declared but never implemented or used in the 8723bs driver.
- Remove unused RECV_BLK_SZ, RECV_BLK_CNT, and RECV_BLK_TH defines from rtl8192c_recv.h. These are not referenced anywhere in the driver.
- Remove unused MAX_PATH_NUM_* definitions for other chips (92CS, 8188E, 8192E, 8812A, 8821A, 8814A, 8822B) from odm.h. Only MAX_PATH_NUM_8723B is actually used by the driver.
This addresses the first TODO item: find and remove any code for other chips that is left over.
--- drivers/staging/rtl8723bs/hal/odm.h | 7 ------- drivers/staging/rtl8723bs/include/rtl8192c_recv.h | 8 -------- 2 files changed, 15 deletions(-)
drivers/staging/rtl8723bs/hal/odm.h +0 -7
@@ -202,14 +202,7 @@ struct odm_rate_adaptive {/* */ /* Declare for common info */ /* */ -#define MAX_PATH_NUM_92CS 2 -#define MAX_PATH_NUM_8188E 1 -#define MAX_PATH_NUM_8192E 2#define MAX_PATH_NUM_8723B 1 -#define MAX_PATH_NUM_8812A 2 -#define MAX_PATH_NUM_8821A 1 -#define MAX_PATH_NUM_8814A 4 -#define MAX_PATH_NUM_8822B 2#define IQK_THRESHOLD 8#define DPK_THRESHOLD 4
drivers/staging/rtl8723bs/include/rtl8192c_recv.h +0 -8
@@ -7,10 +7,6 @@#ifndef _RTL8192C_RECV_H_#define _RTL8192C_RECV_H_ -#define RECV_BLK_SZ 512 -#define RECV_BLK_CNT 16 -#define RECV_BLK_TH RECV_BLK_CNT -#define MAX_RECVBUF_SZ (10240) struct phy_stat {
@@ -34,8 +30,4 @@ struct phy_stat {/* Rx smooth factor */ #define Rx_Smooth_Factor (20) - -void rtl8192c_translate_rx_signal_stuff (union recv_frame *precvframe,struct phy_stat *pphy_status); -void rtl8192c_query_rx_desc_status (union recv_frame *precvframe,struct recv_stat *pdesc); -#endif
Signature · 1 line
2.52.0
Greg Kroah-Hartman
maintainerRe: [PATCH v1 1/5] staging: rtl8723bs: remove unused code for other Realtek chips
Quoted 8 lines · Luka Gejak
Remove unused definitions and function declarations that were left over from other Realtek chips:
- Remove
rtl8192c_translate_rx_signal_stuff()andrtl8192c_query_rx_desc_status()function declarations fromrtl8192c_recv.h. These functions are declared but never implemented or used in the 8723bs driver.
Quoted 6 lines
- Remove unused
RECV_BLK_SZ,RECV_BLK_CNT, andRECV_BLK_THdefines fromrtl8192c_recv.h. These are not referenced anywhere in the driver.- Remove unused MAX_PATH_NUM_* definitions for other chips (92CS, 8188E, 8192E, 8812A, 8821A, 8814A, 8822B) from
odm.h. OnlyMAX_PATH_NUM_8723Bis actually used by the driver.
When you have to list the different things a patch does, that's a huge hint that the change needs to be broken up into smaller patches.
Remember, each change can only do "one logical thing".
thanks,
greg k-h
PATCH 2/5 staging: rtl8723bs: convert PSTA_INFO_T to struct sta_info *
In reply to Luka GejakReplace the vendor-specific PSTA_INFO_T typedef with the standard Linux kernel type 'struct sta_info *' throughout the driver.
Changes:
- Replace all usages of PSTA_INFO_T with struct sta_info * in odm.c, odm.h, and odm_HWConfig.c
- Remove the PSTA_INFO_T and STA_INFO_T macro definitions from odm_types.h as they are no longer needed
This addresses the second TODO item: convert any remaining unusual variable types.
--- drivers/staging/rtl8723bs/hal/odm.c | 10 +++++----- drivers/staging/rtl8723bs/hal/odm.h | 4 ++-- drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 2 +- drivers/staging/rtl8723bs/hal/odm_types.h | 3 --- 4 files changed, 8 insertions(+), 11 deletions(-)
drivers/staging/rtl8723bs/hal/odm.c +5 -5
@@ -141,7 +141,7 @@ static void odm_CommonInfoSelfUpdate(struct dm_odm_t *pDM_Odm) {u8 EntryCnt =0 ;u8 i; -PSTA_INFO_T pEntry; +struct sta_info *pEntry;if (*(pDM_Odm->pBandWidth) ==ODM_BW40M ) {if (*(pDM_Odm->pSecChOffset) ==1 )
@@ -194,7 +194,7 @@ u32 ODM_Get_Rate_Bitmap(u8 rssi_level ) { -PSTA_INFO_T pEntry; +struct sta_info *pEntry;u32 rate_bitmap =0 ;u8 WirelessMode;
@@ -264,7 +264,7 @@ static void odm_RefreshRateAdaptiveMaskCE(struct dm_odm_t *pDM_Odm)return ;for (i =0 ; i <ODM_ASSOCIATE_ENTRY_NUM ; i++) { -PSTA_INFO_T pstat = pDM_Odm->pODM_StaInfo[i]; +struct sta_info *pstat = pDM_Odm->pODM_StaInfo[i];if (IS_STA_VALID (pstat)) {if (is_multicast_ether_addr (pstat->hwaddr))/* if (psta->mac_id == 1) */
@@ -841,7 +841,7 @@ void ODM_CmnInfoHook(struct dm_odm_t *pDM_Odm, enum odm_cmninfo_e CmnInfo, void/* pDM_Odm->BTCoexist = (bool *)pValue; */ /* case ODM_CMNINFO_STA_STATUS: */ -/* pDM_Odm->pODM_StaInfo[] = (PSTA_INFO_T)pValue; */ +/* pDM_Odm->pODM_StaInfo[] = (struct sta_info *)pValue; */ /* break; */ /* case ODM_CMNINFO_PHY_STATUS: */
@@ -875,7 +875,7 @@ void ODM_CmnInfoPtrArrayHook(/* Dynamic call by reference pointer. */ /* */ case ODM_CMNINFO_STA_STATUS : - pDM_Odm->pODM_StaInfo[Index] = (PSTA_INFO_T )pValue; + pDM_Odm->pODM_StaInfo[Index] = (struct sta_info *)pValue;break ;/* To remove the compiler warning, must add an empty default statement to handle the other values. */ default :
drivers/staging/rtl8723bs/hal/odm.h +2 -2
@@ -853,7 +853,7 @@ struct dm_odm_t { /* DM_Out_Source_Dynamic_Mechanism_Structure *//* 2 Define STA info. */ /* _ODM_STA_INFO */ /* 2012/01/12 MH For MP, we need to reduce one array pointer for default port.?? */ -PSTA_INFO_T pODM_StaInfo[ODM_ASSOCIATE_ENTRY_NUM ]; +struct sta_info *pODM_StaInfo[ODM_ASSOCIATE_ENTRY_NUM ];/* */ /* 2012/02/14 MH Add to share 88E ra with other SW team. */
@@ -910,7 +910,7 @@ struct dm_odm_t { /* DM_Out_Source_Dynamic_Mechanism_Structure *//* u8 binitialized; for dm_initial_gain_Multi_STA use. */ /* for Antenna diversity */ /* u8 AntDivCfg; 0:OFF , 1:ON, 2:by efuse */ -/* PSTA_INFO_T RSSI_target; */ +/* struct sta_info *RSSI_target; */ bool *pbDriverStopped;bool *pbDriverIsGoingToPnpSetPowerSleep;
drivers/staging/rtl8723bs/hal/odm_HWConfig.c +1 -1
@@ -256,7 +256,7 @@ static void odm_Process_RSSIForDM(u8 RSSI_max, RSSI_min, i;u32 OFDM_pkt =0 ;u32 Weighting =0 ; -PSTA_INFO_T pEntry; +struct sta_info *pEntry;if (pPktinfo->station_id ==0xFF )
drivers/staging/rtl8723bs/hal/odm_types.h +0 -3
@@ -33,9 +33,6 @@ enum hal_status {#define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG#endif -#define STA_INFO_T struct sta_info -#define PSTA_INFO_T struct sta_info * -#define SET_TX_DESC_ANTSEL_A_88E (__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+8, 24, 1, __Value)#define SET_TX_DESC_ANTSEL_B_88E (__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+8, 25, 1, __Value)#define SET_TX_DESC_ANTSEL_C_88E (__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+28, 29, 1, __Value)
Signature · 1 line
2.52.0
PATCH 3/5 staging: rtl8723bs: remove NDIS type aliases
In reply to Luka GejakRemove Windows NDIS-style type aliases and replace with standard Linux kernel types:
- Remove NDIS_802_11_MAC_ADDRESS typedef, use u8[ETH_ALEN] directly
- Remove NDIS_802_11_RATES typedef (unused)
- Remove NDIS_802_11_RATES_EX typedef, use u8[NDIS_802_11_LENGTH_RATES_EX]
- Remove NDIS_802_11_PMKID_VALUE typedef (unused)
- Update struct wlan_bssid_ex and struct FW_Sta_Info members
- Replace sizeof(NDIS_802_11_MAC_ADDRESS) with ETH_ALEN
This makes the code more readable and follows Linux kernel coding style by using explicit types instead of Windows-style typedefs.
--- drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 2 +- drivers/staging/rtl8723bs/include/rtw_ioctl_set.h | 3 --- drivers/staging/rtl8723bs/include/rtw_mlme_ext.h | 2 +- drivers/staging/rtl8723bs/include/wlan_bssdef.h | 12 ++++-------- drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 4 ++-- 5 files changed, 8 insertions(+), 15 deletions(-)
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c +1 -1
@@ -492,7 +492,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)u32 rtw_init_bcmc_stainfo (struct adapter *padapter) {struct sta_info *psta; -NDIS_802_11_MAC_ADDRESS bcast_addr = {0xff ,0xff ,0xff ,0xff ,0xff ,0xff }; +u8 bcast_addr[ETH_ALEN ] = {0xff ,0xff ,0xff ,0xff ,0xff ,0xff };struct sta_priv *pstapriv = &padapter->stapriv;/* struct __queue *pstapending = &padapter->xmitpriv.bm_pending; */
drivers/staging/rtl8723bs/include/rtw_ioctl_set.h +0 -3
@@ -7,9 +7,6 @@#ifndef __RTW_IOCTL_SET_H_#define __RTW_IOCTL_SET_H_ - -typedef u8 NDIS_802_11_PMKID_VALUE [16 ]; -u8 rtw_set_802_11_authentication_mode (struct adapter *pdapter,enum ndis_802_11_authentication_mode authmode);u8 rtw_set_802_11_add_wep (struct adapter *padapter,struct ndis_802_11_wep *wep);u8 rtw_set_802_11_disassociate (struct adapter *padapter);
drivers/staging/rtl8723bs/include/rtw_mlme_ext.h +1 -1
@@ -253,7 +253,7 @@ struct FW_Sta_Info {u32 status;u32 rx_pkt;u32 retry; -NDIS_802_11_RATES_EX SupportedRates; +u8 SupportedRates[NDIS_802_11_LENGTH_RATES_EX ]; };/*
drivers/staging/rtl8723bs/include/wlan_bssdef.h +4 -8
@@ -15,10 +15,6 @@#define NDIS_802_11_LENGTH_RATES 8#define NDIS_802_11_LENGTH_RATES_EX 16 -typedef unsigned char NDIS_802_11_MAC_ADDRESS [6 ]; -typedef unsigned char NDIS_802_11_RATES [NDIS_802_11_LENGTH_RATES ];/* Set of 8 data rates */ -typedef unsigned char NDIS_802_11_RATES_EX [NDIS_802_11_LENGTH_RATES_EX ];/* Set of 16 data rates */ -struct ndis_802_11_ssid {u32 ssid_length;u8 ssid[32 ];
@@ -64,10 +60,10 @@ struct ndis_80211_var_ie { };/* Length is the 4 bytes multiples of the sum of -* sizeof (NDIS_802_11_MAC_ADDRESS) + 2 + +* 6 (mac_address) + 2 + * sizeof (struct ndis_802_11_ssid) + sizeof (u32) + * sizeof (long) + sizeof (enum ndis_802_11_network_type) + -* sizeof (struct ndis_802_11_conf) + sizeof (NDIS_802_11_RATES_EX) + ie_length +* sizeof (struct ndis_802_11_conf) + 16 (supported_rates) + ie_length * * Except for ie_length, all other fields are fixed length. Therefore, we can * define a macro to present the partial sum.
@@ -155,7 +151,7 @@ struct wlan_bcn_info {*/ struct wlan_bssid_ex {u32 length; -NDIS_802_11_MAC_ADDRESS mac_address; +u8 mac_address[ETH_ALEN ];u8 reserved[2 ];/* 0]: IS beacon frame */ struct ndis_802_11_ssid ssid;u32 privacy;
@@ -163,7 +159,7 @@ struct wlan_bssid_ex {enum ndis_802_11_network_type network_type_in_use;struct ndis_802_11_conf configuration;enum ndis_802_11_network_infrastructure infrastructure_mode; -NDIS_802_11_RATES_EX supported_rates; +u8 supported_rates[NDIS_802_11_LENGTH_RATES_EX ];struct wlan_phy_info phy_info;u32 ie_length;u8 ies[MAX_IE_SZ ];/* timestamp, beacon interval, and capability information) */
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +2 -2
@@ -378,7 +378,7 @@ void rtw_cfg80211_ibss_indicate_connect(struct adapter *padapter)return ; }if (!memcmp (&(scanned->network.ssid), &(pnetwork->ssid),sizeof (struct ndis_802_11_ssid )) - && !memcmp (scanned->network.mac_address, pnetwork->mac_address,sizeof (NDIS_802_11_MAC_ADDRESS )) + && !memcmp (scanned->network.mac_address, pnetwork->mac_address,ETH_ALEN ) )rtw_cfg80211_inform_bss (padapter, scanned);else
@@ -419,7 +419,7 @@ void rtw_cfg80211_indicate_connect(struct adapter *padapter) goto check_bss; } -if (!memcmp (scanned->network.mac_address, pnetwork->mac_address,sizeof (NDIS_802_11_MAC_ADDRESS )) +if (!memcmp (scanned->network.mac_address, pnetwork->mac_address,ETH_ALEN ) && !memcmp (&(scanned->network.ssid), &(pnetwork->ssid),sizeof (struct ndis_802_11_ssid )) )rtw_cfg80211_inform_bss (padapter, scanned);
Signature · 1 line
2.52.0
PATCH 4/5 staging: rtl8723bs: remove redundant MAC_ARG macro
In reply to Luka GejakThe driver already uses the kernel's %pM format specifier for printing MAC addresses. The MAC_ARG() macro was a no-op that simply returned its argument, making it redundant when used with %pM.
Remove the MAC_ARG() macro definitions from ieee80211.h and osdep_service.h, and update all call sites to pass the MAC address pointer directly to %pM.
Also remove the unused IP_ARG() macro.
This addresses TODO item: find codes that can use %pM formatting.
--- drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 +- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 8 ++++---- drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 2 +- drivers/staging/rtl8723bs/include/ieee80211.h | 2 -- drivers/staging/rtl8723bs/include/osdep_service.h | 4 ---- 5 files changed, 6 insertions(+), 12 deletions(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +1 -1
@@ -930,7 +930,7 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 enqueuwhile ((cam_id =rtw_camid_search (padapter, sta->hwaddr,-1 )) >=0 ) {netdev_dbg (padapter->pnetdev,"clear key for addr:%pM, camid:%d\n" , -MAC_ARG (sta->hwaddr), cam_id); + sta->hwaddr, cam_id);clear_cam_entry (padapter, cam_id);rtw_camid_free (padapter, cam_id); }
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +4 -4
@@ -5595,7 +5595,7 @@ u8 setkey_hdl(struct adapter *padapter, u8 *pbuf)write_cam (padapter, cam_id, ctrl, addr, pparm->key);netdev_dbg (padapter->pnetdev,"set group key camid:%d, addr:%pM, kid:%d, type:%s\n" , - cam_id,MAC_ARG (addr), pparm->keyid, + cam_id, addr, pparm->keyid,security_type_str (pparm->algorithm)); }
@@ -5625,7 +5625,7 @@ u8 set_stakey_hdl(struct adapter *padapter, u8 *pbuf) psta =rtw_get_stainfo (pstapriv, pparm->addr);if (!psta) {netdev_dbg (padapter->pnetdev,"%s sta:%pM not found\n" , - __func__,MAC_ARG (pparm->addr)); + __func__, pparm->addr); ret =H2C_REJECTED ; goto exit; }
@@ -5640,14 +5640,14 @@ u8 set_stakey_hdl(struct adapter *padapter, u8 *pbuf)while ((cam_id =rtw_camid_search (padapter, pparm->addr,-1 )) >=0 ) {netdev_dbg (padapter->pnetdev,"clear key for addr:%pM, camid:%d\n" , -MAC_ARG (pparm->addr), cam_id); + pparm->addr, cam_id);clear_cam_entry (padapter, cam_id);rtw_camid_free (padapter, cam_id); } }else {netdev_dbg (padapter->pnetdev,"set pairwise key camid:%d, addr:%pM, kid:%d, type:%s\n" , - cam_id,MAC_ARG (pparm->addr), pparm->keyid, + cam_id, pparm->addr, pparm->keyid,security_type_str (pparm->algorithm)); ctrl =BIT (15 ) | ((pparm->algorithm) <<2 ) | pparm->keyid;write_cam (padapter, cam_id, ctrl, pparm->addr, pparm->key);
drivers/staging/rtl8723bs/core/rtw_wlan_util.c +1 -1
@@ -617,7 +617,7 @@ s16 rtw_camid_alloc(struct adapter *adapter, struct sta_info *sta, u8 kid)netdev_dbg (adapter->pnetdev,FUNC_ADPT_FMT " pairwise key with %pM id:%u no room\n" ,FUNC_ADPT_ARG (adapter), -MAC_ARG (sta->hwaddr), kid); + sta->hwaddr, kid); else netdev_dbg(adapter->pnetdev, FUNC_ADPT_FMT " group key id:%u no room\n",
drivers/staging/rtl8723bs/include/ieee80211.h +0 -2
@@ -506,8 +506,6 @@ Total: 28-2340 bytes#define DEFAULT_MAX_SCAN_AGE (15 * HZ)#define DEFAULT_FTS 2346 -#define MAC_ARG (x) (x) -#define IP_ARG (x) (x)static inline int is_multicast_mac_addr (const u8 *addr) {
drivers/staging/rtl8723bs/include/osdep_service.h +0 -4
@@ -91,10 +91,6 @@ static inline int rtw_bug_check(void *parg1, void *parg2, void *parg3, void *par#define _RND (sz, r) ((((sz)+((r)-1))/(r))*(r)) -#ifndef MAC_ARG -#define MAC_ARG (x) (x) -#endif -extern void rtw_free_netdev (struct net_device *netdev);/* Macros for handling unaligned memory accesses */
Signature · 1 line
2.52.0
PATCH 5/5 staging: rtl8723bs: fix LONG_LINE warnings across C files
In reply to Luka GejakRefactor lines exceeding 100 characters to comply with kernel coding style. All changes preserve original logic and behavior.
Techniques used:
- Move trailing comments to separate lines above code
- Break long function signatures across multiple lines
- Extract complex expressions into named temp variables
- Use scoped blocks for local variable declarations
- Create pointer aliases for deeply nested struct accesses
- Simplify compound conditionals with intermediate booleans
Files modified:
- core/: rtw_cmd.c, rtw_ieee80211.c, rtw_io.c, rtw_ioctl_set.c, rtw_mlme.c, rtw_mlme_ext.c, rtw_pwrctrl.c, rtw_recv.c, rtw_security.c, rtw_wlan_util.c, rtw_xmit.c
- hal/: HalBtc8723b1Ant.c, HalBtc8723b2Ant.c, HalPhyRf.c,
HalPhyRf_8723B.c, hal_com.c, hal_com_phycfg.c, hal_intf.c,
hal_sdio.c, odm.c, odm_DIG.c, odm_HWConfig.c, rtl8723b_cmd.c,
rtl8723b_hal_init.c, rtl8723b_phycfg.c, rtl8723b_rf6052.c,
rtl8723bs_recv.c, rtl8723bs_xmit.c, sdio_halinit.c- os_dep/: ioctl_cfg80211.c, os_intfs.c, sdio_intf.c, xmit_linux.c
--- drivers/staging/rtl8723bs/core/rtw_cmd.c | 142 ++--- .../staging/rtl8723bs/core/rtw_ieee80211.c | 36 +- drivers/staging/rtl8723bs/core/rtw_io.c | 4 +- .../staging/rtl8723bs/core/rtw_ioctl_set.c | 16 +- drivers/staging/rtl8723bs/core/rtw_mlme.c | 103 ++-- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 492 ++++++++++++------ drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 3 +- drivers/staging/rtl8723bs/core/rtw_recv.c | 123 +++-- drivers/staging/rtl8723bs/core/rtw_security.c | 11 +- .../staging/rtl8723bs/core/rtw_wlan_util.c | 215 +++++--- drivers/staging/rtl8723bs/core/rtw_xmit.c | 62 ++- .../staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 35 +- .../staging/rtl8723bs/hal/HalBtc8723b2Ant.c | 29 +- drivers/staging/rtl8723bs/hal/HalPhyRf.c | 36 +- .../staging/rtl8723bs/hal/HalPhyRf_8723B.c | 166 ++++-- drivers/staging/rtl8723bs/hal/hal_com.c | 10 +- .../staging/rtl8723bs/hal/hal_com_phycfg.c | 22 +- drivers/staging/rtl8723bs/hal/hal_intf.c | 4 +- drivers/staging/rtl8723bs/hal/hal_sdio.c | 4 +- drivers/staging/rtl8723bs/hal/odm.c | 18 +- drivers/staging/rtl8723bs/hal/odm_DIG.c | 38 +- drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 17 +- drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 103 +++- .../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 64 ++- .../staging/rtl8723bs/hal/rtl8723b_phycfg.c | 54 +- .../staging/rtl8723bs/hal/rtl8723b_rf6052.c | 6 +- .../staging/rtl8723bs/hal/rtl8723bs_recv.c | 6 +- .../staging/rtl8723bs/hal/rtl8723bs_xmit.c | 5 +- drivers/staging/rtl8723bs/hal/sdio_halinit.c | 17 +- .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 134 +++-- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 17 +- drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 3 +- drivers/staging/rtl8723bs/os_dep/xmit_linux.c | 8 +- 33 files changed, 1364 insertions(+), 639 deletions(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +78 -64
@@ -171,20 +171,18 @@ int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) pcmdpriv->cmd_seq =1 ; pcmdpriv->cmd_allocated_buf =rtw_zmalloc (MAX_CMDSZ +CMDBUFF_ALIGN_SZ ); -if (!pcmdpriv->cmd_allocated_buf)return -ENOMEM ; - pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf +CMDBUFF_ALIGN_SZ - ((SIZE_PTR )(pcmdpriv->cmd_allocated_buf) & (CMDBUFF_ALIGN_SZ -1 )); + pcmdpriv->cmd_buf =PTR_ALIGN (pcmdpriv->cmd_allocated_buf,CMDBUFF_ALIGN_SZ ); pcmdpriv->rsp_allocated_buf =rtw_zmalloc (MAX_RSPSZ +4 ); -if (!pcmdpriv->rsp_allocated_buf) {kfree (pcmdpriv->cmd_allocated_buf);return -ENOMEM ; } - pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf +4 - ((SIZE_PTR )(pcmdpriv->rsp_allocated_buf) &3 ); + pcmdpriv->rsp_buf =PTR_ALIGN (pcmdpriv->rsp_allocated_buf,4 ); pcmdpriv->cmd_issued_cnt =0 ; pcmdpriv->cmd_done_cnt =0 ;
@@ -393,7 +391,7 @@ int rtw_cmd_thread(void *context)while (1 ) {if (wait_for_completion_interruptible (&pcmdpriv->cmd_queue_comp)) {netdev_dbg (padapter->pnetdev, -FUNC_ADPT_FMT " wait_for_completion_interruptible(&pcmdpriv->cmd_queue_comp) return != 0, break\n" , +FUNC_ADPT_FMT " cmd_queue_comp interrupted\n" ,FUNC_ADPT_ARG (padapter));break ; }
@@ -727,31 +725,33 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)memcpy (&psecuritypriv->authenticator_ie[1 ], &psecnetwork->ies[12 ], (256 -1 )); psecnetwork->ie_length =0 ; -/* Added by Albert 2009/02/18 */ -/* If the driver wants to use the bssid to create the connection. */ -/* If not, we have to copy the connecting AP's MAC address to it so that */ -/* the driver just has the bssid information for PMKIDList searching. */ +/* If not using bssid, copy connecting AP's MAC for PMKIDList searching. */ if (!pmlmepriv->assoc_by_bssid) -memcpy (&pmlmepriv->assoc_bssid[0 ], &pnetwork->network.mac_address[0 ],ETH_ALEN ); - - psecnetwork->ie_length =rtw_restruct_sec_ie (padapter, &pnetwork->network.ies[0 ], &psecnetwork->ies[0 ], pnetwork->network.ie_length); +memcpy (pmlmepriv->assoc_bssid, pnetwork->network.mac_address,ETH_ALEN ); - pqospriv->qos_option =0 ; - -if (pregistrypriv->wmm_enable) { - tmp_len =rtw_restruct_wmm_ie (padapter, &pnetwork->network.ies[0 ], &psecnetwork->ies[0 ], pnetwork->network.ie_length, psecnetwork->ie_length); - -if (psecnetwork->ie_length != tmp_len) { - psecnetwork->ie_length = tmp_len; - pqospriv->qos_option =1 ;/* There is WMM IE in this corresp. beacon */ - }else { - pqospriv->qos_option =0 ;/* There is no WMM IE in this corresp. beacon */ + { +u8 *src_ie = pnetwork->network.ies; +u8 *dst_ie = psecnetwork->ies; +int src_len = pnetwork->network.ie_length; + + psecnetwork->ie_length =rtw_restruct_sec_ie (padapter, src_ie, + dst_ie, src_len); + + pqospriv->qos_option =0 ; +if (pregistrypriv->wmm_enable) { + tmp_len =rtw_restruct_wmm_ie (padapter, src_ie, dst_ie, + src_len, psecnetwork->ie_length); +if (psecnetwork->ie_length != tmp_len) { + psecnetwork->ie_length = tmp_len; + pqospriv->qos_option =1 ; + } } - } - phtpriv->ht_option = false; - ptmp =rtw_get_ie (&pnetwork->network.ies[12 ],WLAN_EID_HT_CAPABILITY , &tmp_len, pnetwork->network.ie_length-12 ); + phtpriv->ht_option = false; + ptmp =rtw_get_ie (&src_ie[12 ],WLAN_EID_HT_CAPABILITY , + &tmp_len, src_len -12 ); + }if (pregistrypriv->ht_enable && ptmp && tmp_len >0 ) {/* Added by Albert 2010/06/23 */ /* For the WEP mode, we will use the bg mode to do the connection to avoid some IOT issue. */
@@ -788,7 +788,8 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)return res; } -u8 rtw_disassoc_cmd (struct adapter *padapter,u32 deauth_timeout_ms,bool enqueue)/* for sta_mode */ +/* for sta_mode */ +u8 rtw_disassoc_cmd (struct adapter *padapter,u32 deauth_timeout_ms,bool enqueue) {struct cmd_obj *cmdobj =NULL ;struct disconnect_parm *param =NULL ;
@@ -824,10 +825,12 @@ u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueureturn res; } -u8 rtw_setopmode_cmd (struct adapter *padapter,enum ndis_802_11_network_infrastructure networktype,bool enqueue) +u8 rtw_setopmode_cmd (struct adapter *padapter, +enum ndis_802_11_network_infrastructure networktype, +bool enqueue) { -struct cmd_obj *ph2c; -struct setopmode_parm *psetop; +struct cmd_obj *ph2c; +struct setopmode_parm *psetop;struct cmd_priv *pcmdpriv = &padapter->cmdpriv;u8 res = _SUCCESS;
@@ -881,10 +884,14 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 unicast_else GET_ENCRY_ALGO (psecuritypriv, sta, psetstakey_para->algorithm, false); -if (unicast_key) +if (unicast_key) {memcpy (&psetstakey_para->key, &sta->dot118021x_UncstKey,16 ); -else -memcpy (&psetstakey_para->key, &psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey,16 ); + }else { +u8 keyid = psecuritypriv->dot118021XGrpKeyid; +u8 *grpkey = psecuritypriv->dot118021XGrpKey[keyid].skey; + +memcpy (&psetstakey_para->key, grpkey,16 ); + }/* jeff: set this because at least sw key is ready */ padapter->securitypriv.busetkipkey = true;
@@ -1105,22 +1112,23 @@ u8 rtw_dynamic_chk_wk_cmd(struct adapter *padapter)static void collect_traffic_statistics (struct adapter *padapter) {struct dvobj_priv *pdvobjpriv =adapter_to_dvobj (padapter); +struct rtw_traffic_statistics *stats = &pdvobjpriv->traffic_stat; -/* Tx */ - pdvobjpriv->traffic_stat.tx_bytes = padapter->xmitpriv.tx_bytes; - pdvobjpriv->traffic_stat.tx_pkts = padapter->xmitpriv.tx_pkts; - pdvobjpriv->traffic_stat.tx_drop = padapter->xmitpriv.tx_drop; +/* Tx */ + stats->tx_bytes = padapter->xmitpriv.tx_bytes; + stats->tx_pkts = padapter->xmitpriv.tx_pkts; + stats->tx_drop = padapter->xmitpriv.tx_drop; -/* Rx */ - pdvobjpriv->traffic_stat.rx_bytes = padapter->recvpriv.rx_bytes; - pdvobjpriv->traffic_stat.rx_pkts = padapter->recvpriv.rx_pkts; - pdvobjpriv->traffic_stat.rx_drop = padapter->recvpriv.rx_drop; +/* Rx */ + stats->rx_bytes = padapter->recvpriv.rx_bytes; + stats->rx_pkts = padapter->recvpriv.rx_pkts; + stats->rx_drop = padapter->recvpriv.rx_drop; -/* Calculate throughput in last interval */ - pdvobjpriv->traffic_stat.cur_tx_bytes = pdvobjpriv->traffic_stat.tx_bytes - pdvobjpriv->traffic_stat.last_tx_bytes; - pdvobjpriv->traffic_stat.cur_rx_bytes = pdvobjpriv->traffic_stat.rx_bytes - pdvobjpriv->traffic_stat.last_rx_bytes; - pdvobjpriv->traffic_stat.last_tx_bytes = pdvobjpriv->traffic_stat.tx_bytes; - pdvobjpriv->traffic_stat.last_rx_bytes = pdvobjpriv->traffic_stat.rx_bytes; +/* Calculate throughput in last interval */ + stats->cur_tx_bytes = stats->tx_bytes - stats->last_tx_bytes; + stats->cur_rx_bytes = stats->rx_bytes - stats->last_rx_bytes; + stats->last_tx_bytes = stats->tx_bytes; + stats->last_rx_bytes = stats->rx_bytes; pdvobjpriv->traffic_stat.cur_tx_tp = (u32)(pdvobjpriv->traffic_stat.cur_tx_bytes *8 /2 /1024 /1024 ); pdvobjpriv->traffic_stat.cur_rx_tp = (u32)(pdvobjpriv->traffic_stat.cur_rx_bytes *8 /2 /1024 /1024 );
@@ -1168,28 +1176,33 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer) bHigherBusyTxTraffic = true; } -/* check traffic for powersaving. */ -if (((pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod + pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) >8 ) || - (pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod >2 )) { - bEnterPS = false; +/* check traffic for powersaving */ + { +struct rt_link_detect_t *ldi = &pmlmepriv->LinkDetectInfo; +u32 total_ok = ldi->NumRxUnicastOkInPeriod + ldi->NumTxOkInPeriod; +bool has_traffic = (total_ok >8 ) || (ldi->NumRxUnicastOkInPeriod >2 ); -if (bBusyTraffic) { -if (pmlmepriv->LinkDetectInfo.TrafficTransitionCount <=4 ) - pmlmepriv->LinkDetectInfo.TrafficTransitionCount =4 ; +if (has_traffic) { + bEnterPS = false; - pmlmepriv->LinkDetectInfo.TrafficTransitionCount++; +if (bBusyTraffic) { +if (ldi->TrafficTransitionCount <=4 ) + ldi->TrafficTransitionCount =4 ; -if (pmlmepriv->LinkDetectInfo.TrafficTransitionCount >30 /*TrafficTransitionLevel*/ ) - pmlmepriv->LinkDetectInfo.TrafficTransitionCount =30 ; - } - }else { -if (pmlmepriv->LinkDetectInfo.TrafficTransitionCount >=2 ) - pmlmepriv->LinkDetectInfo.TrafficTransitionCount -=2 ; -else - pmlmepriv->LinkDetectInfo.TrafficTransitionCount =0 ; + ldi->TrafficTransitionCount++; -if (pmlmepriv->LinkDetectInfo.TrafficTransitionCount ==0 ) - bEnterPS = true; +if (ldi->TrafficTransitionCount >30 ) + ldi->TrafficTransitionCount =30 ; + } + }else { +if (ldi->TrafficTransitionCount >=2 ) + ldi->TrafficTransitionCount -=2 ; +else + ldi->TrafficTransitionCount =0 ; + +if (ldi->TrafficTransitionCount ==0 ) + bEnterPS = true; + } }/* LeisurePS only work in infra mode. */
@@ -1739,7 +1752,8 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf) pdrvextra_cmd = (struct drvextra_cmd_parm *)pbuf;switch (pdrvextra_cmd->ec_id) { -case DYNAMIC_CHK_WK_CID :/* only primary padapter go to this cmd, but execute dynamic_chk_wk_hdl() for two interfaces */ +/* only primary padapter goes to this cmd, but execute for two interfaces */ +case DYNAMIC_CHK_WK_CID :dynamic_chk_wk_hdl (padapter);break ;case POWER_SAVING_CTRL_WK_CID :
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +27 -9
@@ -333,11 +333,17 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv) ie =rtw_set_ie (ie,WLAN_EID_DS_PARAMS ,1 , (u8 *)&(pdev_network->configuration.ds_config), &sz);/* IBSS Parameter Set */ + { +u8 *atim = (u8 *)&pdev_network->configuration.atim_window; - ie =rtw_set_ie (ie,WLAN_EID_IBSS_PARAMS ,2 , (u8 *)&(pdev_network->configuration.atim_window), &sz); + ie =rtw_set_ie (ie,WLAN_EID_IBSS_PARAMS ,2 , atim, &sz); + } + +if (rateLen >8 ) { +u8 *ext_rates = pdev_network->supported_rates +8 ; -if (rateLen >8 ) - ie =rtw_set_ie (ie,WLAN_EID_EXT_SUPP_RATES , (rateLen -8 ), (pdev_network->supported_rates +8 ), &sz); + ie =rtw_set_ie (ie,WLAN_EID_EXT_SUPP_RATES , rateLen -8 , ext_rates, &sz); + }/* HT Cap. */ if ((pregistrypriv->wireless_mode & WIRELESS_11_24N) &&
@@ -437,7 +443,8 @@ int rtw_get_wpa2_cipher_suite(u8 *s)return 0 ; } -int rtw_parse_wpa_ie (u8 *wpa_ie,int wpa_ie_len,int *group_cipher,int *pairwise_cipher,int *is_8021x) +int rtw_parse_wpa_ie (u8 *wpa_ie,int wpa_ie_len,int *group_cipher, +int *pairwise_cipher,int *is_8021x) {int i, ret = _SUCCESS;int left, count;
@@ -500,7 +507,8 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwisreturn ret; } -int rtw_parse_wpa2_ie (u8 *rsn_ie,int rsn_ie_len,int *group_cipher,int *pairwise_cipher,int *is_8021x) +int rtw_parse_wpa2_ie (u8 *rsn_ie,int rsn_ie_len,int *group_cipher, +int *pairwise_cipher,int *is_8021x) {int i, ret = _SUCCESS;int left, count;
@@ -738,7 +746,8 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id, u8 *buf_att* * Returns: the address of the specific WPS attribute content found, or NULL */ -u8 *rtw_get_wps_attr_content (u8 *wps_ie,uint wps_ielen,u16 target_attr_id,u8 *buf_content,uint *len_content) +u8 *rtw_get_wps_attr_content (u8 *wps_ie,uint wps_ielen,u16 target_attr_id, +u8 *buf_content,uint *len_content) {u8 *attr_ptr;u32 attr_len;
@@ -1019,7 +1028,11 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork) pbuf =rtw_get_wpa2_ie (&pnetwork->network.ies[12 ], &wpa_ielen, pnetwork->network.ie_length-12 );if (pbuf && (wpa_ielen >0 )) { -if (_SUCCESS ==rtw_parse_wpa2_ie (pbuf, wpa_ielen+2 , &group_cipher, &pairwise_cipher, &is8021x)) { +int ret2 =rtw_parse_wpa2_ie (pbuf, wpa_ielen +2 , + &group_cipher, + &pairwise_cipher, + &is8021x); +if (ret2 == _SUCCESS) { pnetwork->bcn_info.pairwise_cipher = pairwise_cipher; pnetwork->bcn_info.group_cipher = group_cipher; pnetwork->bcn_info.is_8021x = is8021x;
@@ -1065,7 +1078,11 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)/* get bwmode and ch_offset */ /* parsing HT_CAP_IE */ - p =rtw_get_ie (pnetwork->network.ies + _FIXED_IE_LENGTH_,WLAN_EID_HT_CAPABILITY , &len, pnetwork->network.ie_length - _FIXED_IE_LENGTH_); + { +u8 *ies_start = pnetwork->network.ies + _FIXED_IE_LENGTH_; +uint ies_len = pnetwork->network.ie_length - _FIXED_IE_LENGTH_; + + p =rtw_get_ie (ies_start,WLAN_EID_HT_CAPABILITY , &len, ies_len);if (p && len >0 ) { pht_cap = (struct ieee80211_ht_cap *)(p +2 ); pnetwork->bcn_info.ht_cap_info =le16_to_cpu (pht_cap->cap_info);
@@ -1073,7 +1090,8 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork) pnetwork->bcn_info.ht_cap_info =0 ; }/* parsing HT_INFO_IE */ - p =rtw_get_ie (pnetwork->network.ies + _FIXED_IE_LENGTH_,WLAN_EID_HT_OPERATION , &len, pnetwork->network.ie_length - _FIXED_IE_LENGTH_); + p =rtw_get_ie (ies_start,WLAN_EID_HT_OPERATION , &len, ies_len); + }if (p && len >0 ) { pht_info = (struct HT_info_element *)(p +2 ); pnetwork->bcn_info.ht_info_infos_0 = pht_info->infos[0 ];
drivers/staging/rtl8723bs/core/rtw_io.c +3 -1
@@ -115,7 +115,9 @@ u32 rtw_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)return _write_port (pintfhdl, addr, cnt, pmem); } -int rtw_init_io_priv (struct adapter *padapter,void (*set_intf_ops)(struct adapter *padapter,struct _io_ops *pops)) +int rtw_init_io_priv (struct adapter *padapter, +void (*set_intf_ops)(struct adapter *padapter, +struct _io_ops *pops)) {struct io_priv *piopriv = &padapter->iopriv;struct intf_hdl *pintf = &piopriv->intf;
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c +12 -4
@@ -174,7 +174,11 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)set_fwstate (pmlmepriv,WIFI_ADHOC_STATE ); } }else { - goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */ +/* +* already in WIFI_ADHOC_MASTER_STATE, +* no need to create bss again +*/ + goto release_mlme_lock; } }else {rtw_lps_ctrl_wk_cmd (padapter,LPS_CTRL_JOINBSS ,1 );
@@ -309,8 +313,9 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,rtw_free_assoc_resources (padapter,1 );if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) { +/* clr Linked_state; issue dis-assoc_cmd already checked above */ if (check_fwstate (pmlmepriv, _FW_LINKED) == true) -rtw_indicate_disconnect (padapter);/* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */ +rtw_indicate_disconnect (padapter); } *pold_state = networktype;
@@ -365,7 +370,9 @@ u8 rtw_set_802_11_disassociate(struct adapter *padapter)return true; } -u8 rtw_set_802_11_bssid_list_scan (struct adapter *padapter,struct ndis_802_11_ssid *pssid,int ssid_max_num) +u8 rtw_set_802_11_bssid_list_scan (struct adapter *padapter, +struct ndis_802_11_ssid *pssid, +int ssid_max_num) {struct mlme_priv *pmlmepriv = &padapter->mlmepriv;u8 res = true;
@@ -399,7 +406,8 @@ u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_sreturn res; } -u8 rtw_set_802_11_authentication_mode (struct adapter *padapter,enum ndis_802_11_authentication_mode authmode) +u8 rtw_set_802_11_authentication_mode (struct adapter *padapter, +enum ndis_802_11_authentication_mode authmode) {struct security_priv *psecuritypriv = &padapter->securitypriv;int res;
drivers/staging/rtl8723bs/core/rtw_mlme.c +67 -36
230 lines not on this page · raw message
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +340 -152
873 lines not on this page · raw message
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +2 -1
@@ -335,7 +335,8 @@ static u8 PS_RDY_CHECK(struct adapter *padapter)return true; } -void rtw_set_ps_mode (struct adapter *padapter,u8 ps_mode,u8 smart_ps,u8 bcn_ant_mode,const char *msg) +void rtw_set_ps_mode (struct adapter *padapter,u8 ps_mode,u8 smart_ps, +u8 bcn_ant_mode,const char *msg) {struct pwrctrl_priv *pwrpriv =adapter_to_pwrctl (padapter);
drivers/staging/rtl8723bs/core/rtw_recv.c +82 -41
233 lines not on this page · raw message
drivers/staging/rtl8723bs/core/rtw_security.c +8 -3
@@ -60,9 +60,12 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe) keylength = psecuritypriv->dot11DefKeylen[psecuritypriv->dot11PrivacyKeyIndex];for (curfragnum =0 ; curfragnum < pattrib->nr_frags; curfragnum++) { +u8 keyidx = psecuritypriv->dot11PrivacyKeyIndex; +u8 *defkey = psecuritypriv->dot11DefKey[keyidx].skey; + iv = pframe + pattrib->hdrlen;memcpy (&wepkey[0 ], iv,3 ); -memcpy (&wepkey[3 ], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0 ], keylength); +memcpy (&wepkey[3 ], defkey, keylength); payload = pframe + pattrib->iv_len + pattrib->hdrlen;if ((curfragnum +1 ) == pattrib->nr_frags) {/* the last fragment */
@@ -1063,7 +1066,8 @@ static signed int aes_decipher(u8 *key, uint hdrlen,if (hdrlen !=WLAN_HDR_A3_QOS_LEN ) hdrlen +=2 ; - } else if ((frtype == WIFI_DATA) && /* only for data packet . add for CONFIG_IEEE80211W, none 11w also can use */ +/* only for data packet . add for CONFIG_IEEE80211W, none 11w also can use */ + } else if ((frtype == WIFI_DATA) && ((frsubtype == 0x08) || (frsubtype == 0x09) || (frsubtype == 0x0a) ||
@@ -1487,8 +1491,9 @@ void rtw_sec_restore_wep_key(struct adapter *adapter) {struct security_priv *securitypriv = &(adapter->securitypriv);signed int keyid; +u32 alg = securitypriv->dot11PrivacyAlgrthm; -if ((_WEP40_ == securitypriv->dot11PrivacyAlgrthm) || (_WEP104_ == securitypriv->dot11PrivacyAlgrthm)) { +if ((alg == _WEP40_) || (alg == _WEP104_)) {for (keyid =0 ; keyid <4 ; keyid++) {if (securitypriv->key_mask &BIT (keyid)) {if (keyid == securitypriv->dot11PrivacyKeyIndex)
drivers/staging/rtl8723bs/core/rtw_wlan_util.c +140 -75
307 lines not on this page · raw message
drivers/staging/rtl8723bs/core/rtw_xmit.c +45 -17
142 lines not on this page · raw message
drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c +23 -12
@@ -810,7 +810,8 @@ static void halbtc8723b1ant_SetAntPath(u8 H2C_Parameter[2 ] = {0 }, u1Tmp =0 ; pBtCoexist->fBtcGet (pBtCoexist,BTC_GET_BL_EXT_SWITCH , &bPgExtSwitch); - pBtCoexist->fBtcGet (pBtCoexist,BTC_GET_U4_WIFI_FW_VER , &fwVer);/* [31:16]=fw ver, [15:0]=fw sub ver */ +/* [31:16]=fw ver, [15:0]=fw sub ver */ + pBtCoexist->fBtcGet (pBtCoexist,BTC_GET_U4_WIFI_FW_VER , &fwVer);if ((fwVer >0 && fwVer <0xc0000 ) || bPgExtSwitch) bUseExtSwitch = true;
@@ -829,7 +830,8 @@ static void halbtc8723b1ant_SetAntPath(/* set wlan_act control by PTA */ pBtCoexist->fBtcWrite1Byte (pBtCoexist,0x76e ,0x4 ); - pBtCoexist->fBtcWrite1ByteBitMask (pBtCoexist,0x67 ,0x20 ,0x1 );/* BT select s0/s1 is controlled by WiFi */ +/* BT select s0/s1 is controlled by WiFi */ + pBtCoexist->fBtcWrite1ByteBitMask (pBtCoexist,0x67 ,0x20 ,0x1 ); pBtCoexist->fBtcWrite1ByteBitMask (pBtCoexist,0x39 ,0x8 ,0x1 ); pBtCoexist->fBtcWrite1Byte (pBtCoexist,0x974 ,0xff );
@@ -847,10 +849,13 @@ static void halbtc8723b1ant_SetAntPath( pBtCoexist->fBtcWrite1Byte (pBtCoexist,0x76e ,0x4 ); pBtCoexist->fBtcGet (pBtCoexist,BTC_GET_BL_WIFI_IS_IN_MP_MODE , &bIsInMpMode); -if (!bIsInMpMode) - pBtCoexist->fBtcWrite1ByteBitMask (pBtCoexist,0x67 ,0x20 ,0x0 );/* BT select s0/s1 is controlled by BT */ -else - pBtCoexist->fBtcWrite1ByteBitMask (pBtCoexist,0x67 ,0x20 ,0x1 );/* BT select s0/s1 is controlled by WiFi */ +if (!bIsInMpMode) { +/* BT select s0/s1 is controlled by BT */ + pBtCoexist->fBtcWrite1ByteBitMask (pBtCoexist,0x67 ,0x20 ,0x0 ); + }else { +/* BT select s0/s1 is controlled by WiFi */ + pBtCoexist->fBtcWrite1ByteBitMask (pBtCoexist,0x67 ,0x20 ,0x1 ); + }/* 0x4c[24:23]= 00, Set Antenna control by BT_RFE_CTRL BT Vendor 0xac = 0xf002 */ u4Tmp = pBtCoexist->fBtcRead4Byte (pBtCoexist,0x4c );
@@ -1059,8 +1064,10 @@ static void halbtc8723b1ant_PsTdma(if (bTurnOn) { -if (pBtLinkInfo->bSlaveRole) - psTdmaByte4Val = psTdmaByte4Val |0x1 ;/* 0x778 = 0x1 at wifi slot (no blocking BT Low-Pri pkts) */ +if (pBtLinkInfo->bSlaveRole) { +/* 0x778 = 0x1 at wifi slot (no blocking BT Low-Pri pkts) */ + psTdmaByte4Val = psTdmaByte4Val |0x1 ; + }switch (type) {
@@ -1868,7 +1875,8 @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist) pBtCoexist,BTC_PS_WIFI_NATIVE ,0x0 ,0x0 ); else { /* busy */ -if (pCoexSta->nScanAPNum >=BT_8723B_1ANT_WIFI_NOISY_THRESH )/* no force LPS, no PS-TDMA, use pure TDMA */ +/* no force LPS, no PS-TDMA, use pure TDMA */ +if (pCoexSta->nScanAPNum >=BT_8723B_1ANT_WIFI_NOISY_THRESH )halbtc8723b1ant_PowerSaveState ( pBtCoexist,BTC_PS_WIFI_NATIVE ,0x0 ,0x0 );
@@ -2246,7 +2254,8 @@ void EXhalbtc8723b1ant_ScanNotify(struct btc_coexist *pBtCoexist, u8 type)if (type ==BTC_SCAN_START ) { pCoexSta->bWiFiIsHighPriTask = true; -halbtc8723b1ant_PsTdma (pBtCoexist,FORCE_EXEC , false,8 );/* Force antenna setup for no scan result issue */ +/* Force antenna setup for no scan result issue */ +halbtc8723b1ant_PsTdma (pBtCoexist,FORCE_EXEC , false,8 ); pBtCoexist->fBtcRead4Byte (pBtCoexist,0x948 ); pBtCoexist->fBtcRead1Byte (pBtCoexist,0x765 ); pBtCoexist->fBtcRead1Byte (pBtCoexist,0x67 );
@@ -2432,7 +2441,8 @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 tyif (type ==BTC_PACKET_ARP ) { pCoexDm->nArpCnt++; -if (pCoexDm->nArpCnt >=10 )/* if APR PKT > 10 after connect, do not go to ActionWifiConnectedSpecialPacket(pBtCoexist) */ +/* if ARP PKT > 10 after connect, skip special packet action */ +if (pCoexDm->nArpCnt >=10 ) pCoexSta->bWiFiIsHighPriTask = false;else pCoexSta->bWiFiIsHighPriTask = true;
@@ -2578,7 +2588,8 @@ void EXhalbtc8723b1ant_BtInfoNotify(halbtc8723b1ant_UpdateBtLinkInfo (pBtCoexist); - btInfo = btInfo &0x1f ;/* mask profile bit for connect-ilde identification (for CSR case: A2DP idle --> 0x41) */ +/* mask profile bit for connect-idle identification (CSR case: A2DP idle = 0x41) */ + btInfo = btInfo &0x1f ;if (!(btInfo &BT_INFO_8723B_1ANT_B_CONNECTION )) { pCoexDm->btStatus =BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE ;
drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c +19 -10
@@ -830,7 +830,8 @@ static void halbtc8723b2ant_SetAntPath(u8 H2C_Parameter[2 ] = {0 }; pBtCoexist->fBtcGet (pBtCoexist,BTC_GET_BL_EXT_SWITCH , &bPgExtSwitch); - pBtCoexist->fBtcGet (pBtCoexist,BTC_GET_U4_WIFI_FW_VER , &fwVer);/* [31:16]=fw ver, [15:0]=fw sub ver */ +/* [31:16]=fw ver, [15:0]=fw sub ver */ + pBtCoexist->fBtcGet (pBtCoexist,BTC_GET_U4_WIFI_FW_VER , &fwVer);if ((fwVer >0 && fwVer <0xc0000 ) || bPgExtSwitch) bUseExtSwitch = true;
@@ -901,13 +902,16 @@ static void halbtc8723b2ant_SetAntPath( pBtCoexist->fBtcWrite4Byte (pBtCoexist,0x4c , u4Tmp); } - pBtCoexist->fBtcWrite1ByteBitMask (pBtCoexist,0x64 ,0x1 ,0x0 );/* fixed external switch S1->Main, S0->Aux */ +/* fixed external switch S1->Main, S0->Aux */ + pBtCoexist->fBtcWrite1ByteBitMask (pBtCoexist,0x64 ,0x1 ,0x0 );switch (antPosType) {case BTC_ANT_WIFI_AT_MAIN : - pBtCoexist->fBtcWrite4Byte (pBtCoexist,0x948 ,0x0 );/* fixed internal switch S1->WiFi, S0->BT */ +/* fixed internal switch S1->WiFi, S0->BT */ + pBtCoexist->fBtcWrite4Byte (pBtCoexist,0x948 ,0x0 );break ;case BTC_ANT_WIFI_AT_AUX : - pBtCoexist->fBtcWrite4Byte (pBtCoexist,0x948 ,0x280 );/* fixed internal switch S0->WiFi, S1->BT */ +/* fixed internal switch S0->WiFi, S1->BT */ + pBtCoexist->fBtcWrite4Byte (pBtCoexist,0x948 ,0x280 );break ; } }
@@ -2279,7 +2283,8 @@ static void halbtc8723b2ant_WifiOffHwCfg(struct btc_coexist *pBtCoexist)/* set wlan_act to low */ pBtCoexist->fBtcWrite1Byte (pBtCoexist,0x76e ,0x4 ); - pBtCoexist->fBtcSetRfReg (pBtCoexist,BTC_RF_A ,0x1 ,0xfffff ,0x780 );/* WiFi goto standby while GNT_BT 0-->1 */ +/* WiFi goto standby while GNT_BT 0-->1 */ + pBtCoexist->fBtcSetRfReg (pBtCoexist,BTC_RF_A ,0x1 ,0xfffff ,0x780 ); pBtCoexist->fBtcGet (pBtCoexist,BTC_GET_U4_WIFI_FW_VER , &fwVer);if (fwVer >=0x180000 ) {/* Use H2C to set GNT_BT to HIGH */
@@ -2289,10 +2294,13 @@ static void halbtc8723b2ant_WifiOffHwCfg(struct btc_coexist *pBtCoexist) pBtCoexist->fBtcWrite1Byte (pBtCoexist,0x765 ,0x18 ); pBtCoexist->fBtcGet (pBtCoexist,BTC_GET_BL_WIFI_IS_IN_MP_MODE , &bIsInMpMode); -if (!bIsInMpMode) - pBtCoexist->fBtcWrite1ByteBitMask (pBtCoexist,0x67 ,0x20 ,0x0 );/* BT select s0/s1 is controlled by BT */ -else - pBtCoexist->fBtcWrite1ByteBitMask (pBtCoexist,0x67 ,0x20 ,0x1 );/* BT select s0/s1 is controlled by WiFi */ +if (!bIsInMpMode) { +/* BT select s0/s1 is controlled by BT */ + pBtCoexist->fBtcWrite1ByteBitMask (pBtCoexist,0x67 ,0x20 ,0x0 ); + }else { +/* BT select s0/s1 is controlled by WiFi */ + pBtCoexist->fBtcWrite1ByteBitMask (pBtCoexist,0x67 ,0x20 ,0x1 ); + } }static void halbtc8723b2ant_InitHwConfig (struct btc_coexist *pBtCoexist,bool bBackUp)
@@ -2595,7 +2603,8 @@ void EXhalbtc8723b2ant_BtInfoNotify(void EXhalbtc8723b2ant_HaltNotify (struct btc_coexist *pBtCoexist) {halbtc8723b2ant_WifiOffHwCfg (pBtCoexist); - pBtCoexist->fBtcSetBtReg (pBtCoexist,BTC_BT_REG_RF ,0x3c ,0x15 );/* BT goto standby while GNT_BT 1-->0 */ +/* BT goto standby while GNT_BT 1-->0 */ + pBtCoexist->fBtcSetBtReg (pBtCoexist,BTC_BT_REG_RF ,0x3c ,0x15 );halbtc8723b2ant_IgnoreWlanAct (pBtCoexist,FORCE_EXEC , true);EXhalbtc8723b2ant_MediaStatusNotify (pBtCoexist,BTC_MEDIA_DISCONNECT );
drivers/staging/rtl8723bs/hal/HalPhyRf.c +25 -11
@@ -65,7 +65,8 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter)u8 ThermalValue_AVG_count =0 ;u32 ThermalValue_AVG =0 ; -u8 OFDM_min_index =0 ;/* OFDM BB Swing should be less than +3.0dB, which is required by Arthur */ +/* OFDM BB Swing should be less than +3.0dB, which is required by Arthur */ +u8 OFDM_min_index =0 ;u8 Indexforchannel =0 ;/* GetRightChnlPlaceforIQK(pHalData->CurrentChannel) */ struct txpwrtrack_cfg c;
@@ -93,7 +94,9 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) pDM_Odm->RFCalibrateInfo.TXPowerTrackingCallbackCnt++; pDM_Odm->RFCalibrateInfo.bTXPowerTrackingInit = true; - ThermalValue = (u8 )PHY_QueryRFReg (pDM_Odm->Adapter,RF_PATH_A , c.ThermalRegAddr,0xfc00 );/* 0x42: RF Reg[15:10] 88E */ +/* 0x42: RF Reg[15:10] 88E */ + ThermalValue = (u8 )PHY_QueryRFReg (pDM_Odm->Adapter,RF_PATH_A , + c.ThermalRegAddr,0xfc00 ); if ( !pDM_Odm->RFCalibrateInfo.TxPowerTrackControl || pHalData->EEPROMThermalMeter == 0 ||
@@ -104,11 +107,15 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter)/* 4 3. Initialize ThermalValues of RFCalibrateInfo */ /* 4 4. Calculate average thermal meter */ - - pDM_Odm->RFCalibrateInfo.ThermalValue_AVG[pDM_Odm->RFCalibrateInfo.ThermalValue_AVG_index] = ThermalValue; - pDM_Odm->RFCalibrateInfo.ThermalValue_AVG_index++; -if (pDM_Odm->RFCalibrateInfo.ThermalValue_AVG_index == c.AverageThermalNum)/* Average times = c.AverageThermalNum */ - pDM_Odm->RFCalibrateInfo.ThermalValue_AVG_index =0 ; + { +struct odm_rf_cal_t *cal = &pDM_Odm->RFCalibrateInfo; + + cal->ThermalValue_AVG[cal->ThermalValue_AVG_index] = ThermalValue; + cal->ThermalValue_AVG_index++; +/* Average times = c.AverageThermalNum */ +if (cal->ThermalValue_AVG_index == c.AverageThermalNum) + cal->ThermalValue_AVG_index =0 ; + }for (i =0 ; i < c.AverageThermalNum; i++) {if (pDM_Odm->RFCalibrateInfo.ThermalValue_AVG[i]) {
@@ -200,10 +207,16 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter)if ( pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[p] == pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[p] - )/* If Thermal value changes but lookup table value still the same */ + ) { +/* If Thermal value changes but lookup table value still the same */ pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p] =0 ; -else - pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p] = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[p] - pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[p];/* Power Index Diff between 2 times Power Tracking */ + }else { +/* Power Index Diff between 2 times Power Tracking */ +s8 delta_idx = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[p]; +s8 last_idx = pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[p]; + + pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p] = delta_idx - last_idx; + } pDM_Odm->RFCalibrateInfo.OFDM_index[p] = pDM_Odm->BbSwingIdxOfdmBase[p] +
@@ -245,7 +258,8 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) ) {/* 4 7.2 Configure the Swing Table to adjust Tx Power. */ - pDM_Odm->RFCalibrateInfo.bTxPowerChanged = true;/* Always true after Tx Power is adjusted by power tracking. */ +/* Always true after Tx Power is adjusted by power tracking. */ + pDM_Odm->RFCalibrateInfo.bTxPowerChanged = true;/* */ /* 2012/04/23 MH According to Luke's suggestion, we can not write BB digital */ /* to increase TX power. Otherwise, EVM will be bad. */
drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c +117 -49
328 lines not on this page · raw message
drivers/staging/rtl8723bs/hal/hal_com.c +7 -3
@@ -792,10 +792,14 @@ void rtw_hal_check_rxfifo_full(struct adapter *adapter)/* todo: other chips */ if (save_cnt) { +u16 last, curr; +/* rtw_write8(adapter, REG_RXERR_RPT+3, rtw_read8(adapter, REG_RXERR_RPT+3)|0xa0); */ - pdbgpriv->dbg_rx_fifo_last_overflow = pdbgpriv->dbg_rx_fifo_curr_overflow; - pdbgpriv->dbg_rx_fifo_curr_overflow =rtw_read16 (adapter,REG_RXERR_RPT ); - pdbgpriv->dbg_rx_fifo_diff_overflow = pdbgpriv->dbg_rx_fifo_curr_overflow-pdbgpriv->dbg_rx_fifo_last_overflow; + last = pdbgpriv->dbg_rx_fifo_curr_overflow; + curr =rtw_read16 (adapter,REG_RXERR_RPT ); + pdbgpriv->dbg_rx_fifo_last_overflow = last; + pdbgpriv->dbg_rx_fifo_curr_overflow = curr; + pdbgpriv->dbg_rx_fifo_diff_overflow = curr - last; } }
drivers/staging/rtl8723bs/hal/hal_com_phycfg.c +15 -7
@@ -318,7 +318,8 @@ static void PHY_StoreTxPowerByRateNew(struct adapter *padapter, u32 RfPath,u8 i =0 , rateIndex[4 ] = {0 }, rateNum =0 ;s8 PwrByRateVal[4 ] = {0 }; -PHY_GetRateValuesOfTxPowerByRate (padapter, RegAddr, BitMask, Data, rateIndex, PwrByRateVal, &rateNum); +PHY_GetRateValuesOfTxPowerByRate (padapter, RegAddr, BitMask, Data, + rateIndex, PwrByRateVal, &rateNum);if (RfPath >=RF_PATH_MAX )return ;
@@ -436,7 +437,10 @@ void PHY_SetTxPowerIndexByRateSection( ARRAY_SIZE(ofdmRates)); }else if (RateSection ==HT_MCS0_MCS7 ) { -u8 htRates1T[] = {MGN_MCS0 ,MGN_MCS1 ,MGN_MCS2 ,MGN_MCS3 ,MGN_MCS4 ,MGN_MCS5 ,MGN_MCS6 ,MGN_MCS7 }; +u8 htRates1T[] = { +MGN_MCS0 ,MGN_MCS1 ,MGN_MCS2 ,MGN_MCS3 , +MGN_MCS4 ,MGN_MCS5 ,MGN_MCS6 ,MGN_MCS7 + }; PHY_SetTxPowerIndexByRateArray(padapter, RFPath, pHalData->CurrentChannelBW, Channel, htRates1T,
@@ -844,11 +848,15 @@ void PHY_SetTxPowerLimit(if (channelIndex ==-1 )return ; - - prevPowerLimit = pHalData->TxPwrLimit_2_4G[regulation][bandwidth][rateSection][channelIndex][RF_PATH_A ]; - -if (powerLimit < prevPowerLimit) - pHalData->TxPwrLimit_2_4G[regulation][bandwidth][rateSection][channelIndex][RF_PATH_A ] = powerLimit; + { +s8 *pLimit = &pHalData->TxPwrLimit_2_4G[regulation][bandwidth] + [rateSection][channelIndex] + [RF_PATH_A ]; + prevPowerLimit = *pLimit; + +if (powerLimit < prevPowerLimit) + *pLimit = powerLimit; + } }void Hal_ChannelPlanToRegulation (struct adapter *Adapter,u16 ChannelPlan)
drivers/staging/rtl8723bs/hal/hal_intf.c +3 -1
@@ -120,7 +120,9 @@ u8 rtw_hal_get_def_var(struct adapter *padapter, enum hal_def_variable eVariablereturn GetHalDefVar8723BSDIO (padapter, eVariable, pValue); } -void rtw_hal_set_odm_var (struct adapter *padapter,enum hal_odm_variable eVariable,void *pValue1,bool bSet) +void rtw_hal_set_odm_var (struct adapter *padapter, +enum hal_odm_variable eVariable, +void *pValue1,bool bSet) {SetHalODMVar (padapter, eVariable, pValue1, bSet); }
drivers/staging/rtl8723bs/hal/hal_sdio.c +3 -1
@@ -23,8 +23,10 @@ u8 rtw_hal_sdio_query_tx_freepage( ) {struct hal_com_data *pHalData =GET_HAL_DATA (padapter); +u8 page_free = pHalData->SdioTxFIFOFreePage[PageIdx]; +u8 pub_free = pHalData->SdioTxFIFOFreePage[PUBLIC_QUEUE_IDX ]; -if ((pHalData->SdioTxFIFOFreePage[PageIdx]+pHalData->SdioTxFIFOFreePage[PUBLIC_QUEUE_IDX ]) >= (RequiredPageNum)) +if ((page_free + pub_free) >= RequiredPageNum)return true;else return false;
drivers/staging/rtl8723bs/hal/odm.c +13 -5
@@ -131,8 +131,13 @@ u8 CCKSwingTable_Ch14_New[CCK_TABLE_SIZE][8] = {static void odm_CommonInfoSelfInit (struct dm_odm_t *pDM_Odm) { - pDM_Odm->bCckHighPower = (bool )PHY_QueryBBReg (pDM_Odm->Adapter,ODM_REG (CCK_RPT_FORMAT , pDM_Odm),ODM_BIT (CCK_RPT_FORMAT , pDM_Odm)); - pDM_Odm->RFPathRxEnable = (u8 )PHY_QueryBBReg (pDM_Odm->Adapter,ODM_REG (BB_RX_PATH , pDM_Odm),ODM_BIT (BB_RX_PATH , pDM_Odm)); +u32 cck_reg =ODM_REG (CCK_RPT_FORMAT , pDM_Odm); +u32 cck_bit =ODM_BIT (CCK_RPT_FORMAT , pDM_Odm); +u32 rx_reg =ODM_REG (BB_RX_PATH , pDM_Odm); +u32 rx_bit =ODM_BIT (BB_RX_PATH , pDM_Odm); + + pDM_Odm->bCckHighPower = (bool )PHY_QueryBBReg (pDM_Odm->Adapter, cck_reg, cck_bit); + pDM_Odm->RFPathRxEnable = (u8 )PHY_QueryBBReg (pDM_Odm->Adapter, rx_reg, rx_bit); pDM_Odm->TxRate =0xFF ; }
@@ -267,12 +272,15 @@ static void odm_RefreshRateAdaptiveMaskCE(struct dm_odm_t *pDM_Odm)struct sta_info *pstat = pDM_Odm->pODM_StaInfo[i];if (IS_STA_VALID (pstat)) { -if (is_multicast_ether_addr (pstat->hwaddr))/* if (psta->mac_id == 1) */ +u32 rssi = pstat->rssi_stat.UndecoratedSmoothedPWDB; +bool changed; + +if (is_multicast_ether_addr (pstat->hwaddr))continue ; -if (true ==ODM_RAStateCheck (pDM_Odm, pstat->rssi_stat.UndecoratedSmoothedPWDB, false, &pstat->rssi_level)) { + changed =ODM_RAStateCheck (pDM_Odm, rssi, false, &pstat->rssi_level); +if (changed)rtw_hal_update_ra_mask (pstat, pstat->rssi_level); - } } }
drivers/staging/rtl8723bs/hal/odm_DIG.c +24 -14
@@ -10,17 +10,23 @@void odm_NHMCounterStatisticsInit (void *pDM_VOID) {struct dm_odm_t *pDM_Odm = (struct dm_odm_t *)pDM_VOID; +struct adapter *adapter = pDM_Odm->Adapter;/* PHY parameters initialize for n series */ -rtw_write16 (pDM_Odm->Adapter,ODM_REG_NHM_TIMER_11N +2 ,0x2710 );/* 0x894[31:16]= 0x2710 Time duration for NHM unit: 4us, 0x2710 =40ms */ -/* rtw_write16(pDM_Odm->Adapter, ODM_REG_NHM_TIMER_11N+2, 0x4e20); 0x894[31:16]= 0x4e20 Time duration for NHM unit: 4us, 0x4e20 =80ms */ -rtw_write16 (pDM_Odm->Adapter,ODM_REG_NHM_TH9_TH10_11N +2 ,0xffff );/* 0x890[31:16]= 0xffff th_9, th_10 */ -/* rtw_write32(pDM_Odm->Adapter, ODM_REG_NHM_TH3_TO_TH0_11N, 0xffffff5c); 0x898 = 0xffffff5c th_3, th_2, th_1, th_0 */ -rtw_write32 (pDM_Odm->Adapter,ODM_REG_NHM_TH3_TO_TH0_11N ,0xffffff52 );/* 0x898 = 0xffffff52 th_3, th_2, th_1, th_0 */ -rtw_write32 (pDM_Odm->Adapter,ODM_REG_NHM_TH7_TO_TH4_11N ,0xffffffff );/* 0x89c = 0xffffffff th_7, th_6, th_5, th_4 */ -PHY_SetBBReg (pDM_Odm->Adapter,ODM_REG_FPGA0_IQK_11N , bMaskByte0,0xff );/* 0xe28[7:0]= 0xff th_8 */ -PHY_SetBBReg (pDM_Odm->Adapter,ODM_REG_NHM_TH9_TH10_11N ,BIT10 |BIT9 |BIT8 ,0x7 );/* 0x890[9:8]=3 enable CCX */ -PHY_SetBBReg (pDM_Odm->Adapter,ODM_REG_OFDM_FA_RSTC_11N ,BIT7 ,0x1 );/* 0xc0c[7]= 1 max power among all RX ants */ +/* 0x894[31:16]=0x2710, Time duration for NHM unit: 4us, 0x2710=40ms */ +rtw_write16 (adapter,ODM_REG_NHM_TIMER_11N +2 ,0x2710 ); +/* 0x890[31:16]=0xffff, th_9, th_10 */ +rtw_write16 (adapter,ODM_REG_NHM_TH9_TH10_11N +2 ,0xffff ); +/* 0x898=0xffffff52, th_3, th_2, th_1, th_0 */ +rtw_write32 (adapter,ODM_REG_NHM_TH3_TO_TH0_11N ,0xffffff52 ); +/* 0x89c=0xffffffff, th_7, th_6, th_5, th_4 */ +rtw_write32 (adapter,ODM_REG_NHM_TH7_TO_TH4_11N ,0xffffffff ); +/* 0xe28[7:0]=0xff, th_8 */ +PHY_SetBBReg (adapter,ODM_REG_FPGA0_IQK_11N , bMaskByte0,0xff ); +/* 0x890[9:8]=3, enable CCX */ +PHY_SetBBReg (adapter,ODM_REG_NHM_TH9_TH10_11N ,BIT10 |BIT9 |BIT8 ,0x7 ); +/* 0xc0c[7]=1, max power among all RX ants */ +PHY_SetBBReg (adapter,ODM_REG_OFDM_FA_RSTC_11N ,BIT7 ,0x1 ); }void odm_NHMCounterStatistics (void *pDM_VOID)
@@ -80,8 +86,8 @@ void odm_NHMBB(void *pDM_VOID) pDM_Odm->NHMLastRxOkcnt = *(pDM_Odm->pNumRxBytesUnicast); - -if ((pDM_Odm->NHMCurTxOkcnt) +1 > (u64)(pDM_Odm->NHMCurRxOkcnt<<2 ) +1 ) {/* Tx > 4*Rx possible for adaptivity test */ +/* Tx > 4*Rx possible for adaptivity test */ +if ((pDM_Odm->NHMCurTxOkcnt) +1 > (u64)(pDM_Odm->NHMCurRxOkcnt <<2 ) +1 ) {if (pDM_Odm->NHM_cnt_0 >=190 || pDM_Odm->adaptivity_flag == true) {/* Enable EDCCA since it is possible running Adaptivity testing */ /* test_status = 1; */
@@ -343,7 +349,9 @@ void odm_DIGInit(void *pDM_VOID) pDM_DigTable->bStopDIG = false; pDM_DigTable->bPSDInProgress = false; - pDM_DigTable->CurIGValue = (u8 )PHY_QueryBBReg (pDM_Odm->Adapter,ODM_REG (IGI_A , pDM_Odm),ODM_BIT (IGI , pDM_Odm)); + pDM_DigTable->CurIGValue = (u8 )PHY_QueryBBReg (pDM_Odm->Adapter, +ODM_REG (IGI_A , pDM_Odm), +ODM_BIT (IGI , pDM_Odm)); pDM_DigTable->RssiLowThresh =DM_DIG_THRESH_LOW ; pDM_DigTable->RssiHighThresh =DM_DIG_THRESH_HIGH ; pDM_DigTable->FALowThresh = DMfalseALARM_THRESH_LOW;
@@ -565,10 +573,12 @@ void odm_DIG(void *pDM_VOID)else if (pDM_Odm->bBtConnectProcess)ODM_Write_DIG (pDM_Odm,0x28 );else -ODM_Write_DIG (pDM_Odm, pDM_DigTable->BT30_CurIGI);/* ODM_Write_DIG(pDM_Odm, pDM_DigTable->CurIGValue); */ +/* ODM_Write_DIG(pDM_Odm, pDM_DigTable->CurIGValue); */ +ODM_Write_DIG (pDM_Odm, pDM_DigTable->BT30_CurIGI); } }else {/* BT is not using */ -ODM_Write_DIG (pDM_Odm, CurrentIGI);/* ODM_Write_DIG(pDM_Odm, pDM_DigTable->CurIGValue); */ +/* ODM_Write_DIG(pDM_Odm, pDM_DigTable->CurIGValue); */ +ODM_Write_DIG (pDM_Odm, CurrentIGI); pDM_DigTable->bMediaConnect_0 = pDM_Odm->bLinked; pDM_DigTable->DIG_Dynamic_MIN_0 = DIG_Dynamic_MIN; }
drivers/staging/rtl8723bs/hal/odm_HWConfig.c +13 -4
@@ -372,13 +372,22 @@ static void odm_Process_RSSIForDM( OFDM_pkt += (u8)(pEntry->rssi_stat.PacketMap>>i)&BIT0 ;if (pEntry->rssi_stat.ValidBit ==64 ) { +u32 ofdm_weight, cck_weight; + Weighting = ((OFDM_pkt<<4 ) >64 )?64 :(OFDM_pkt<<4 ); - UndecoratedSmoothedPWDB = (Weighting*UndecoratedSmoothedOFDM+(64 -Weighting)*UndecoratedSmoothedCCK)>>6 ; + ofdm_weight = Weighting * UndecoratedSmoothedOFDM; + cck_weight = (64 - Weighting) * UndecoratedSmoothedCCK; + UndecoratedSmoothedPWDB = (ofdm_weight + cck_weight) >>6 ; }else { -if (pEntry->rssi_stat.ValidBit !=0 ) - UndecoratedSmoothedPWDB = (OFDM_pkt*UndecoratedSmoothedOFDM+(pEntry->rssi_stat.ValidBit-OFDM_pkt)*UndecoratedSmoothedCCK)/pEntry->rssi_stat.ValidBit; -else +if (pEntry->rssi_stat.ValidBit !=0 ) { +u8 valid = pEntry->rssi_stat.ValidBit; +u32 ofdm_sum = OFDM_pkt * UndecoratedSmoothedOFDM; +u32 cck_sum = (valid - OFDM_pkt) * UndecoratedSmoothedCCK; + + UndecoratedSmoothedPWDB = (ofdm_sum + cck_sum) / valid; + }else { UndecoratedSmoothedPWDB =0 ; + } } pEntry->rssi_stat.UndecoratedSmoothedCCK = UndecoratedSmoothedCCK;
drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c +83 -20
79 lines not on this page · raw message
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c +41 -23
64 lines not on this page · raw message
drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +37 -17
54 lines not on this page · raw message
drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c +4 -2
Lines of this file are not shown. View the raw message.
drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c +4 -2
Lines of this file are not shown. View the raw message.
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +4 -1
Lines of this file are not shown. View the raw message.
drivers/staging/rtl8723bs/hal/sdio_halinit.c +12 -5
Lines of this file are not shown. View the raw message.
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +94 -40
134 lines not on this page · raw message
drivers/staging/rtl8723bs/os_dep/os_intfs.c +11 -6
Lines of this file are not shown. View the raw message.
drivers/staging/rtl8723bs/os_dep/sdio_intf.c +2 -1
Lines of this file are not shown. View the raw message.
drivers/staging/rtl8723bs/os_dep/xmit_linux.c +6 -2
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.52.0
Part of the diff is not shown here. View the raw message.
Greg Kroah-Hartman
maintainerRe: [PATCH v1 5/5] staging: rtl8723bs: fix LONG_LINE warnings across C files
Quoted 16 lines · Luka Gejak
Refactor lines exceeding 100 characters to comply with kernel coding style. All changes preserve original logic and behavior.
Techniques used:
- Move trailing comments to separate lines above code
- Break long function signatures across multiple lines
- Extract complex expressions into named temp variables
- Use scoped blocks for local variable declarations
- Create pointer aliases for deeply nested struct accesses
- Simplify compound conditionals with intermediate booleansFiles modified:
- core/:rtw_cmd.c,rtw_ieee80211.c,rtw_io.c,rtw_ioctl_set.c,rtw_mlme.c,rtw_mlme_ext.c,rtw_pwrctrl.c,rtw_recv.c,rtw_security.c,rtw_wlan_util.c,rtw_xmit.c
- hal/:HalBtc8723b1Ant.c,HalBtc8723b2Ant.c,HalPhyRf.c,
Quoted 6 lines
HalPhyRf_8723B.c, hal_com.c, hal_com_phycfg.c, hal_intf.c, hal_sdio.c, odm.c, odm_DIG.c, odm_HWConfig.c, rtl8723b_cmd.c, rtl8723b_hal_init.c, rtl8723b_phycfg.c, rtl8723b_rf6052.c, rtl8723bs_recv.c, rtl8723bs_xmit.c, sdio_halinit.c- os_dep/:
ioctl_cfg80211.c,os_intfs.c,sdio_intf.c,xmit_linux.c
Was this generated by ai?
Anyway, it does way too much, my bot will say more...
thanks,
greg k-h
Greg Kroah-Hartman
maintainerRe: [PATCH v1 5/5] staging: rtl8723bs: fix LONG_LINE warnings across C files
In reply to Luka GejakQuoted 50 lines · Luka Gejak
Refactor lines exceeding 100 characters to comply with kernel coding style. All changes preserve original logic and behavior.
Techniques used:
- Move trailing comments to separate lines above code
- Break long function signatures across multiple lines
- Extract complex expressions into named temp variables
- Use scoped blocks for local variable declarations
- Create pointer aliases for deeply nested struct accesses
- Simplify compound conditionals with intermediate booleansFiles modified:
- core/:rtw_cmd.c,rtw_ieee80211.c,rtw_io.c,rtw_ioctl_set.c,rtw_mlme.c,rtw_mlme_ext.c,rtw_pwrctrl.c,rtw_recv.c,rtw_security.c,rtw_wlan_util.c,rtw_xmit.c
- hal/:HalBtc8723b1Ant.c,HalBtc8723b2Ant.c,HalPhyRf.c,HalPhyRf_8723B.c, hal_com.c, hal_com_phycfg.c, hal_intf.c, hal_sdio.c, odm.c, odm_DIG.c, odm_HWConfig.c, rtl8723b_cmd.c, rtl8723b_hal_init.c, rtl8723b_phycfg.c, rtl8723b_rf6052.c, rtl8723bs_recv.c, rtl8723bs_xmit.c, sdio_halinit.c- os_dep/:
ioctl_cfg80211.c,os_intfs.c,sdio_intf.c,xmit_linux.cSigned-off-by Luka Gejak <[email protected]>--- drivers/staging/rtl8723bs/core/rtw_cmd.c | 142 ++--- .../staging/rtl8723bs/core/rtw_ieee80211.c | 36 +- drivers/staging/rtl8723bs/core/rtw_io.c | 4 +- .../staging/rtl8723bs/core/rtw_ioctl_set.c | 16 +- drivers/staging/rtl8723bs/core/rtw_mlme.c | 103 ++-- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 492 ++++++++++++------ drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 3 +- drivers/staging/rtl8723bs/core/rtw_recv.c | 123 +++-- drivers/staging/rtl8723bs/core/rtw_security.c | 11 +- .../staging/rtl8723bs/core/rtw_wlan_util.c | 215 +++++--- drivers/staging/rtl8723bs/core/rtw_xmit.c | 62 ++- .../staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 35 +- .../staging/rtl8723bs/hal/HalBtc8723b2Ant.c | 29 +- drivers/staging/rtl8723bs/hal/HalPhyRf.c | 36 +- .../staging/rtl8723bs/hal/HalPhyRf_8723B.c | 166 ++++-- drivers/staging/rtl8723bs/hal/hal_com.c | 10 +- .../staging/rtl8723bs/hal/hal_com_phycfg.c | 22 +- drivers/staging/rtl8723bs/hal/hal_intf.c | 4 +- drivers/staging/rtl8723bs/hal/hal_sdio.c | 4 +- drivers/staging/rtl8723bs/hal/odm.c | 18 +- drivers/staging/rtl8723bs/hal/odm_DIG.c | 38 +- drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 17 +- drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 103 +++- .../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 64 ++- .../staging/rtl8723bs/hal/rtl8723b_phycfg.c | 54 +- .../staging/rtl8723bs/hal/rtl8723b_rf6052.c | 6 +-
Quoted 8 lines
.../staging/rtl8723bs/hal/rtl8723bs_recv.c | 6 +- .../staging/rtl8723bs/hal/rtl8723bs_xmit.c | 5 +- drivers/staging/rtl8723bs/hal/sdio_halinit.c | 17 +- .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 134 +++-- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 17 +- drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 3 +- drivers/staging/rtl8723bs/os_dep/xmit_linux.c | 8 +- 33 files changed, 1364 insertions(+), 639 deletions(-)
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.
You are receiving this message because of the following common error(s) as indicated below:
- Your patch did many different things all at once, making it difficult to review. All Linux kernel patches need to only do one thing at a time. If you need to do multiple things (such as clean up all coding style issues in a file/driver), do it in a sequence of patches, each one doing only one thing. This will make it easier to review the patches to ensure that they are correct, and to help alleviate any merge issues that larger patches can cause.
If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.
thanks,
greg k-h's patch email bot