diff --git a/core/rtw_cmd.c b/core/rtw_cmd.c index fe739b5..4055454 100644 --- a/core/rtw_cmd.c +++ b/core/rtw_cmd.c @@ -2301,7 +2301,7 @@ _func_exit_; #endif #if (RATE_ADAPTIVE_SUPPORT==1) -void rpt_timer_setting_wk_hdl(_adapter *padapter, u16 minRptTime) +static void rpt_timer_setting_wk_hdl(_adapter *padapter, u16 minRptTime) { rtw_hal_set_hwreg(padapter, HW_VAR_RPT_TIMER_SETTING, (u8 *)(&minRptTime)); } @@ -2344,7 +2344,7 @@ _func_exit_; #endif #ifdef CONFIG_ANTENNA_DIVERSITY -void antenna_select_wk_hdl(_adapter *padapter, u8 antenna) +static void antenna_select_wk_hdl(_adapter *padapter, u8 antenna) { rtw_hal_set_hwreg(padapter, HW_VAR_ANTENNA_DIVERSITY_SELECT, (u8 *)(&antenna)); } @@ -2605,7 +2605,7 @@ exit: return res; } -s32 c2h_evt_hdl(_adapter *adapter, struct c2h_evt_hdr *c2h_evt, c2h_id_filter filter) +static s32 c2h_evt_hdl(_adapter *adapter, struct c2h_evt_hdr *c2h_evt, c2h_id_filter filter) { s32 ret = _FAIL; u8 buf[16]; diff --git a/core/rtw_debug.c b/core/rtw_debug.c index ca97f99..25a6934 100644 --- a/core/rtw_debug.c +++ b/core/rtw_debug.c @@ -84,7 +84,7 @@ int proc_get_write_reg(char *page, char **start, return 0; } -int proc_set_write_reg(struct file *file, const char *buffer, +int proc_set_write_reg(struct file *file, const char __user *buffer, unsigned long count, void *data) { struct net_device *dev = (struct net_device *)data; @@ -168,7 +168,7 @@ int proc_get_read_reg(char *page, char **start, } -int proc_set_read_reg(struct file *file, const char *buffer, +int proc_set_read_reg(struct file *file, const char __user *buffer, unsigned long count, void *data) { char tmp[16]; @@ -651,7 +651,7 @@ int proc_get_rx_signal(char *page, char **start, return len; } -int proc_set_rx_signal(struct file *file, const char *buffer, +int proc_set_rx_signal(struct file *file, const char __user *buffer, unsigned long count, void *data) { struct net_device *dev = (struct net_device *)data; @@ -709,7 +709,7 @@ int proc_get_ht_enable(char *page, char **start, return len; } -int proc_set_ht_enable(struct file *file, const char *buffer, +int proc_set_ht_enable(struct file *file, const char __user *buffer, unsigned long count, void *data) { struct net_device *dev = (struct net_device *)data; @@ -756,7 +756,7 @@ int proc_get_cbw40_enable(char *page, char **start, return len; } -int proc_set_cbw40_enable(struct file *file, const char *buffer, +int proc_set_cbw40_enable(struct file *file, const char __user *buffer, unsigned long count, void *data) { struct net_device *dev = (struct net_device *)data; @@ -805,7 +805,7 @@ int proc_get_ampdu_enable(char *page, char **start, return len; } -int proc_set_ampdu_enable(struct file *file, const char *buffer, +int proc_set_ampdu_enable(struct file *file, const char __user *buffer, unsigned long count, void *data) { struct net_device *dev = (struct net_device *)data; @@ -874,7 +874,7 @@ int proc_get_rx_stbc(char *page, char **start, return len; } -int proc_set_rx_stbc(struct file *file, const char *buffer, +int proc_set_rx_stbc(struct file *file, const char __user *buffer, unsigned long count, void *data) { struct net_device *dev = (struct net_device *)data; @@ -911,7 +911,7 @@ int proc_get_rssi_disp(char *page, char **start, return 0; } -int proc_set_rssi_disp(struct file *file, const char *buffer, +int proc_set_rssi_disp(struct file *file, const char __user *buffer, unsigned long count, void *data) { struct net_device *dev = (struct net_device *)data; @@ -1134,7 +1134,7 @@ int proc_get_btcoex_dbg(char *page, char **start, return len; } -int proc_set_btcoex_dbg(struct file *file, const char *buffer, +int proc_set_btcoex_dbg(struct file *file, const char __user *buffer, unsigned long count, void *data) { struct net_device *dev = (struct net_device *)data; diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index ad884c1..79f0e38 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -32,7 +32,7 @@ #include #endif -struct mlme_handler mlme_sta_tbl[]={ +static struct mlme_handler mlme_sta_tbl[]={ {WIFI_ASSOCREQ, "OnAssocReq", &OnAssocReq}, {WIFI_ASSOCRSP, "OnAssocRsp", &OnAssocRsp}, {WIFI_REASSOCREQ, "OnReAssocReq", &OnAssocReq}, @@ -76,7 +76,7 @@ struct mlme_handler mlme_ap_tbl[]={ }; #endif -struct action_handler OnAction_tbl[]={ +static struct action_handler OnAction_tbl[]={ {RTW_WLAN_CATEGORY_SPECTRUM_MGMT, "ACTION_SPECTRUM_MGMT", on_action_spct}, {RTW_WLAN_CATEGORY_QOS, "ACTION_QOS", &OnAction_qos}, {RTW_WLAN_CATEGORY_DLS, "ACTION_DLS", &OnAction_dls}, @@ -91,7 +91,7 @@ struct action_handler OnAction_tbl[]={ }; -u8 null_addr[ETH_ALEN]= {0,0,0,0,0,0}; +static u8 null_addr[ETH_ALEN]= {0,0,0,0,0,0}; /************************************************** OUI definitions for the vendor specific IE @@ -113,12 +113,7 @@ extern unsigned char REALTEK_96B_IE[]; /******************************************************** MCS rate definitions *********************************************************/ -#ifdef CONFIG_DISABLE_MCS13TO15 -unsigned char MCS_rate_2R_MCS13TO15_OFF[16] = {0xff, 0x1f, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; unsigned char MCS_rate_2R[16] = {0xff, 0xff, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; -#else //CONFIG_DISABLE_MCS13TO15 -unsigned char MCS_rate_2R[16] = {0xff, 0xff, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; -#endif //CONFIG_DISABLE_MCS13TO15 unsigned char MCS_rate_1R[16] = {0xff, 0x00, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; /******************************************************** @@ -759,7 +754,7 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) } #ifdef CONFIG_P2P -u32 p2p_listen_state_process(_adapter *padapter, unsigned char *da) +static u32 p2p_listen_state_process(_adapter *padapter, unsigned char *da) { bool response = _TRUE; @@ -2437,7 +2432,7 @@ unsigned int OnAtim(_adapter *padapter, union recv_frame *precv_frame) return _SUCCESS; } -unsigned int on_action_spct_ch_switch (_adapter *padapter, struct sta_info *psta, u8 *ies, uint ies_len) +static unsigned int on_action_spct_ch_switch (_adapter *padapter, struct sta_info *psta, u8 *ies, uint ies_len) { unsigned int ret = _FAIL; struct mlme_ext_priv *mlmeext = &padapter->mlmeextpriv; diff --git a/core/rtw_mp.c b/core/rtw_mp.c index 2ae36b2..7bd60d6 100644 --- a/core/rtw_mp.c +++ b/core/rtw_mp.c @@ -886,7 +886,7 @@ void SetTxPower(PADAPTER pAdapter) Hal_SetTxPower(pAdapter); } -void SetTxAGCOffset(PADAPTER pAdapter, u32 ulTxAGCOffset) +static void SetTxAGCOffset(PADAPTER pAdapter, u32 ulTxAGCOffset) { u32 TxAGCOffset_B, TxAGCOffset_C, TxAGCOffset_D,tmpAGC; @@ -970,13 +970,13 @@ void SetCarrierSuppressionTx(PADAPTER pAdapter, u8 bStart) Hal_SetCarrierSuppressionTx(pAdapter, bStart); } -void SetCCKContinuousTx(PADAPTER pAdapter, u8 bStart) +static void SetCCKContinuousTx(PADAPTER pAdapter, u8 bStart) { PhySetTxPowerLevel(pAdapter); Hal_SetCCKContinuousTx(pAdapter,bStart); } -void SetOFDMContinuousTx(PADAPTER pAdapter, u8 bStart) +static void SetOFDMContinuousTx(PADAPTER pAdapter, u8 bStart) { PhySetTxPowerLevel(pAdapter); Hal_SetOFDMContinuousTx( pAdapter, bStart); diff --git a/core/rtw_mp_ioctl.c b/core/rtw_mp_ioctl.c index baf22f8..99178dd 100644 --- a/core/rtw_mp_ioctl.c +++ b/core/rtw_mp_ioctl.c @@ -869,7 +869,7 @@ _func_enter_; return NDIS_STATUS_NOT_ACCEPTED; _irqlevel_changed_(&oldirql, LOWER); - rtw_hal_set_hwreg(Adapter, HW_VAR_TRIGGER_GPIO_0, 0); + rtw_hal_set_hwreg(Adapter, HW_VAR_TRIGGER_GPIO_0, NULL); _irqlevel_changed_(&oldirql, RAISE); _func_exit_; diff --git a/hal/odm_RTL8188E.c b/hal/odm_RTL8188E.c index 2f082bc..6ba5765 100644 --- a/hal/odm_RTL8188E.c +++ b/hal/odm_RTL8188E.c @@ -45,7 +45,7 @@ ODM_DIG_LowerBound_88E( } #if (defined(CONFIG_HW_ANTENNA_DIVERSITY)) -VOID +static VOID odm_RX_HWAntDivInit( IN PDM_ODM_T pDM_Odm ) @@ -83,7 +83,7 @@ odm_RX_HWAntDivInit( //ODM_SetBBReg(pDM_Odm, 0xa00 , BIT15, 1); //Enable CCK AntDiv } -VOID +static VOID odm_TRX_HWAntDivInit( IN PDM_ODM_T pDM_Odm ) @@ -134,7 +134,7 @@ odm_TRX_HWAntDivInit( //ODM_SetBBReg(pDM_Odm, 0xa00 , BIT15, 1); //Enable CCK AntDiv } -VOID +static VOID odm_FastAntTrainingInit( IN PDM_ODM_T pDM_Odm ) @@ -316,7 +316,7 @@ ODM_UpdateRxIdleAnt_88E(IN PDM_ODM_T pDM_Odm, IN u1Byte Ant) } -VOID +static VOID odm_UpdateTxAnt_88E(IN PDM_ODM_T pDM_Odm, IN u1Byte Ant, IN u4Byte MacId) { pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; @@ -407,7 +407,7 @@ ODM_AntselStatistics_88E( } #define TX_BY_REG 0 -VOID +static VOID odm_HWAntDiv( IN PDM_ODM_T pDM_Odm ) diff --git a/hal/rtl8188eu_led.c b/hal/rtl8188eu_led.c index a0fe48f..db5fa4d 100644 --- a/hal/rtl8188eu_led.c +++ b/hal/rtl8188eu_led.c @@ -22,8 +22,8 @@ #include #include #include +#include -//================================================================================ // LED object. //================================================================================ @@ -41,11 +41,7 @@ // Description: // Turn on LED according to LedPin specified. // -void -SwLedOn( - _adapter *padapter, - PLED_871x pLed -) +void SwLedOn(_adapter *padapter, PLED_871x pLed) { u8 LedCfg; //HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); @@ -78,11 +74,7 @@ SwLedOn( // Description: // Turn off LED according to LedPin specified. // -void -SwLedOff( - _adapter *padapter, - PLED_871x pLed -) +void SwLedOff(_adapter *padapter, PLED_871x pLed) { u8 LedCfg; HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); diff --git a/include/odm.h b/include/odm.h index c24908f..57c77c4 100644 --- a/include/odm.h +++ b/include/odm.h @@ -353,7 +353,7 @@ typedef struct _EDCA_TURBO_ { BOOLEAN bCurrentTurboEDCA; BOOLEAN bIsCurRDLState; - #if (DM_ODM_SUPPORT_TYPE == ODM_CE ) + #if (DM_ODM_SUPPORT_TYPE == ODM_CE) u4Byte prv_traffic_idx; // edca turbo #endif diff --git a/include/rtl8188e_led.h b/include/rtl8188e_led.h index 2bafb83..1154d8b 100644 --- a/include/rtl8188e_led.h +++ b/include/rtl8188e_led.h @@ -28,19 +28,10 @@ //================================================================================ // Interface to manipulate LED objects. //================================================================================ -#ifdef CONFIG_USB_HCI void rtl8188eu_InitSwLeds(PADAPTER padapter); void rtl8188eu_DeInitSwLeds(PADAPTER padapter); -#endif -#ifdef CONFIG_PCI_HCI -void rtl8188ee_gen_RefreshLedState(PADAPTER Adapter); -void rtl8188ee_InitSwLeds(PADAPTER padapter); -void rtl8188ee_DeInitSwLeds(PADAPTER padapter); -#endif -#ifdef CONFIG_SDIO_HCI -void rtl8188es_InitSwLeds(PADAPTER padapter); -void rtl8188es_DeInitSwLeds(PADAPTER padapter); -#endif +void SwLedOn(_adapter *padapter, PLED_871x pLed); +void SwLedOff(_adapter *padapter, PLED_871x pLed); #endif diff --git a/include/rtw_debug.h b/include/rtw_debug.h index 556393c..a60db4f 100644 --- a/include/rtw_debug.h +++ b/include/rtw_debug.h @@ -290,14 +290,14 @@ extern void rtl871x_cedbg(const char *fmt, ...); off_t offset, int count, int *eof, void *data); - int proc_set_write_reg(struct file *file, const char *buffer, + int proc_set_write_reg(struct file *file, const char __user *buffer, unsigned long count, void *data); int proc_get_read_reg(char *page, char **start, off_t offset, int count, int *eof, void *data); - int proc_set_read_reg(struct file *file, const char *buffer, + int proc_set_read_reg(struct file *file, const char __user *buffer, unsigned long count, void *data); @@ -401,7 +401,7 @@ extern void rtl871x_cedbg(const char *fmt, ...); off_t offset, int count, int *eof, void *data); - int proc_set_rx_signal(struct file *file, const char *buffer, + int proc_set_rx_signal(struct file *file, const char __user *buffer, unsigned long count, void *data); #ifdef CONFIG_80211N_HT @@ -409,28 +409,28 @@ extern void rtl871x_cedbg(const char *fmt, ...); off_t offset, int count, int *eof, void *data); - int proc_set_ht_enable(struct file *file, const char *buffer, + int proc_set_ht_enable(struct file *file, const char __user *buffer, unsigned long count, void *data); int proc_get_cbw40_enable(char *page, char **start, off_t offset, int count, int *eof, void *data); - int proc_set_cbw40_enable(struct file *file, const char *buffer, + int proc_set_cbw40_enable(struct file *file, const char __user *buffer, unsigned long count, void *data); int proc_get_ampdu_enable(char *page, char **start, off_t offset, int count, int *eof, void *data); - int proc_set_ampdu_enable(struct file *file, const char *buffer, + int proc_set_ampdu_enable(struct file *file, const char __user *buffer, unsigned long count, void *data); int proc_get_rx_stbc(char *page, char **start, off_t offset, int count, int *eof, void *data); - int proc_set_rx_stbc(struct file *file, const char *buffer, + int proc_set_rx_stbc(struct file *file, const char __user *buffer, unsigned long count, void *data); #endif //CONFIG_80211N_HT @@ -442,7 +442,7 @@ extern void rtl871x_cedbg(const char *fmt, ...); off_t offset, int count, int *eof, void *data); - int proc_set_rssi_disp(struct file *file, const char *buffer, + int proc_set_rssi_disp(struct file *file, const char __user *buffer, unsigned long count, void *data); #ifdef CONFIG_BT_COEXIST diff --git a/include/rtw_mlme.h b/include/rtw_mlme.h index 57ab4cc..52bdf08 100644 --- a/include/rtw_mlme.h +++ b/include/rtw_mlme.h @@ -577,6 +577,14 @@ extern void hostapd_mode_unload(_adapter *padapter); #endif +extern unsigned char WPA_TKIP_CIPHER[4]; +extern unsigned char RSN_TKIP_CIPHER[4]; + +extern unsigned char REALTEK_96B_IE[]; + +extern unsigned char MCS_rate_2R[16]; +extern unsigned char MCS_rate_1R[16]; + extern void rtw_joinbss_event_prehandle(_adapter *adapter, u8 *pbuf); extern void rtw_survey_event_callback(_adapter *adapter, u8 *pbuf); extern void rtw_surveydone_event_callback(_adapter *adapter, u8 *pbuf); @@ -585,6 +593,9 @@ extern void rtw_stassoc_event_callback(_adapter *adapter, u8 *pbuf); extern void rtw_stadel_event_callback(_adapter *adapter, u8 *pbuf); extern void rtw_atimdone_event_callback(_adapter *adapter, u8 *pbuf); extern void rtw_cpwm_event_callback(_adapter *adapter, u8 *pbuf); +void indicate_wx_scan_complete_event(_adapter *padapter); +void rtw_indicate_wx_assoc_event(_adapter *padapter); +void rtw_indicate_wx_disassoc_event(_adapter *padapter); #ifdef PLATFORM_WINDOWS extern thread_return event_thread(void *context); diff --git a/include/rtw_mp_ioctl.h b/include/rtw_mp_ioctl.h index 962bc38..9e8b013 100644 --- a/include/rtw_mp_ioctl.h +++ b/include/rtw_mp_ioctl.h @@ -204,7 +204,7 @@ NDIS_STATUS oid_rt_pro_trigger_gpio_hdl(struct oid_par_priv *poid_par_priv); #ifdef _RTW_MP_IOCTL_C_ -const struct oid_obj_priv oid_rtl_seg_81_80_00[] = +static const struct oid_obj_priv oid_rtl_seg_81_80_00[] = { {1, &oid_null_function}, //0x00 OID_RT_PRO_RESET_DUT {1, &oid_rt_pro_set_data_rate_hdl}, //0x01 @@ -241,7 +241,7 @@ const struct oid_obj_priv oid_rtl_seg_81_80_00[] = }; -const struct oid_obj_priv oid_rtl_seg_81_80_20[] = +static const struct oid_obj_priv oid_rtl_seg_81_80_20[] = { {1, &oid_null_function}, //0x20 OID_RT_PRO_READ_POWER_CONTROL {1, &oid_null_function}, //0x21 OID_RT_PRO_WRITE_EEPROM @@ -262,7 +262,7 @@ const struct oid_obj_priv oid_rtl_seg_81_80_20[] = }; -const struct oid_obj_priv oid_rtl_seg_81_80_40[] = +static const struct oid_obj_priv oid_rtl_seg_81_80_40[] = { {1, &oid_null_function}, //0x40 {1, &oid_null_function}, //0x41 @@ -272,7 +272,7 @@ const struct oid_obj_priv oid_rtl_seg_81_80_40[] = {1, &oid_null_function} //0x45 }; -const struct oid_obj_priv oid_rtl_seg_81_80_80[] = +static const struct oid_obj_priv oid_rtl_seg_81_80_80[] = { {1, &oid_null_function}, //0x80 OID_RT_DRIVER_OPTION {1, &oid_null_function}, //0x81 OID_RT_RF_OFF @@ -280,12 +280,12 @@ const struct oid_obj_priv oid_rtl_seg_81_80_80[] = }; -const struct oid_obj_priv oid_rtl_seg_81_85[] = +static const struct oid_obj_priv oid_rtl_seg_81_85[] = { {1, &oid_rt_wireless_mode_hdl} //0x00 OID_RT_WIRELESS_MODE }; -struct oid_obj_priv oid_rtl_seg_81_87[] = +static struct oid_obj_priv oid_rtl_seg_81_87[] = { {1, &oid_null_function}, //0x80 OID_RT_PRO8187_WI_POLL {1, &oid_rt_pro_write_bb_reg_hdl}, //0x81 @@ -294,7 +294,7 @@ struct oid_obj_priv oid_rtl_seg_81_87[] = {1, &oid_rt_pro_read_rf_reg_hdl} //0x83 }; -struct oid_obj_priv oid_rtl_seg_87_11_00[] = +static struct oid_obj_priv oid_rtl_seg_87_11_00[] = { {1, &oid_rt_pro8711_join_bss_hdl}, //0x00 //S {1, &oid_rt_pro_read_register_hdl}, //0x01 @@ -330,7 +330,7 @@ struct oid_obj_priv oid_rtl_seg_87_11_00[] = {1, &oid_rt_poll_rx_status_hdl} //0X1F }; -struct oid_obj_priv oid_rtl_seg_87_11_20[] = +static struct oid_obj_priv oid_rtl_seg_87_11_20[] = { {1, &oid_rt_pro_cfg_debug_message_hdl}, //0x20 {1, &oid_rt_pro_set_data_rate_ex_hdl}, //0x21 @@ -340,23 +340,23 @@ struct oid_obj_priv oid_rtl_seg_87_11_20[] = }; -struct oid_obj_priv oid_rtl_seg_87_11_50[] = +static struct oid_obj_priv oid_rtl_seg_87_11_50[] = { {1, &oid_rt_pro_qry_pwrstate_hdl}, //0x50 {1, &oid_rt_pro_set_pwrstate_hdl} //0x51 }; -struct oid_obj_priv oid_rtl_seg_87_11_80[] = +static struct oid_obj_priv oid_rtl_seg_87_11_80[] = { {1, &oid_null_function} //0x80 }; -struct oid_obj_priv oid_rtl_seg_87_11_B0[] = +static struct oid_obj_priv oid_rtl_seg_87_11_B0[] = { {1, &oid_null_function} //0xB0 }; -struct oid_obj_priv oid_rtl_seg_87_11_F0[] = +static struct oid_obj_priv oid_rtl_seg_87_11_F0[] = { {1, &oid_null_function}, //0xF0 {1, &oid_null_function}, //0xF1 @@ -377,7 +377,7 @@ struct oid_obj_priv oid_rtl_seg_87_11_F0[] = }; -struct oid_obj_priv oid_rtl_seg_87_12_00[]= +static struct oid_obj_priv oid_rtl_seg_87_12_00[]= { {1, &oid_rt_pro_encryption_ctrl_hdl}, //0x00 Q&S {1, &oid_rt_pro_add_sta_info_hdl}, //0x01 S @@ -403,25 +403,6 @@ struct oid_obj_priv oid_rtl_seg_87_12_00[]= {1, &oid_rt_get_power_mode_hdl} //0x15 Q OID_RT_GET_POWER_MODE }; -#else /* _RTL871X_MP_IOCTL_C_ */ - -extern struct oid_obj_priv oid_rtl_seg_81_80_00[32]; -extern struct oid_obj_priv oid_rtl_seg_81_80_20[16]; -extern struct oid_obj_priv oid_rtl_seg_81_80_40[6]; -extern struct oid_obj_priv oid_rtl_seg_81_80_80[3]; - -extern struct oid_obj_priv oid_rtl_seg_81_85[1]; -extern struct oid_obj_priv oid_rtl_seg_81_87[5]; - -extern struct oid_obj_priv oid_rtl_seg_87_11_00[32]; -extern struct oid_obj_priv oid_rtl_seg_87_11_20[5]; -extern struct oid_obj_priv oid_rtl_seg_87_11_50[2]; -extern struct oid_obj_priv oid_rtl_seg_87_11_80[1]; -extern struct oid_obj_priv oid_rtl_seg_87_11_B0[1]; -extern struct oid_obj_priv oid_rtl_seg_87_11_F0[16]; - -extern struct oid_obj_priv oid_rtl_seg_87_12_00[32]; - #endif /* _RTL871X_MP_IOCTL_C_ */ struct rwreg_param{ diff --git a/os_dep/ioctl_linux.c b/os_dep/ioctl_linux.c index 12a6a93..84b508c 100644 --- a/os_dep/ioctl_linux.c +++ b/os_dep/ioctl_linux.c @@ -96,7 +96,7 @@ extern u8 key_2char2num(u8 hch, u8 lch); extern u8 str_2char2num(u8 hch, u8 lch); extern u8 convert_ip_addr(u8 hch, u8 mch, u8 lch); -u32 rtw_rates[] = {1000000,2000000,5500000,11000000, +static u32 rtw_rates[] = {1000000,2000000,5500000,11000000, 6000000,9000000,12000000,18000000,24000000,36000000,48000000,54000000}; static const char * const iw_operation_mode[] = @@ -272,8 +272,8 @@ uint rtw_is_cckrates_included(u8 *rate) while (rate[i]!=0) { - if ( (((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) || - (((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) ) + if ( (((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) || + (((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22)) return _TRUE; i++; } @@ -287,8 +287,8 @@ uint rtw_is_cckratesonly_included(u8 *rate) while (rate[i]!=0) { - if ( (((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) && - (((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22) ) + if ( (((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) && + (((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22)) return _FALSE; i++; } @@ -319,12 +319,12 @@ static char *translate_scan(_adapter *padapter, #ifdef CONFIG_P2P #ifdef CONFIG_WFD - if ( SCAN_RESULT_ALL == pwdinfo->wfd_info->scan_result_type ) + if (SCAN_RESULT_ALL == pwdinfo->wfd_info->scan_result_type) { } - else if ( ( SCAN_RESULT_P2P_ONLY == pwdinfo->wfd_info->scan_result_type ) || - ( SCAN_RESULT_WFD_TYPE == pwdinfo->wfd_info->scan_result_type ) ) + else if ((SCAN_RESULT_P2P_ONLY == pwdinfo->wfd_info->scan_result_type) || + (SCAN_RESULT_WFD_TYPE == pwdinfo->wfd_info->scan_result_type)) #endif // CONFIG_WFD { if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) @@ -336,26 +336,26 @@ static char *translate_scan(_adapter *padapter, // If not, the driver should ignore this AP and go to the next AP. // Verifying the SSID - if ( _rtw_memcmp( pnetwork->network.Ssid.Ssid, pwdinfo->p2p_wildcard_ssid, P2P_WILDCARD_SSID_LEN ) ) + if (_rtw_memcmp(pnetwork->network.Ssid.Ssid, pwdinfo->p2p_wildcard_ssid, P2P_WILDCARD_SSID_LEN)) { u32 p2pielen = 0; if (pnetwork->network.Reserved[0] == 2) { // Probe Request // Verifying the P2P IE - if ( rtw_get_p2p_ie( pnetwork->network.IEs, pnetwork->network.IELength, NULL, &p2pielen) ) + if (rtw_get_p2p_ie(pnetwork->network.IEs, pnetwork->network.IELength, NULL, &p2pielen)) { blnGotP2PIE = _TRUE; } } else { // Beacon or Probe Respones // Verifying the P2P IE - if ( rtw_get_p2p_ie( &pnetwork->network.IEs[12], pnetwork->network.IELength - 12, NULL, &p2pielen) ) + if (rtw_get_p2p_ie(&pnetwork->network.IEs[12], pnetwork->network.IELength - 12, NULL, &p2pielen)) { blnGotP2PIE = _TRUE; } } } - if ( blnGotP2PIE == _FALSE ) + if (blnGotP2PIE == _FALSE) { return start; } @@ -364,32 +364,32 @@ static char *translate_scan(_adapter *padapter, } #ifdef CONFIG_WFD - if ( SCAN_RESULT_WFD_TYPE == pwdinfo->wfd_info->scan_result_type ) + if (SCAN_RESULT_WFD_TYPE == pwdinfo->wfd_info->scan_result_type) { u32 blnGotWFD = _FALSE; u8 wfd_ie[ 128 ] = { 0x00 }; uint wfd_ielen = 0; - if ( rtw_get_wfd_ie( &pnetwork->network.IEs[12], pnetwork->network.IELength - 12, wfd_ie, &wfd_ielen ) ) + if (rtw_get_wfd_ie(&pnetwork->network.IEs[12], pnetwork->network.IELength - 12, wfd_ie, &wfd_ielen)) { u8 wfd_devinfo[ 6 ] = { 0x00 }; uint wfd_devlen = 6; - if ( rtw_get_wfd_attr_content( wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, wfd_devinfo, &wfd_devlen) ) + if (rtw_get_wfd_attr_content(wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, wfd_devinfo, &wfd_devlen)) { - if ( pwdinfo->wfd_info->wfd_device_type == WFD_DEVINFO_PSINK ) + if (pwdinfo->wfd_info->wfd_device_type == WFD_DEVINFO_PSINK) { // the first two bits will indicate the WFD device type - if ( ( wfd_devinfo[ 1 ] & 0x03 ) == WFD_DEVINFO_SOURCE ) + if ((wfd_devinfo[ 1 ] & 0x03) == WFD_DEVINFO_SOURCE) { // If this device is Miracast PSink device, the scan reuslt should just provide the Miracast source. blnGotWFD = _TRUE; } } - else if ( pwdinfo->wfd_info->wfd_device_type == WFD_DEVINFO_SOURCE ) + else if (pwdinfo->wfd_info->wfd_device_type == WFD_DEVINFO_SOURCE) { // the first two bits will indicate the WFD device type - if ( ( wfd_devinfo[ 1 ] & 0x03 ) == WFD_DEVINFO_PSINK ) + if ((wfd_devinfo[ 1 ] & 0x03) == WFD_DEVINFO_PSINK) { // If this device is Miracast source device, the scan reuslt should just provide the Miracast PSink. // Todo: How about the SSink?! @@ -399,7 +399,7 @@ static char *translate_scan(_adapter *padapter, } } - if ( blnGotWFD == _FALSE ) + if (blnGotWFD == _FALSE) { return start; } @@ -669,7 +669,7 @@ static char *translate_scan(_adapter *padapter, #endif ; - if ( check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE && + if (check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE && is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network)) { ss = padapter->recvpriv.signal_strength; sq = padapter->recvpriv.signal_qual; @@ -891,7 +891,7 @@ _func_enter_; { psta = rtw_get_stainfo(pstapriv, get_bssid(pmlmepriv)); if (psta == NULL) { - //DEBUG_ERR( ("Set wpa_set_encryption: Obtain Sta_info fail\n")); + //DEBUG_ERR(("Set wpa_set_encryption: Obtain Sta_info fail\n")); } else { @@ -949,7 +949,7 @@ _func_enter_; pbcmc_sta=rtw_get_bcmc_stainfo(padapter); if (pbcmc_sta==NULL) { - //DEBUG_ERR( ("Set OID_802_11_ADD_KEY: bcmc stainfo is null\n")); + //DEBUG_ERR(("Set OID_802_11_ADD_KEY: bcmc stainfo is null\n")); } else { @@ -1171,7 +1171,7 @@ static int rtw_set_wpa_ie(_adapter *padapter, char *pie, unsigned short ielen) u16 cnt = 0; u8 eid, wps_oui[4]={0x0,0x50,0xf2,0x04}; - while ( cnt < ielen ) + while (cnt < ielen) { eid = buf[cnt]; @@ -1179,7 +1179,7 @@ static int rtw_set_wpa_ie(_adapter *padapter, char *pie, unsigned short ielen) { DBG_871X("SET WPS_IE\n"); - padapter->securitypriv.wps_ie_len = ( (buf[cnt+1]+2) < (MAX_WPA_IE_LEN<<2)) ? (buf[cnt+1]+2):(MAX_WPA_IE_LEN<<2); + padapter->securitypriv.wps_ie_len = ((buf[cnt+1]+2) < (MAX_WPA_IE_LEN<<2)) ? (buf[cnt+1]+2):(MAX_WPA_IE_LEN<<2); _rtw_memcpy(padapter->securitypriv.wps_ie, &buf[cnt], padapter->securitypriv.wps_ie_len); @@ -1440,7 +1440,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev, int intReturn = _FALSE; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct security_priv *psecuritypriv = &padapter->securitypriv; - struct iw_pmksa* pPMK = ( struct iw_pmksa* ) extra; + struct iw_pmksa* pPMK = (struct iw_pmksa*) extra; u8 strZeroMacAddress[ ETH_ALEN ] = { 0x00 }; u8 strIssueBssid[ ETH_ALEN ] = { 0x00 }; @@ -1457,13 +1457,13 @@ static int rtw_wx_set_pmkid(struct net_device *dev, If cmd is IW_PMKSA_REMOVE, it means the wpa_supplicant wants to remove a PMKID/BSSID from driver. */ - _rtw_memcpy( strIssueBssid, pPMK->bssid.sa_data, ETH_ALEN); - if ( pPMK->cmd == IW_PMKSA_ADD ) + _rtw_memcpy(strIssueBssid, pPMK->bssid.sa_data, ETH_ALEN); + if (pPMK->cmd == IW_PMKSA_ADD) { - DBG_871X( "[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n" ); - if ( _rtw_memcmp( strIssueBssid, strZeroMacAddress, ETH_ALEN ) == _TRUE ) + DBG_871X("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n"); + if (_rtw_memcmp(strIssueBssid, strZeroMacAddress, ETH_ALEN) == _TRUE) { - return( intReturn ); + return(intReturn); } else { @@ -1474,12 +1474,12 @@ static int rtw_wx_set_pmkid(struct net_device *dev, //overwrite PMKID for (j=0 ; jPMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) ==_TRUE ) + if (_rtw_memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) ==_TRUE) { // BSSID is matched, the same AP => rewrite with new PMKID. - DBG_871X( "[rtw_wx_set_pmkid] BSSID exists in the PMKList.\n" ); + DBG_871X("[rtw_wx_set_pmkid] BSSID exists in the PMKList.\n"); - _rtw_memcpy( psecuritypriv->PMKIDList[j].PMKID, pPMK->pmkid, IW_PMKID_LEN); + _rtw_memcpy(psecuritypriv->PMKIDList[j].PMKID, pPMK->pmkid, IW_PMKID_LEN); psecuritypriv->PMKIDList[ j ].bUsed = _TRUE; psecuritypriv->PMKIDIndex = j+1; blInserted = _TRUE; @@ -1490,8 +1490,8 @@ static int rtw_wx_set_pmkid(struct net_device *dev, if (!blInserted) { // Find a new entry - DBG_871X( "[rtw_wx_set_pmkid] Use the new entry index = %d for this PMKID.\n", - psecuritypriv->PMKIDIndex ); + DBG_871X("[rtw_wx_set_pmkid] Use the new entry index = %d for this PMKID.\n", + psecuritypriv->PMKIDIndex); _rtw_memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].Bssid, strIssueBssid, ETH_ALEN); _rtw_memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID, pPMK->pmkid, IW_PMKID_LEN); @@ -1504,28 +1504,28 @@ static int rtw_wx_set_pmkid(struct net_device *dev, } } } - else if ( pPMK->cmd == IW_PMKSA_REMOVE ) + else if (pPMK->cmd == IW_PMKSA_REMOVE) { - DBG_871X( "[rtw_wx_set_pmkid] IW_PMKSA_REMOVE!\n" ); + DBG_871X("[rtw_wx_set_pmkid] IW_PMKSA_REMOVE!\n"); intReturn = _TRUE; for (j=0 ; jPMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) ==_TRUE ) + if (_rtw_memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) ==_TRUE) { // BSSID is matched, the same AP => Remove this PMKID information and reset it. - _rtw_memset( psecuritypriv->PMKIDList[ j ].Bssid, 0x00, ETH_ALEN ); + _rtw_memset(psecuritypriv->PMKIDList[ j ].Bssid, 0x00, ETH_ALEN); psecuritypriv->PMKIDList[ j ].bUsed = _FALSE; break; } } } - else if ( pPMK->cmd == IW_PMKSA_FLUSH ) + else if (pPMK->cmd == IW_PMKSA_FLUSH) { - DBG_871X( "[rtw_wx_set_pmkid] IW_PMKSA_FLUSH!\n" ); - _rtw_memset( &psecuritypriv->PMKIDList[ 0 ], 0x00, sizeof( RT_PMKID_LIST ) * NUM_PMKID_CACHE ); + DBG_871X("[rtw_wx_set_pmkid] IW_PMKSA_FLUSH!\n"); + _rtw_memset(&psecuritypriv->PMKIDList[ 0 ], 0x00, sizeof(RT_PMKID_LIST) * NUM_PMKID_CACHE); psecuritypriv->PMKIDIndex = 0; intReturn = _TRUE; } - return( intReturn ); + return(intReturn); } static int rtw_wx_get_sens(struct net_device *dev, @@ -1589,7 +1589,7 @@ static int rtw_wx_get_range(struct net_device *dev, // TODO: Not used in 802.11b? // range->max_nwid; /* Maximal NWID we are able to set */ - /* Old Frequency (backward compat - moved lower ) */ + /* Old Frequency (backward compat - moved lower) */ // range->old_num_channels; // range->old_num_frequency; // range->old_freq[6]; /* Filler to keep "version" at the same offset */ @@ -1834,9 +1834,9 @@ static int rtw_wx_get_wap(struct net_device *dev, _func_enter_; - if ( ((check_fwstate(pmlmepriv, _FW_LINKED)) == _TRUE) || + if (((check_fwstate(pmlmepriv, _FW_LINKED)) == _TRUE) || ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) == _TRUE) || - ((check_fwstate(pmlmepriv, WIFI_AP_STATE)) == _TRUE) ) + ((check_fwstate(pmlmepriv, WIFI_AP_STATE)) == _TRUE)) { _rtw_memcpy(wrqu->ap_addr.sa_data, pcur_bss->MacAddress, ETH_ALEN); @@ -2038,9 +2038,9 @@ if (padapter->registrypriv.mp_mode == 1) */ #ifdef CONFIG_P2P - if ( pwdinfo->p2p_state != P2P_STATE_NONE ) + if (pwdinfo->p2p_state != P2P_STATE_NONE) { - rtw_p2p_set_pre_state( pwdinfo, rtw_p2p_state( pwdinfo ) ); + rtw_p2p_set_pre_state(pwdinfo, rtw_p2p_state(pwdinfo)); rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH); rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_FULL); rtw_free_network_queue(padapter, _TRUE); @@ -2222,7 +2222,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) { // P2P is enabled - if ( padapter->chip_type == RTL8192D ) + if (padapter->chip_type == RTL8192D) wait_for_surveydone = 300; // Because the 8192du supports more channels. else wait_for_surveydone = 200; @@ -2264,7 +2264,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, { rtw_msleep_os(30); cnt++; - if (cnt > wait_for_surveydone ) + if (cnt > wait_for_surveydone) break; } #endif // CONFIG_DUALMAC_CONCURRENT @@ -2273,7 +2273,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, { rtw_msleep_os(30); cnt++; - if (cnt > wait_for_surveydone ) + if (cnt > wait_for_surveydone) break; } @@ -2429,7 +2429,7 @@ static int rtw_wx_set_essid(struct net_device *dev, len = (wrqu->essid.length < IW_ESSID_MAX_SIZE) ? wrqu->essid.length : IW_ESSID_MAX_SIZE; #endif - if ( wrqu->essid.length != 33 ) + if (wrqu->essid.length != 33) DBG_871X("ssid=%s, len=%d\n", extra, wrqu->essid.length); _rtw_memset(&ndis_ssid, 0, sizeof(NDIS_802_11_SSID)); @@ -2535,7 +2535,7 @@ static int rtw_wx_get_essid(struct net_device *dev, _func_enter_; - if ( (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) || + if ((check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) || (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE)) { len = pcur_bss->Ssid.SsidLength; @@ -2642,7 +2642,7 @@ set_rate: RT_TRACE(_module_rtl871x_ioctl_os_c,_drv_info_,("datarate_inx=%d\n",datarates[i])); } - if ( rtw_setdatarate_cmd(padapter, datarates) !=_SUCCESS){ + if (rtw_setdatarate_cmd(padapter, datarates) !=_SUCCESS){ RT_TRACE(_module_rtl871x_ioctl_os_c,_drv_err_,("rtw_wx_set_rate Fail!!!\n")); ret = -1; } @@ -2929,7 +2929,7 @@ static int rtw_wx_set_enc(struct net_device *dev, _rtw_memcpy(wep.KeyMaterial, keybuf, wep.KeyLength); if (rtw_set_802_11_add_wep(padapter, &wep) == _FALSE) { - if (rf_on == pwrpriv->rf_pwrstate ) + if (rf_on == pwrpriv->rf_pwrstate) ret = -EOPNOTSUPP; goto exit; } @@ -3123,7 +3123,7 @@ static int rtw_wx_set_auth(struct net_device *dev, case IW_AUTH_TKIP_COUNTERMEASURES: { - if ( param->value ) + if (param->value) { // wpa_supplicant is enabling the tkip countermeasure. padapter->securitypriv.btkip_countermeasure = _TRUE; } @@ -3552,7 +3552,7 @@ static int rtw_wx_set_channel_plan(struct net_device *dev, pmlmepriv->ChannelPlan = pregistrypriv->channel_plan; #endif - if ( _SUCCESS == rtw_set_chplan_cmd(padapter, channel_plan_req, 1) ) { + if (_SUCCESS == rtw_set_chplan_cmd(padapter, channel_plan_req, 1)) { DBG_871X("%s set channel_plan = 0x%02X\n", __func__, pmlmepriv->ChannelPlan); } else return -EPERM; @@ -3585,7 +3585,7 @@ static int rtw_wx_get_sensitivity(struct net_device *dev, // Modified by Albert 20110914 // This is in dbm format for MTK platform. wrqu->qual.level = padapter->recvpriv.rssi; - DBG_871X(" level = %u\n", wrqu->qual.level ); + DBG_871X(" level = %u\n", wrqu->qual.level); #endif return 0; } @@ -3634,7 +3634,7 @@ struct iw_point _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *p = &wrqu->data; - if ( (!p->length) || (!p->pointer)){ + if ((!p->length) || (!p->pointer)){ ret = -EINVAL; goto _rtw_drvext_hdl_exit; } @@ -3670,7 +3670,7 @@ struct iw_point //check subcode - if ( poidparam->subcode >= MAX_DRVEXT_HANDLERS) + if (poidparam->subcode >= MAX_DRVEXT_HANDLERS) { RT_TRACE(_module_rtl871x_ioctl_os_c,_drv_err_,("no matching drvext handlers\r\n")); ret = -EINVAL; @@ -3678,7 +3678,7 @@ struct iw_point } - if ( poidparam->subcode >= MAX_DRVEXT_OID_SUBCODES) + if (poidparam->subcode >= MAX_DRVEXT_OID_SUBCODES) { RT_TRACE(_module_rtl871x_ioctl_os_c,_drv_err_,("no matching drvext subcodes\r\n")); ret = -EINVAL; @@ -3799,7 +3799,7 @@ static void rtw_dbg_mode_hdl(_adapter *padapter, u32 id, u8 *pdata, u32 len) break; case GEN_MP_IOCTL_SUBCODE(TRIGGER_GPIO): DBG_871X("==> trigger gpio 0\n"); - rtw_hal_set_hwreg(padapter, HW_VAR_TRIGGER_GPIO_0, 0); + rtw_hal_set_hwreg(padapter, HW_VAR_TRIGGER_GPIO_0, NULL); break; #ifdef CONFIG_BT_COEXIST case GEN_MP_IOCTL_SUBCODE(SET_DM_BT): @@ -4044,7 +4044,7 @@ static int rtw_get_ap_info(struct net_device *dev, if (pdata->length>=34) { - if (copy_to_user((u8*)pdata->pointer+32, (u8*)&pdata->flags, 1)) + if (copy_to_user(pdata->pointer+32, (u8*)&pdata->flags, 1)) { ret= -EINVAL; goto exit; @@ -4101,7 +4101,7 @@ static int rtw_wps_start(struct net_device *dev, u32 u32wps_start = 0; unsigned int uintRet = 0; - uintRet = copy_from_user( ( void* ) &u32wps_start, pdata->pointer, 4 ); + uintRet = copy_from_user((void*) &u32wps_start, pdata->pointer, 4); if ((padapter->bDriverStopped) || (pdata==NULL)) { @@ -4109,22 +4109,22 @@ static int rtw_wps_start(struct net_device *dev, goto exit; } - if ( u32wps_start == 0 ) + if (u32wps_start == 0) { u32wps_start = *extra; } - DBG_871X( "[%s] wps_start = %d\n", __func__, u32wps_start ); + DBG_871X("[%s] wps_start = %d\n", __func__, u32wps_start); - if ( u32wps_start == 1 ) // WPS Start + if (u32wps_start == 1) // WPS Start { rtw_led_control(padapter, LED_CTL_START_WPS); } - else if ( u32wps_start == 2 ) // WPS Stop because of wps success + else if (u32wps_start == 2) // WPS Stop because of wps success { rtw_led_control(padapter, LED_CTL_STOP_WPS); } - else if ( u32wps_start == 3 ) // WPS Stop because of wps fail + else if (u32wps_start == 3) // WPS Stop because of wps fail { rtw_led_control(padapter, LED_CTL_STOP_WPS_FAIL); } @@ -4154,7 +4154,7 @@ static int rtw_wext_p2p_enable(struct net_device *dev, struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv; enum P2P_ROLE init_role = P2P_ROLE_DISABLE; - if (*extra == '0' ) + if (*extra == '0') init_role = P2P_ROLE_DISABLE; else if (*extra == '1') init_role = P2P_ROLE_DEVICE; @@ -4191,8 +4191,8 @@ static int rtw_wext_p2p_enable(struct net_device *dev, struct mlme_priv *pbuddy_mlmepriv = &pbuddy_adapter->mlmepriv; struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; - _set_timer( &pwdinfo->ap_p2p_switch_timer, pwdinfo->ext_listen_interval ); - if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) ) + _set_timer(&pwdinfo->ap_p2p_switch_timer, pwdinfo->ext_listen_interval); + if (check_fwstate(pbuddy_mlmepriv, _FW_LINKED)) { pwdinfo->operating_channel = pbuddy_mlmeext->cur_channel; // How about the ch_offset and bwmode ?? @@ -4235,9 +4235,9 @@ static int rtw_p2p_set_go_nego_ssid(struct net_device *dev, struct iw_point *pdata = &wrqu->data; struct wifidirect_info *pwdinfo= &(padapter->wdinfo); - DBG_871X( "[%s] ssid = %s, len = %zu\n", __func__, extra, strlen( extra ) ); - _rtw_memcpy( pwdinfo->nego_ssid, extra, strlen( extra ) ); - pwdinfo->nego_ssidlen = strlen( extra ); + DBG_871X("[%s] ssid = %s, len = %zu\n", __func__, extra, strlen(extra)); + _rtw_memcpy(pwdinfo->nego_ssid, extra, strlen(extra)); + pwdinfo->nego_ssidlen = strlen(extra); return ret; @@ -4253,7 +4253,7 @@ static int rtw_p2p_set_intent(struct net_device *dev, struct wifidirect_info *pwdinfo= &(padapter->wdinfo); u8 intent = pwdinfo->intent; - switch ( wrqu->data.length ) + switch (wrqu->data.length) { case 1: { @@ -4262,12 +4262,12 @@ static int rtw_p2p_set_intent(struct net_device *dev, } case 2: { - intent = str_2char2num( extra[ 0 ], extra[ 1 ]); + intent = str_2char2num(extra[ 0 ], extra[ 1 ]); break; } } - if ( intent <= 15 ) + if (intent <= 15) { pwdinfo->intent= intent; } @@ -4276,7 +4276,7 @@ static int rtw_p2p_set_intent(struct net_device *dev, ret = -1; } - DBG_871X( "[%s] intent = %d\n", __func__, intent); + DBG_871X("[%s] intent = %d\n", __func__, intent); return ret; @@ -4292,7 +4292,7 @@ static int rtw_p2p_set_listen_ch(struct net_device *dev, struct wifidirect_info *pwdinfo= &(padapter->wdinfo); u8 listen_ch = pwdinfo->listen_channel; // Listen channel number - switch ( wrqu->data.length ) + switch (wrqu->data.length) { case 1: { @@ -4301,12 +4301,12 @@ static int rtw_p2p_set_listen_ch(struct net_device *dev, } case 2: { - listen_ch = str_2char2num( extra[ 0 ], extra[ 1 ]); + listen_ch = str_2char2num(extra[ 0 ], extra[ 1 ]); break; } } - if ( ( listen_ch == 1 ) || ( listen_ch == 6 ) || ( listen_ch == 11 ) ) + if ((listen_ch == 1) || (listen_ch == 6) || (listen_ch == 11)) { pwdinfo->listen_channel = listen_ch; set_channel_bwmode(padapter, pwdinfo->listen_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); @@ -4316,7 +4316,7 @@ static int rtw_p2p_set_listen_ch(struct net_device *dev, ret = -1; } - DBG_871X( "[%s] listen_ch = %d\n", __func__, pwdinfo->listen_channel ); + DBG_871X("[%s] listen_ch = %d\n", __func__, pwdinfo->listen_channel); return ret; @@ -4334,7 +4334,7 @@ static int rtw_p2p_set_op_ch(struct net_device *dev, struct wifidirect_info *pwdinfo= &(padapter->wdinfo); u8 op_ch = pwdinfo->operating_channel; // Operating channel number - switch ( wrqu->data.length ) + switch (wrqu->data.length) { case 1: { @@ -4343,12 +4343,12 @@ static int rtw_p2p_set_op_ch(struct net_device *dev, } case 2: { - op_ch = str_2char2num( extra[ 0 ], extra[ 1 ]); + op_ch = str_2char2num(extra[ 0 ], extra[ 1 ]); break; } } - if ( op_ch > 0 ) + if (op_ch > 0) { pwdinfo->operating_channel = op_ch; } @@ -4357,7 +4357,7 @@ static int rtw_p2p_set_op_ch(struct net_device *dev, ret = -1; } - DBG_871X( "[%s] op_ch = %d\n", __func__, pwdinfo->operating_channel ); + DBG_871X("[%s] op_ch = %d\n", __func__, pwdinfo->operating_channel); return ret; @@ -4379,25 +4379,25 @@ static int rtw_p2p_profilefound(struct net_device *dev, // Ex: 1XX:XX:XX:XX:XX:XXYYSSID // 0 => Reflush the profile record list. // 1 => Add the profile list - // XX:XX:XX:XX:XX:XX => peer's MAC Address ( ex: 00:E0:4C:00:00:01 ) + // XX:XX:XX:XX:XX:XX => peer's MAC Address (ex: 00:E0:4C:00:00:01) // YY => SSID Length // SSID => SSID for persistence group - DBG_871X( "[%s] In value = %s, len = %d\n", __func__, extra, wrqu->data.length -1); + DBG_871X("[%s] In value = %s, len = %d\n", __func__, extra, wrqu->data.length -1); // The upper application should pass the SSID to driver by using this rtw_p2p_profilefound function. if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) { - if ( extra[ 0 ] == '0' ) + if (extra[ 0 ] == '0') { // Remove all the profile information of wifidirect_info structure. - _rtw_memset( &pwdinfo->profileinfo[ 0 ], 0x00, sizeof( struct profile_info ) * P2P_MAX_PERSISTENT_GROUP_NUM ); + _rtw_memset(&pwdinfo->profileinfo[ 0 ], 0x00, sizeof(struct profile_info) * P2P_MAX_PERSISTENT_GROUP_NUM); pwdinfo->profileindex = 0; } else { - if ( pwdinfo->profileindex >= P2P_MAX_PERSISTENT_GROUP_NUM ) + if (pwdinfo->profileindex >= P2P_MAX_PERSISTENT_GROUP_NUM) { ret = -1; } @@ -4407,13 +4407,13 @@ static int rtw_p2p_profilefound(struct net_device *dev, // Add this profile information into pwdinfo->profileinfo // Ex: 1XX:XX:XX:XX:XX:XXYYSSID - for ( jj = 0, kk = 1; jj < ETH_ALEN; jj++, kk += 3 ) + for (jj = 0, kk = 1; jj < ETH_ALEN; jj++, kk += 3) { pwdinfo->profileinfo[ pwdinfo->profileindex ].peermac[ jj ] = key_2char2num(extra[ kk ], extra[ kk+ 1 ]); } - pwdinfo->profileinfo[ pwdinfo->profileindex ].ssidlen = ( extra[18] - '0' ) * 10 + ( extra[ 19 ] - '0' ); - _rtw_memcpy( pwdinfo->profileinfo[ pwdinfo->profileindex ].ssid, &extra[ 20 ], pwdinfo->profileinfo[ pwdinfo->profileindex ].ssidlen ); + pwdinfo->profileinfo[ pwdinfo->profileindex ].ssidlen = (extra[18] - '0') * 10 + (extra[ 19 ] - '0'); + _rtw_memcpy(pwdinfo->profileinfo[ pwdinfo->profileindex ].ssid, &extra[ 20 ], pwdinfo->profileinfo[ pwdinfo->profileindex ].ssidlen); pwdinfo->profileindex++; } } @@ -4433,9 +4433,9 @@ static int rtw_p2p_setDN(struct net_device *dev, struct wifidirect_info *pwdinfo= &(padapter->wdinfo); - DBG_871X( "[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); - _rtw_memset( pwdinfo->device_name, 0x00, WPS_MAX_DEVICE_NAME_LEN ); - _rtw_memcpy( pwdinfo->device_name, extra, wrqu->data.length - 1 ); + DBG_871X("[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); + _rtw_memset(pwdinfo->device_name, 0x00, WPS_MAX_DEVICE_NAME_LEN); + _rtw_memcpy(pwdinfo->device_name, extra, wrqu->data.length - 1); pwdinfo->device_name_len = wrqu->data.length - 1; return ret; @@ -4451,7 +4451,7 @@ static int rtw_p2p_get_status(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); #ifdef CONFIG_CONCURRENT_MODE _adapter *pbuddy_adapter = padapter->pbuddy_adapter; struct wifidirect_info *pbuddy_wdinfo = &pbuddy_adapter->wdinfo; @@ -4459,9 +4459,9 @@ static int rtw_p2p_get_status(struct net_device *dev, struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv; #endif - if ( padapter->bShowGetP2PState ) + if (padapter->bShowGetP2PState) { - DBG_871X( "[%s] Role = %d, Status = %d, peer addr = %.2X:%.2X:%.2X:%.2X:%.2X:%.2X\n", __func__, rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo), + DBG_871X("[%s] Role = %d, Status = %d, peer addr = %.2X:%.2X:%.2X:%.2X:%.2X:%.2X\n", __func__, rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo), pwdinfo->p2p_peer_interface_addr[ 0 ], pwdinfo->p2p_peer_interface_addr[ 1 ], pwdinfo->p2p_peer_interface_addr[ 2 ], pwdinfo->p2p_peer_interface_addr[ 3 ], pwdinfo->p2p_peer_interface_addr[ 4 ], pwdinfo->p2p_peer_interface_addr[ 5 ]); } @@ -4469,8 +4469,8 @@ static int rtw_p2p_get_status(struct net_device *dev, // Commented by Albert 2010/10/12 // Because of the output size limitation, I had removed the "Role" information. // About the "Role" information, we will use the new private IOCTL to get the "Role" information. - sprintf( extra, "\n\nStatus=%.2d\n", rtw_p2p_state(pwdinfo) ); - wrqu->data.length = strlen( extra ); + sprintf(extra, "\n\nStatus=%.2d\n", rtw_p2p_state(pwdinfo)); + wrqu->data.length = strlen(extra); return ret; @@ -4489,10 +4489,10 @@ static int rtw_p2p_get_req_cm(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); - sprintf( extra, "\n\nCM=%s\n", pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req ); - wrqu->data.length = strlen( extra ); + sprintf(extra, "\n\nCM=%s\n", pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req); + wrqu->data.length = strlen(extra); return ret; } @@ -4506,15 +4506,15 @@ static int rtw_p2p_get_role(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); - DBG_871X( "[%s] Role = %d, Status = %d, peer addr = %.2X:%.2X:%.2X:%.2X:%.2X:%.2X\n", __func__, rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo), + DBG_871X("[%s] Role = %d, Status = %d, peer addr = %.2X:%.2X:%.2X:%.2X:%.2X:%.2X\n", __func__, rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo), pwdinfo->p2p_peer_interface_addr[ 0 ], pwdinfo->p2p_peer_interface_addr[ 1 ], pwdinfo->p2p_peer_interface_addr[ 2 ], pwdinfo->p2p_peer_interface_addr[ 3 ], pwdinfo->p2p_peer_interface_addr[ 4 ], pwdinfo->p2p_peer_interface_addr[ 5 ]); - sprintf( extra, "\n\nRole=%.2d\n", rtw_p2p_role(pwdinfo) ); - wrqu->data.length = strlen( extra ); + sprintf(extra, "\n\nRole=%.2d\n", rtw_p2p_role(pwdinfo)); + wrqu->data.length = strlen(extra); return ret; } @@ -4528,17 +4528,17 @@ static int rtw_p2p_get_peer_ifaddr(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); - DBG_871X( "[%s] Role = %d, Status = %d, peer addr = %.2X:%.2X:%.2X:%.2X:%.2X:%.2X\n", __func__, rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo), + DBG_871X("[%s] Role = %d, Status = %d, peer addr = %.2X:%.2X:%.2X:%.2X:%.2X:%.2X\n", __func__, rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo), pwdinfo->p2p_peer_interface_addr[ 0 ], pwdinfo->p2p_peer_interface_addr[ 1 ], pwdinfo->p2p_peer_interface_addr[ 2 ], pwdinfo->p2p_peer_interface_addr[ 3 ], pwdinfo->p2p_peer_interface_addr[ 4 ], pwdinfo->p2p_peer_interface_addr[ 5 ]); - sprintf( extra, "\nMAC %.2X:%.2X:%.2X:%.2X:%.2X:%.2X", + sprintf(extra, "\nMAC %.2X:%.2X:%.2X:%.2X:%.2X:%.2X", pwdinfo->p2p_peer_interface_addr[ 0 ], pwdinfo->p2p_peer_interface_addr[ 1 ], pwdinfo->p2p_peer_interface_addr[ 2 ], pwdinfo->p2p_peer_interface_addr[ 3 ], pwdinfo->p2p_peer_interface_addr[ 4 ], pwdinfo->p2p_peer_interface_addr[ 5 ]); - wrqu->data.length = strlen( extra ); + wrqu->data.length = strlen(extra); return ret; } @@ -4552,17 +4552,17 @@ static int rtw_p2p_get_peer_devaddr(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); - DBG_871X( "[%s] Role = %d, Status = %d, peer addr = %.2X:%.2X:%.2X:%.2X:%.2X:%.2X\n", __func__, rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo), + DBG_871X("[%s] Role = %d, Status = %d, peer addr = %.2X:%.2X:%.2X:%.2X:%.2X:%.2X\n", __func__, rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo), pwdinfo->rx_prov_disc_info.peerDevAddr[ 0 ], pwdinfo->rx_prov_disc_info.peerDevAddr[ 1 ], pwdinfo->rx_prov_disc_info.peerDevAddr[ 2 ], pwdinfo->rx_prov_disc_info.peerDevAddr[ 3 ], pwdinfo->rx_prov_disc_info.peerDevAddr[ 4 ], pwdinfo->rx_prov_disc_info.peerDevAddr[ 5 ]); - sprintf( extra, "\n%.2X%.2X%.2X%.2X%.2X%.2X", + sprintf(extra, "\n%.2X%.2X%.2X%.2X%.2X%.2X", pwdinfo->rx_prov_disc_info.peerDevAddr[ 0 ], pwdinfo->rx_prov_disc_info.peerDevAddr[ 1 ], pwdinfo->rx_prov_disc_info.peerDevAddr[ 2 ], pwdinfo->rx_prov_disc_info.peerDevAddr[ 3 ], pwdinfo->rx_prov_disc_info.peerDevAddr[ 4 ], pwdinfo->rx_prov_disc_info.peerDevAddr[ 5 ]); - wrqu->data.length = strlen( extra ); + wrqu->data.length = strlen(extra); return ret; } @@ -4576,17 +4576,17 @@ static int rtw_p2p_get_peer_devaddr_by_invitation(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); - DBG_871X( "[%s] Role = %d, Status = %d, peer addr = %.2X:%.2X:%.2X:%.2X:%.2X:%.2X\n", __func__, rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo), + DBG_871X("[%s] Role = %d, Status = %d, peer addr = %.2X:%.2X:%.2X:%.2X:%.2X:%.2X\n", __func__, rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo), pwdinfo->p2p_peer_device_addr[ 0 ], pwdinfo->p2p_peer_device_addr[ 1 ], pwdinfo->p2p_peer_device_addr[ 2 ], pwdinfo->p2p_peer_device_addr[ 3 ], pwdinfo->p2p_peer_device_addr[ 4 ], pwdinfo->p2p_peer_device_addr[ 5 ]); - sprintf( extra, "\nMAC %.2X:%.2X:%.2X:%.2X:%.2X:%.2X", + sprintf(extra, "\nMAC %.2X:%.2X:%.2X:%.2X:%.2X:%.2X", pwdinfo->p2p_peer_device_addr[ 0 ], pwdinfo->p2p_peer_device_addr[ 1 ], pwdinfo->p2p_peer_device_addr[ 2 ], pwdinfo->p2p_peer_device_addr[ 3 ], pwdinfo->p2p_peer_device_addr[ 4 ], pwdinfo->p2p_peer_device_addr[ 5 ]); - wrqu->data.length = strlen( extra ); + wrqu->data.length = strlen(extra); return ret; } @@ -4600,14 +4600,14 @@ static int rtw_p2p_get_groupid(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); - sprintf( extra, "\n%.2X:%.2X:%.2X:%.2X:%.2X:%.2X %s", + sprintf(extra, "\n%.2X:%.2X:%.2X:%.2X:%.2X:%.2X %s", pwdinfo->groupid_info.go_device_addr[ 0 ], pwdinfo->groupid_info.go_device_addr[ 1 ], pwdinfo->groupid_info.go_device_addr[ 2 ], pwdinfo->groupid_info.go_device_addr[ 3 ], pwdinfo->groupid_info.go_device_addr[ 4 ], pwdinfo->groupid_info.go_device_addr[ 5 ], pwdinfo->groupid_info.ssid); - wrqu->data.length = strlen( extra ); + wrqu->data.length = strlen(extra); return ret; } @@ -4621,13 +4621,13 @@ static int rtw_p2p_get_op_ch(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); - DBG_871X( "[%s] Op_ch = %02x\n", __func__, pwdinfo->operating_channel); + DBG_871X("[%s] Op_ch = %02x\n", __func__, pwdinfo->operating_channel); - sprintf( extra, "\n\nOp_ch=%.2d\n", pwdinfo->operating_channel ); - wrqu->data.length = strlen( extra ); + sprintf(extra, "\n\nOp_ch=%.2d\n", pwdinfo->operating_channel); + wrqu->data.length = strlen(extra); return ret; } @@ -4640,7 +4640,7 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); u8 peerMAC[ ETH_ALEN ] = { 0x00 }; int jj,kk; u8 peerMACStr[ 17 ] = { 0x00 }; @@ -4660,15 +4660,15 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev, // After knowing its WPS config method, the application can decide the config method for provisioning discovery. // Format: iwpriv wlanx p2p_get_wpsCM 00:E0:4C:00:00:05 - DBG_871X( "[%s] data = %s\n", __func__, ( char* ) extra ); - if ( copy_from_user(peerMACStr, wrqu->data.pointer + 6 , 17) ) { + DBG_871X("[%s] data = %s\n", __func__, (char*) extra); + if (copy_from_user(peerMACStr, wrqu->data.pointer + 6 , 17)) { return -EFAULT; } - for ( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) + for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3) { - peerMAC[ jj ] = key_2char2num( peerMACStr[kk], peerMACStr[kk+ 1] ); + peerMAC[ jj ] = key_2char2num(peerMACStr[kk], peerMACStr[kk+ 1]); } _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); @@ -4682,20 +4682,20 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev, break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); - if ( _rtw_memcmp( pnetwork->network.MacAddress, peerMAC, ETH_ALEN ) ) + if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) { u8 *wpsie; uint wpsie_len = 0; // The mac address is matched. - if ( (wpsie=rtw_get_wps_ie( &pnetwork->network.IEs[ 12 ], pnetwork->network.IELength - 12, NULL, &wpsie_len )) ) + if ((wpsie=rtw_get_wps_ie(&pnetwork->network.IEs[ 12 ], pnetwork->network.IELength - 12, NULL, &wpsie_len))) { - rtw_get_wps_attr_content( wpsie, wpsie_len, WPS_ATTR_CONF_METHOD, ( u8* ) &attr_content, &attr_contentlen); - if ( attr_contentlen ) + rtw_get_wps_attr_content(wpsie, wpsie_len, WPS_ATTR_CONF_METHOD, (u8*) &attr_content, &attr_contentlen); + if (attr_contentlen) { - attr_content = be16_to_cpu( attr_content ); - sprintf( attr_content_str, "\n\nM=%.4d", attr_content ); + attr_content = be16_to_cpu(attr_content); + sprintf(attr_content_str, "\n\nM=%.4d", attr_content); blnMatch = 1; } } @@ -4709,12 +4709,12 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev, _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - if ( !blnMatch ) + if (!blnMatch) { - sprintf( attr_content_str, "\n\nM=0000" ); + sprintf(attr_content_str, "\n\nM=0000"); } - if ( copy_to_user(wrqu->data.pointer, attr_content_str, 6 + 17)) { + if (copy_to_user(wrqu->data.pointer, attr_content_str, 6 + 17)) { return -EFAULT; } @@ -4731,14 +4731,14 @@ static int rtw_p2p_get_peer_wfd_port(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); - DBG_871X( "[%s] p2p_state = %d\n", __func__, rtw_p2p_state(pwdinfo) ); + DBG_871X("[%s] p2p_state = %d\n", __func__, rtw_p2p_state(pwdinfo)); - sprintf( extra, "\n\nPort=%d\n", pwdinfo->wfd_info->peer_rtsp_ctrlport ); - DBG_871X( "[%s] remote port = %d\n", __func__, pwdinfo->wfd_info->peer_rtsp_ctrlport ); + sprintf(extra, "\n\nPort=%d\n", pwdinfo->wfd_info->peer_rtsp_ctrlport); + DBG_871X("[%s] remote port = %d\n", __func__, pwdinfo->wfd_info->peer_rtsp_ctrlport); - wrqu->data.length = strlen( extra ); + wrqu->data.length = strlen(extra); return ret; } @@ -4751,12 +4751,12 @@ static int rtw_p2p_get_peer_wfd_preferred_connection(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); - sprintf( extra, "\n\nwfd_pc=%d\n", pwdinfo->wfd_info->wfd_pc ); - DBG_871X( "[%s] wfd_pc = %d\n", __func__, pwdinfo->wfd_info->wfd_pc ); + sprintf(extra, "\n\nwfd_pc=%d\n", pwdinfo->wfd_info->wfd_pc); + DBG_871X("[%s] wfd_pc = %d\n", __func__, pwdinfo->wfd_info->wfd_pc); - wrqu->data.length = strlen( extra ); + wrqu->data.length = strlen(extra); pwdinfo->wfd_info->wfd_pc = _FALSE; // Reset the WFD preferred connection to P2P return ret; @@ -4770,12 +4770,12 @@ static int rtw_p2p_get_peer_wfd_session_available(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); - sprintf( extra, "\n\nwfd_sa=%d\n", pwdinfo->wfd_info->peer_session_avail ); - DBG_871X( "[%s] wfd_sa = %d\n", __func__, pwdinfo->wfd_info->peer_session_avail ); + sprintf(extra, "\n\nwfd_sa=%d\n", pwdinfo->wfd_info->peer_session_avail); + DBG_871X("[%s] wfd_sa = %d\n", __func__, pwdinfo->wfd_info->peer_session_avail); - wrqu->data.length = strlen( extra ); + wrqu->data.length = strlen(extra); pwdinfo->wfd_info->peer_session_avail = _TRUE; // Reset the WFD session available return ret; @@ -4791,7 +4791,7 @@ static int rtw_p2p_get_go_device_address(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); u8 peerMAC[ ETH_ALEN ] = { 0x00 }; int jj,kk; u8 peerMACStr[ 17 ] = { 0x00 }; @@ -4812,14 +4812,14 @@ static int rtw_p2p_get_go_device_address(struct net_device *dev, // The input data is the GO's interface address which the application wants to know its device address. // Format: iwpriv wlanx p2p_get2 go_devadd=00:E0:4C:00:00:05 - DBG_871X( "[%s] data = %s\n", __func__, ( char* ) extra ); - if ( copy_from_user(peerMACStr, wrqu->data.pointer + 10 , 17) ) { + DBG_871X("[%s] data = %s\n", __func__, (char*) extra); + if (copy_from_user(peerMACStr, wrqu->data.pointer + 10 , 17)) { return -EFAULT; } - for ( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) + for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3) { - peerMAC[ jj ] = key_2char2num( peerMACStr[kk], peerMACStr[kk+ 1] ); + peerMAC[ jj ] = key_2char2num(peerMACStr[kk], peerMACStr[kk+ 1]); } _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); @@ -4833,28 +4833,28 @@ static int rtw_p2p_get_go_device_address(struct net_device *dev, break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); - if ( _rtw_memcmp( pnetwork->network.MacAddress, peerMAC, ETH_ALEN ) ) + if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) { // Commented by Albert 2011/05/18 // Match the device address located in the P2P IE // This is for the case that the P2P device address is not the same as the P2P interface address. - if ( (p2pie=rtw_get_p2p_ie( &pnetwork->network.IEs[12], pnetwork->network.IELength - 12, NULL, &p2pielen)) ) + if ((p2pie=rtw_get_p2p_ie(&pnetwork->network.IEs[12], pnetwork->network.IELength - 12, NULL, &p2pielen))) { - while ( p2pie ) + while (p2pie) { // The P2P Device ID attribute is included in the Beacon frame. // The P2P Device Info attribute is included in the probe response frame. - _rtw_memset( attr_content, 0x00, 100); - if ( rtw_get_p2p_attr_content( p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen) ) + _rtw_memset(attr_content, 0x00, 100); + if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) { // Handle the P2P Device ID attribute of Beacon first blnMatch = 1; break; } - else if ( rtw_get_p2p_attr_content( p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen) ) + else if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen)) { // Handle the P2P Device Info attribute of probe response blnMatch = 1; @@ -4873,17 +4873,17 @@ static int rtw_p2p_get_go_device_address(struct net_device *dev, _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - if ( !blnMatch ) + if (!blnMatch) { - sprintf( go_devadd_str, "\n\ndev_add=NULL" ); + sprintf(go_devadd_str, "\n\ndev_add=NULL"); } else { - sprintf( go_devadd_str, "\n\ndev_add=%.2X:%.2X:%.2X:%.2X:%.2X:%.2X", - attr_content[ 0 ], attr_content[ 1 ], attr_content[ 2 ], attr_content[ 3 ], attr_content[ 4 ], attr_content[ 5 ] ); + sprintf(go_devadd_str, "\n\ndev_add=%.2X:%.2X:%.2X:%.2X:%.2X:%.2X", + attr_content[ 0 ], attr_content[ 1 ], attr_content[ 2 ], attr_content[ 3 ], attr_content[ 4 ], attr_content[ 5 ]); } - if ( copy_to_user(wrqu->data.pointer, go_devadd_str, 10 + 17)) { + if (copy_to_user(wrqu->data.pointer, go_devadd_str, 10 + 17)) { return -EFAULT; } @@ -4899,7 +4899,7 @@ static int rtw_p2p_get_device_type(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); u8 peerMAC[ ETH_ALEN ] = { 0x00 }; int jj,kk; u8 peerMACStr[ 17 ] = { 0x00 }; @@ -4918,14 +4918,14 @@ static int rtw_p2p_get_device_type(struct net_device *dev, // Such user interface could know the device type. // Format: iwpriv wlanx p2p_get2 dev_type=00:E0:4C:00:00:05 - DBG_871X( "[%s] data = %s\n", __func__, ( char* ) extra ); - if ( copy_from_user(peerMACStr, wrqu->data.pointer + 9 , 17) ) { + DBG_871X("[%s] data = %s\n", __func__, (char*) extra); + if (copy_from_user(peerMACStr, wrqu->data.pointer + 9 , 17)) { return -EFAULT; } - for ( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) + for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3) { - peerMAC[ jj ] = key_2char2num( peerMACStr[kk], peerMACStr[kk+ 1] ); + peerMAC[ jj ] = key_2char2num(peerMACStr[kk], peerMACStr[kk+ 1]); } _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); @@ -4939,23 +4939,23 @@ static int rtw_p2p_get_device_type(struct net_device *dev, break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); - if ( _rtw_memcmp( pnetwork->network.MacAddress, peerMAC, ETH_ALEN ) ) + if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) { u8 *wpsie; uint wpsie_len = 0; // The mac address is matched. - if ( (wpsie=rtw_get_wps_ie( &pnetwork->network.IEs[ 12 ], pnetwork->network.IELength - 12, NULL, &wpsie_len )) ) + if ((wpsie=rtw_get_wps_ie(&pnetwork->network.IEs[ 12 ], pnetwork->network.IELength - 12, NULL, &wpsie_len))) { - rtw_get_wps_attr_content( wpsie, wpsie_len, WPS_ATTR_PRIMARY_DEV_TYPE, dev_type, &dev_type_len); - if ( dev_type_len ) + rtw_get_wps_attr_content(wpsie, wpsie_len, WPS_ATTR_PRIMARY_DEV_TYPE, dev_type, &dev_type_len); + if (dev_type_len) { u16 type = 0; _rtw_memcpy(&type, dev_type, 2); - type = be16_to_cpu( type ); - sprintf( dev_type_str, "\n\nN=%.2d", type ); + type = be16_to_cpu(type); + sprintf(dev_type_str, "\n\nN=%.2d", type); blnMatch = 1; } } @@ -4968,12 +4968,12 @@ static int rtw_p2p_get_device_type(struct net_device *dev, _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - if ( !blnMatch ) + if (!blnMatch) { - sprintf( dev_type_str, "\n\nN=00" ); + sprintf(dev_type_str, "\n\nN=00"); } - if ( copy_to_user(wrqu->data.pointer, dev_type_str, 9 + 17)) { + if (copy_to_user(wrqu->data.pointer, dev_type_str, 9 + 17)) { return -EFAULT; } @@ -4989,7 +4989,7 @@ static int rtw_p2p_get_device_name(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); u8 peerMAC[ ETH_ALEN ] = { 0x00 }; int jj,kk; u8 peerMACStr[ 17 ] = { 0x00 }; @@ -5008,14 +5008,14 @@ static int rtw_p2p_get_device_name(struct net_device *dev, // Such user interface could show peer device's device name instead of ssid. // Format: iwpriv wlanx p2p_get2 devN=00:E0:4C:00:00:05 - DBG_871X( "[%s] data = %s\n", __func__, ( char* ) extra ); - if ( copy_from_user(peerMACStr, wrqu->data.pointer + 5 , 17) ) { + DBG_871X("[%s] data = %s\n", __func__, (char*) extra); + if (copy_from_user(peerMACStr, wrqu->data.pointer + 5 , 17)) { return -EFAULT; } - for ( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) + for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3) { - peerMAC[ jj ] = key_2char2num( peerMACStr[kk], peerMACStr[kk+ 1] ); + peerMAC[ jj ] = key_2char2num(peerMACStr[kk], peerMACStr[kk+ 1]); } _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); @@ -5029,19 +5029,19 @@ static int rtw_p2p_get_device_name(struct net_device *dev, break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); - if ( _rtw_memcmp( pnetwork->network.MacAddress, peerMAC, ETH_ALEN ) ) + if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) { u8 *wpsie; uint wpsie_len = 0; // The mac address is matched. - if ( (wpsie=rtw_get_wps_ie( &pnetwork->network.IEs[ 12 ], pnetwork->network.IELength - 12, NULL, &wpsie_len )) ) + if ((wpsie=rtw_get_wps_ie(&pnetwork->network.IEs[ 12 ], pnetwork->network.IELength - 12, NULL, &wpsie_len))) { - rtw_get_wps_attr_content( wpsie, wpsie_len, WPS_ATTR_DEVICE_NAME, dev_name, &dev_len); - if ( dev_len ) + rtw_get_wps_attr_content(wpsie, wpsie_len, WPS_ATTR_DEVICE_NAME, dev_name, &dev_len); + if (dev_len) { - sprintf( dev_name_str, "\n\nN=%s", dev_name ); + sprintf(dev_name_str, "\n\nN=%s", dev_name); blnMatch = 1; } } @@ -5054,12 +5054,12 @@ static int rtw_p2p_get_device_name(struct net_device *dev, _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - if ( !blnMatch ) + if (!blnMatch) { - sprintf( dev_name_str, "\n\nN=0000" ); + sprintf(dev_name_str, "\n\nN=0000"); } - if ( copy_to_user(wrqu->data.pointer, dev_name_str, 5+ (( dev_len > 17 )? dev_len : 17) )) { + if (copy_to_user(wrqu->data.pointer, dev_name_str, 5+ ((dev_len > 17)? dev_len : 17))) { return -EFAULT; } @@ -5075,7 +5075,7 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); u8 peerMAC[ ETH_ALEN ] = { 0x00 }; int jj,kk; u8 peerMACStr[ 17 ] = { 0x00 }; @@ -5096,14 +5096,14 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev, // The application wants to know P2P initation procedure is support or not. // Format: iwpriv wlanx p2p_get2 InvProc=00:E0:4C:00:00:05 - DBG_871X( "[%s] data = %s\n", __func__, ( char* ) extra ); - if ( copy_from_user(peerMACStr, wrqu->data.pointer + 8 , 17) ) { + DBG_871X("[%s] data = %s\n", __func__, (char*) extra); + if (copy_from_user(peerMACStr, wrqu->data.pointer + 8 , 17)) { return -EFAULT; } - for ( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) + for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3) { - peerMAC[ jj ] = key_2char2num( peerMACStr[kk], peerMACStr[kk+ 1] ); + peerMAC[ jj ] = key_2char2num(peerMACStr[kk], peerMACStr[kk+ 1]); } _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); @@ -5117,18 +5117,18 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev, break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); - if ( _rtw_memcmp( pnetwork->network.MacAddress, peerMAC, ETH_ALEN ) ) + if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) { // Commented by Albert 20121226 // Match the device address located in the P2P IE // This is for the case that the P2P device address is not the same as the P2P interface address. - if ( (p2pie=rtw_get_p2p_ie( &pnetwork->network.IEs[12], pnetwork->network.IELength - 12, NULL, &p2pielen)) ) + if ((p2pie=rtw_get_p2p_ie(&pnetwork->network.IEs[12], pnetwork->network.IELength - 12, NULL, &p2pielen))) { - while ( p2pie ) + while (p2pie) { - //_rtw_memset( attr_content, 0x00, 2); - if ( rtw_get_p2p_attr_content( p2pie, p2pielen, P2P_ATTR_CAPABILITY, attr_content, &attr_contentlen) ) + //_rtw_memset(attr_content, 0x00, 2); + if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_CAPABILITY, attr_content, &attr_contentlen)) { // Handle the P2P capability attribute blnMatch = 1; @@ -5148,20 +5148,20 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev, _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - if ( !blnMatch ) + if (!blnMatch) { - sprintf( inv_proc_str, "\nIP=-1" ); + sprintf(inv_proc_str, "\nIP=-1"); } else { - if ( attr_content[0] && 0x20 ) { - sprintf( inv_proc_str, "\nIP=1" ); + if (attr_content[0] && 0x20) { + sprintf(inv_proc_str, "\nIP=1"); } else { - sprintf( inv_proc_str, "\nIP=0" ); + sprintf(inv_proc_str, "\nIP=0"); } } - if ( copy_to_user(wrqu->data.pointer, inv_proc_str, 8 + 17)) { + if (copy_to_user(wrqu->data.pointer, inv_proc_str, 8 + 17)) { return -EFAULT; } @@ -5176,7 +5176,7 @@ static int rtw_p2p_connect(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); u8 peerMAC[ ETH_ALEN ] = { 0x00 }; int jj,kk; u8 peerMACStr[ ETH_ALEN * 2 ] = { 0x00 }; @@ -5199,22 +5199,22 @@ static int rtw_p2p_connect(struct net_device *dev, // Format: 00:E0:4C:00:00:05 // Format: 00:E0:4C:00:00:05 - DBG_871X( "[%s] data = %s\n", __func__, extra ); + DBG_871X("[%s] data = %s\n", __func__, extra); - if ( pwdinfo->p2p_state == P2P_STATE_NONE ) + if (pwdinfo->p2p_state == P2P_STATE_NONE) { - DBG_871X( "[%s] WiFi Direct is disable!\n", __func__ ); + DBG_871X("[%s] WiFi Direct is disable!\n", __func__); return ret; } - if ( pwdinfo->ui_got_wps_info == P2P_NO_WPSINFO ) + if (pwdinfo->ui_got_wps_info == P2P_NO_WPSINFO) { return -1; } - for ( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) + for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3) { - peerMAC[ jj ] = key_2char2num( extra[kk], extra[kk+ 1] ); + peerMAC[ jj ] = key_2char2num(extra[kk], extra[kk+ 1]); } _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); @@ -5228,7 +5228,7 @@ static int rtw_p2p_connect(struct net_device *dev, break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); - if ( _rtw_memcmp( pnetwork->network.MacAddress, peerMAC, ETH_ALEN ) ) + if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) { uintPeerChannel = pnetwork->network.Configuration.DSConfig; break; @@ -5240,34 +5240,34 @@ static int rtw_p2p_connect(struct net_device *dev, _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - if ( uintPeerChannel ) + if (uintPeerChannel) { #ifdef CONFIG_CONCURRENT_MODE - if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) ) + if (check_fwstate(pbuddy_mlmepriv, _FW_LINKED)) { - _cancel_timer_ex( &pwdinfo->ap_p2p_switch_timer ); + _cancel_timer_ex(&pwdinfo->ap_p2p_switch_timer); } #endif // CONFIG_CONCURRENT_MODE - _rtw_memset( &pwdinfo->nego_req_info, 0x00, sizeof( struct tx_nego_req_info ) ); - _rtw_memset( &pwdinfo->groupid_info, 0x00, sizeof( struct group_id_info ) ); + _rtw_memset(&pwdinfo->nego_req_info, 0x00, sizeof(struct tx_nego_req_info)); + _rtw_memset(&pwdinfo->groupid_info, 0x00, sizeof(struct group_id_info)); pwdinfo->nego_req_info.peer_channel_num[ 0 ] = uintPeerChannel; - _rtw_memcpy( pwdinfo->nego_req_info.peerDevAddr, pnetwork->network.MacAddress, ETH_ALEN ); + _rtw_memcpy(pwdinfo->nego_req_info.peerDevAddr, pnetwork->network.MacAddress, ETH_ALEN); pwdinfo->nego_req_info.benable = _TRUE; - _cancel_timer_ex( &pwdinfo->restore_p2p_state_timer ); - if ( rtw_p2p_state(pwdinfo) != P2P_STATE_GONEGO_OK ) + _cancel_timer_ex(&pwdinfo->restore_p2p_state_timer); + if (rtw_p2p_state(pwdinfo) != P2P_STATE_GONEGO_OK) { // Restore to the listen state if the current p2p state is not nego OK - rtw_p2p_set_state(pwdinfo, P2P_STATE_LISTEN ); + rtw_p2p_set_state(pwdinfo, P2P_STATE_LISTEN); } rtw_p2p_set_pre_state(pwdinfo, rtw_p2p_state(pwdinfo)); rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_ING); #ifdef CONFIG_CONCURRENT_MODE - if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) ) + if (check_fwstate(pbuddy_mlmepriv, _FW_LINKED)) { // Have to enter the power saving with the AP set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode); @@ -5276,25 +5276,25 @@ static int rtw_p2p_connect(struct net_device *dev, } #endif // CONFIG_CONCURRENT_MODE - DBG_871X( "[%s] Start PreTx Procedure!\n", __func__ ); - _set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT ); + DBG_871X("[%s] Start PreTx Procedure!\n", __func__); + _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); #ifdef CONFIG_CONCURRENT_MODE - if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) ) + if (check_fwstate(pbuddy_mlmepriv, _FW_LINKED)) { - _set_timer( &pwdinfo->restore_p2p_state_timer, P2P_CONCURRENT_GO_NEGO_TIMEOUT ); + _set_timer(&pwdinfo->restore_p2p_state_timer, P2P_CONCURRENT_GO_NEGO_TIMEOUT); } else { - _set_timer( &pwdinfo->restore_p2p_state_timer, P2P_GO_NEGO_TIMEOUT ); + _set_timer(&pwdinfo->restore_p2p_state_timer, P2P_GO_NEGO_TIMEOUT); } #else - _set_timer( &pwdinfo->restore_p2p_state_timer, P2P_GO_NEGO_TIMEOUT ); + _set_timer(&pwdinfo->restore_p2p_state_timer, P2P_GO_NEGO_TIMEOUT); #endif // CONFIG_CONCURRENT_MODE } else { - DBG_871X( "[%s] Not Found in Scanning Queue~\n", __func__ ); + DBG_871X("[%s] Not Found in Scanning Queue~\n", __func__); ret = -1; } exit: @@ -5309,7 +5309,7 @@ static int rtw_p2p_invite_req(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); int jj,kk; u8 peerMACStr[ ETH_ALEN * 2 ] = { 0x00 }; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -5339,34 +5339,34 @@ static int rtw_p2p_invite_req(struct net_device *dev, // Command line sample: iwpriv wlan0 p2p_set invite="00:11:22:33:44:55 00:E0:4C:00:00:05 DIRECT-xy" // Format: 00:11:22:33:44:55 00:E0:4C:00:00:05 DIRECT-xy - DBG_871X( "[%s] data = %s\n", __func__, extra ); + DBG_871X("[%s] data = %s\n", __func__, extra); - if ( wrqu->data.length <= 37 ) + if (wrqu->data.length <= 37) { - DBG_871X( "[%s] Wrong format!\n", __func__ ); + DBG_871X("[%s] Wrong format!\n", __func__); return ret; } if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) { - DBG_871X( "[%s] WiFi Direct is disable!\n", __func__ ); + DBG_871X("[%s] WiFi Direct is disable!\n", __func__); return ret; } else { // Reset the content of struct tx_invite_req_info pinvite_req_info->benable = _FALSE; - _rtw_memset( pinvite_req_info->go_bssid, 0x00, ETH_ALEN ); - _rtw_memset( pinvite_req_info->go_ssid, 0x00, WLAN_SSID_MAXLEN ); + _rtw_memset(pinvite_req_info->go_bssid, 0x00, ETH_ALEN); + _rtw_memset(pinvite_req_info->go_ssid, 0x00, WLAN_SSID_MAXLEN); pinvite_req_info->ssidlen = 0x00; pinvite_req_info->operating_ch = pwdinfo->operating_channel; - _rtw_memset( pinvite_req_info->peer_macaddr, 0x00, ETH_ALEN ); + _rtw_memset(pinvite_req_info->peer_macaddr, 0x00, ETH_ALEN); pinvite_req_info->token = 3; } - for ( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) + for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3) { - pinvite_req_info->peer_macaddr[ jj ] = key_2char2num( extra[kk], extra[kk+ 1] ); + pinvite_req_info->peer_macaddr[ jj ] = key_2char2num(extra[kk], extra[kk+ 1]); } _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); @@ -5385,24 +5385,24 @@ static int rtw_p2p_invite_req(struct net_device *dev, // Match the device address located in the P2P IE // This is for the case that the P2P device address is not the same as the P2P interface address. - if ( (p2pie=rtw_get_p2p_ie( &pnetwork->network.IEs[12], pnetwork->network.IELength - 12, NULL, &p2pielen)) ) + if ((p2pie=rtw_get_p2p_ie(&pnetwork->network.IEs[12], pnetwork->network.IELength - 12, NULL, &p2pielen))) { // The P2P Device ID attribute is included in the Beacon frame. // The P2P Device Info attribute is included in the probe response frame. - if ( rtw_get_p2p_attr_content( p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen) ) + if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) { // Handle the P2P Device ID attribute of Beacon first - if ( _rtw_memcmp( attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN ) ) + if (_rtw_memcmp(attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN)) { uintPeerChannel = pnetwork->network.Configuration.DSConfig; break; } } - else if ( rtw_get_p2p_attr_content( p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen) ) + else if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen)) { // Handle the P2P Device Info attribute of probe response - if ( _rtw_memcmp( attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN ) ) + if (_rtw_memcmp(attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN)) { uintPeerChannel = pnetwork->network.Configuration.DSConfig; break; @@ -5418,18 +5418,18 @@ static int rtw_p2p_invite_req(struct net_device *dev, _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); #ifdef CONFIG_WFD - if ( uintPeerChannel ) + if (uintPeerChannel) { u8 wfd_ie[ 128 ] = { 0x00 }; uint wfd_ielen = 0; - if ( rtw_get_wfd_ie( &pnetwork->network.IEs[12], pnetwork->network.IELength - 12, wfd_ie, &wfd_ielen ) ) + if (rtw_get_wfd_ie(&pnetwork->network.IEs[12], pnetwork->network.IELength - 12, wfd_ie, &wfd_ielen)) { u8 wfd_devinfo[ 6 ] = { 0x00 }; uint wfd_devlen = 6; - DBG_871X( "[%s] Found WFD IE!\n", __func__ ); - if ( rtw_get_wfd_attr_content( wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, wfd_devinfo, &wfd_devlen ) ) + DBG_871X("[%s] Found WFD IE!\n", __func__); + if (rtw_get_wfd_attr_content(wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, wfd_devinfo, &wfd_devlen)) { u16 wfd_devinfo_field = 0; @@ -5437,7 +5437,7 @@ static int rtw_p2p_invite_req(struct net_device *dev, // The first two bytes are the WFD device information field of WFD device information subelement. // In big endian format. wfd_devinfo_field = RTW_GET_BE16(wfd_devinfo); - if ( wfd_devinfo_field & WFD_DEVINFO_SESSION_AVAIL ) + if (wfd_devinfo_field & WFD_DEVINFO_SESSION_AVAIL) { pwfd_info->peer_session_avail = _TRUE; } @@ -5448,32 +5448,32 @@ static int rtw_p2p_invite_req(struct net_device *dev, } } - if ( _FALSE == pwfd_info->peer_session_avail ) + if (_FALSE == pwfd_info->peer_session_avail) { - DBG_871X( "[%s] WFD Session not avaiable!\n", __func__ ); + DBG_871X("[%s] WFD Session not avaiable!\n", __func__); goto exit; } } #endif // CONFIG_WFD - if ( uintPeerChannel ) + if (uintPeerChannel) { #ifdef CONFIG_CONCURRENT_MODE - if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) ) + if (check_fwstate(pbuddy_mlmepriv, _FW_LINKED)) { - _cancel_timer_ex( &pwdinfo->ap_p2p_switch_timer ); + _cancel_timer_ex(&pwdinfo->ap_p2p_switch_timer); } #endif // CONFIG_CONCURRENT_MODE // Store the GO's bssid - for ( jj = 0, kk = 18; jj < ETH_ALEN; jj++, kk += 3 ) + for (jj = 0, kk = 18; jj < ETH_ALEN; jj++, kk += 3) { - pinvite_req_info->go_bssid[ jj ] = key_2char2num( extra[kk], extra[kk+ 1] ); + pinvite_req_info->go_bssid[ jj ] = key_2char2num(extra[kk], extra[kk+ 1]); } // Store the GO's ssid pinvite_req_info->ssidlen = wrqu->data.length - 36; - _rtw_memcpy( pinvite_req_info->go_ssid, &extra[ 36 ], (u32) pinvite_req_info->ssidlen ); + _rtw_memcpy(pinvite_req_info->go_ssid, &extra[ 36 ], (u32) pinvite_req_info->ssidlen); pinvite_req_info->benable = _TRUE; pinvite_req_info->peer_ch = uintPeerChannel; @@ -5481,7 +5481,7 @@ static int rtw_p2p_invite_req(struct net_device *dev, rtw_p2p_set_state(pwdinfo, P2P_STATE_TX_INVITE_REQ); #ifdef CONFIG_CONCURRENT_MODE - if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) ) + if (check_fwstate(pbuddy_mlmepriv, _FW_LINKED)) { // Have to enter the power saving with the AP set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode); @@ -5496,26 +5496,26 @@ static int rtw_p2p_invite_req(struct net_device *dev, set_channel_bwmode(padapter, uintPeerChannel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); #endif - _set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT ); + _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); #ifdef CONFIG_CONCURRENT_MODE - if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) ) + if (check_fwstate(pbuddy_mlmepriv, _FW_LINKED)) { - _set_timer( &pwdinfo->restore_p2p_state_timer, P2P_CONCURRENT_INVITE_TIMEOUT ); + _set_timer(&pwdinfo->restore_p2p_state_timer, P2P_CONCURRENT_INVITE_TIMEOUT); } else { - _set_timer( &pwdinfo->restore_p2p_state_timer, P2P_INVITE_TIMEOUT ); + _set_timer(&pwdinfo->restore_p2p_state_timer, P2P_INVITE_TIMEOUT); } #else - _set_timer( &pwdinfo->restore_p2p_state_timer, P2P_INVITE_TIMEOUT ); + _set_timer(&pwdinfo->restore_p2p_state_timer, P2P_INVITE_TIMEOUT); #endif // CONFIG_CONCURRENT_MODE } else { - DBG_871X( "[%s] NOT Found in the Scanning Queue!\n", __func__ ); + DBG_871X("[%s] NOT Found in the Scanning Queue!\n", __func__); } exit: @@ -5531,7 +5531,7 @@ static int rtw_p2p_set_persistent(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); int jj,kk; u8 peerMACStr[ ETH_ALEN * 2 ] = { 0x00 }; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -5559,20 +5559,20 @@ static int rtw_p2p_set_persistent(struct net_device *dev, // 0: disable persistent group functionality // 1: enable persistent group founctionality - DBG_871X( "[%s] data = %s\n", __func__, extra ); + DBG_871X("[%s] data = %s\n", __func__, extra); if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) { - DBG_871X( "[%s] WiFi Direct is disable!\n", __func__ ); + DBG_871X("[%s] WiFi Direct is disable!\n", __func__); return ret; } else { - if ( extra[ 0 ] == '0' ) // Disable the persistent group function. + if (extra[ 0 ] == '0') // Disable the persistent group function. { pwdinfo->persistent_supported = _FALSE; } - else if ( extra[ 0 ] == '1' ) // Enable the persistent group function. + else if (extra[ 0 ] == '1') // Enable the persistent group function. { pwdinfo->persistent_supported = _TRUE; } @@ -5581,7 +5581,7 @@ static int rtw_p2p_set_persistent(struct net_device *dev, pwdinfo->persistent_supported = _FALSE; } } - printk( "[%s] persistent_supported = %d\n", __func__, pwdinfo->persistent_supported ); + printk("[%s] persistent_supported = %d\n", __func__, pwdinfo->persistent_supported); exit: @@ -5598,7 +5598,7 @@ static int rtw_p2p_set_pc(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); u8 peerMAC[ ETH_ALEN ] = { 0x00 }; int jj,kk; u8 peerMACStr[ ETH_ALEN * 2 ] = { 0x00 }; @@ -5621,17 +5621,17 @@ static int rtw_p2p_set_pc(struct net_device *dev, // 1. Input information is the MAC address which wants to know the Preferred Connection bit (PC bit) // Format: 00:E0:4C:00:00:05 - DBG_871X( "[%s] data = %s\n", __func__, extra ); + DBG_871X("[%s] data = %s\n", __func__, extra); if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) { - DBG_871X( "[%s] WiFi Direct is disable!\n", __func__ ); + DBG_871X("[%s] WiFi Direct is disable!\n", __func__); return ret; } - for ( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) + for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3) { - peerMAC[ jj ] = key_2char2num( extra[kk], extra[kk+ 1] ); + peerMAC[ jj ] = key_2char2num(extra[kk], extra[kk+ 1]); } _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); @@ -5650,26 +5650,26 @@ static int rtw_p2p_set_pc(struct net_device *dev, // Match the device address located in the P2P IE // This is for the case that the P2P device address is not the same as the P2P interface address. - if ( (p2pie=rtw_get_p2p_ie( &pnetwork->network.IEs[12], pnetwork->network.IELength - 12, NULL, &p2pielen)) ) + if ((p2pie=rtw_get_p2p_ie(&pnetwork->network.IEs[12], pnetwork->network.IELength - 12, NULL, &p2pielen))) { // The P2P Device ID attribute is included in the Beacon frame. // The P2P Device Info attribute is included in the probe response frame. - printk( "[%s] Got P2P IE\n", __func__ ); - if ( rtw_get_p2p_attr_content( p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen) ) + printk("[%s] Got P2P IE\n", __func__); + if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) { // Handle the P2P Device ID attribute of Beacon first - printk( "[%s] P2P_ATTR_DEVICE_ID\n", __func__ ); - if ( _rtw_memcmp( attr_content, peerMAC, ETH_ALEN ) ) + printk("[%s] P2P_ATTR_DEVICE_ID\n", __func__); + if (_rtw_memcmp(attr_content, peerMAC, ETH_ALEN)) { uintPeerChannel = pnetwork->network.Configuration.DSConfig; break; } } - else if ( rtw_get_p2p_attr_content( p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen) ) + else if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen)) { // Handle the P2P Device Info attribute of probe response - printk( "[%s] P2P_ATTR_DEVICE_INFO\n", __func__ ); - if ( _rtw_memcmp( attr_content, peerMAC, ETH_ALEN ) ) + printk("[%s] P2P_ATTR_DEVICE_INFO\n", __func__); + if (_rtw_memcmp(attr_content, peerMAC, ETH_ALEN)) { uintPeerChannel = pnetwork->network.Configuration.DSConfig; break; @@ -5683,20 +5683,20 @@ static int rtw_p2p_set_pc(struct net_device *dev, } _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); - printk( "[%s] channel = %d\n", __func__, uintPeerChannel ); + printk("[%s] channel = %d\n", __func__, uintPeerChannel); - if ( uintPeerChannel ) + if (uintPeerChannel) { u8 wfd_ie[ 128 ] = { 0x00 }; uint wfd_ielen = 0; - if ( rtw_get_wfd_ie( &pnetwork->network.IEs[12], pnetwork->network.IELength - 12, wfd_ie, &wfd_ielen ) ) + if (rtw_get_wfd_ie(&pnetwork->network.IEs[12], pnetwork->network.IELength - 12, wfd_ie, &wfd_ielen)) { u8 wfd_devinfo[ 6 ] = { 0x00 }; uint wfd_devlen = 6; - DBG_871X( "[%s] Found WFD IE!\n", __func__ ); - if ( rtw_get_wfd_attr_content( wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, wfd_devinfo, &wfd_devlen ) ) + DBG_871X("[%s] Found WFD IE!\n", __func__); + if (rtw_get_wfd_attr_content(wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, wfd_devinfo, &wfd_devlen)) { u16 wfd_devinfo_field = 0; @@ -5704,7 +5704,7 @@ static int rtw_p2p_set_pc(struct net_device *dev, // The first two bytes are the WFD device information field of WFD device information subelement. // In big endian format. wfd_devinfo_field = RTW_GET_BE16(wfd_devinfo); - if ( wfd_devinfo_field & WFD_DEVINFO_PC_TDLS ) + if (wfd_devinfo_field & WFD_DEVINFO_PC_TDLS) { pwfd_info->wfd_pc = _TRUE; } @@ -5717,7 +5717,7 @@ static int rtw_p2p_set_pc(struct net_device *dev, } else { - DBG_871X( "[%s] NOT Found in the Scanning Queue!\n", __func__ ); + DBG_871X("[%s] NOT Found in the Scanning Queue!\n", __func__); } exit: @@ -5734,7 +5734,7 @@ static int rtw_p2p_set_wfd_device_type(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); struct wifi_display_info* pwfd_info = pwdinfo->wfd_info; // Commented by Albert 20120328 @@ -5742,9 +5742,9 @@ static int rtw_p2p_set_wfd_device_type(struct net_device *dev, // 0: specify to Miracast source device // 1 or others: specify to Miracast sink device (display device) - DBG_871X( "[%s] data = %s\n", __func__, extra ); + DBG_871X("[%s] data = %s\n", __func__, extra); - if ( extra[ 0 ] == '0' ) // Set to Miracast source device. + if (extra[ 0 ] == '0') // Set to Miracast source device. { pwfd_info->wfd_device_type = WFD_DEVINFO_SOURCE; } @@ -5767,7 +5767,7 @@ static int rtw_p2p_set_scan_result_type(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); struct wifi_display_info *pwfd_info = pwdinfo->wfd_info; // Commented by Albert 20120328 @@ -5778,17 +5778,17 @@ static int rtw_p2p_set_scan_result_type(struct net_device *dev, // It will show up all the Miracast source device if this device is sink. // It will show up all the Miracast sink device if this device is source. - DBG_871X( "[%s] data = %s\n", __func__, extra ); + DBG_871X("[%s] data = %s\n", __func__, extra); - if ( extra[ 0 ] == '0' ) + if (extra[ 0 ] == '0') { pwfd_info->scan_result_type = SCAN_RESULT_P2P_ONLY; } - else if ( extra[ 0 ] == '1' ) + else if (extra[ 0 ] == '1') { pwfd_info->scan_result_type = SCAN_RESULT_ALL; } - else if ( extra[ 0 ] == '2' ) + else if (extra[ 0 ] == '2') { pwfd_info->scan_result_type = SCAN_RESULT_WFD_TYPE; } @@ -5812,23 +5812,23 @@ static int rtw_p2p_set_sa(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct iw_point *pdata = &wrqu->data; - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); struct wifi_display_info *pwfd_info = pwdinfo->wfd_info; - DBG_871X( "[%s] data = %s\n", __func__, extra ); + DBG_871X("[%s] data = %s\n", __func__, extra); - if ( 0 ) + if (0) { - DBG_871X( "[%s] WiFi Direct is disable!\n", __func__ ); + DBG_871X("[%s] WiFi Direct is disable!\n", __func__); return ret; } else { - if ( extra[ 0 ] == '0' ) // Disable the session available. + if (extra[ 0 ] == '0') // Disable the session available. { pwdinfo->session_available = _FALSE; } - else if ( extra[ 0 ] == '1' ) // Enable the session available. + else if (extra[ 0 ] == '1') // Enable the session available. { pwdinfo->session_available = _TRUE; } @@ -5837,7 +5837,7 @@ static int rtw_p2p_set_sa(struct net_device *dev, pwdinfo->session_available = _FALSE; } } - printk( "[%s] session available = %d\n", __func__, pwdinfo->session_available ); + printk("[%s] session available = %d\n", __func__, pwdinfo->session_available); exit: @@ -5852,7 +5852,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev, { int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); u8 peerMAC[ ETH_ALEN ] = { 0x00 }; int jj,kk; u8 peerMACStr[ ETH_ALEN * 2 ] = { 0x00 }; @@ -5883,49 +5883,49 @@ static int rtw_p2p_prov_disc(struct net_device *dev, // Format: 00:E0:4C:00:00:05_pbc // Format: 00:E0:4C:00:00:05_label - DBG_871X( "[%s] data = %s\n", __func__, extra ); + DBG_871X("[%s] data = %s\n", __func__, extra); - if ( pwdinfo->p2p_state == P2P_STATE_NONE ) + if (pwdinfo->p2p_state == P2P_STATE_NONE) { - DBG_871X( "[%s] WiFi Direct is disable!\n", __func__ ); + DBG_871X("[%s] WiFi Direct is disable!\n", __func__); return ret; } else { // Reset the content of struct tx_provdisc_req_info excluded the wps_config_method_request. - _rtw_memset( pwdinfo->tx_prov_disc_info.peerDevAddr, 0x00, ETH_ALEN ); - _rtw_memset( pwdinfo->tx_prov_disc_info.peerIFAddr, 0x00, ETH_ALEN ); - _rtw_memset( &pwdinfo->tx_prov_disc_info.ssid, 0x00, sizeof( NDIS_802_11_SSID ) ); + _rtw_memset(pwdinfo->tx_prov_disc_info.peerDevAddr, 0x00, ETH_ALEN); + _rtw_memset(pwdinfo->tx_prov_disc_info.peerIFAddr, 0x00, ETH_ALEN); + _rtw_memset(&pwdinfo->tx_prov_disc_info.ssid, 0x00, sizeof(NDIS_802_11_SSID)); pwdinfo->tx_prov_disc_info.peer_channel_num[ 0 ] = 0; pwdinfo->tx_prov_disc_info.peer_channel_num[ 1 ] = 0; pwdinfo->tx_prov_disc_info.benable = _FALSE; } - for ( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) + for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3) { - peerMAC[ jj ] = key_2char2num( extra[kk], extra[kk+ 1] ); + peerMAC[ jj ] = key_2char2num(extra[kk], extra[kk+ 1]); } - if ( _rtw_memcmp( &extra[ 18 ], "display", 7 ) ) + if (_rtw_memcmp(&extra[ 18 ], "display", 7)) { pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_DISPLYA; } - else if ( _rtw_memcmp( &extra[ 18 ], "keypad", 7 ) ) + else if (_rtw_memcmp(&extra[ 18 ], "keypad", 7)) { pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_KEYPAD; } - else if ( _rtw_memcmp( &extra[ 18 ], "pbc", 3 ) ) + else if (_rtw_memcmp(&extra[ 18 ], "pbc", 3)) { pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_PUSH_BUTTON; } - else if ( _rtw_memcmp( &extra[ 18 ], "label", 5 ) ) + else if (_rtw_memcmp(&extra[ 18 ], "label", 5)) { pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_LABEL; } else { - DBG_871X( "[%s] Unknown WPS config methodn", __func__ ); - return( ret ); + DBG_871X("[%s] Unknown WPS config methodn", __func__); + return(ret); } _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); @@ -5938,7 +5938,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev, if (rtw_end_of_queue_search(phead,plist)== _TRUE) break; - if ( uintPeerChannel != 0 ) + if (uintPeerChannel != 0) break; pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); @@ -5947,26 +5947,26 @@ static int rtw_p2p_prov_disc(struct net_device *dev, // Match the device address located in the P2P IE // This is for the case that the P2P device address is not the same as the P2P interface address. - if ( (p2pie=rtw_get_p2p_ie( &pnetwork->network.IEs[12], pnetwork->network.IELength - 12, NULL, &p2pielen)) ) + if ((p2pie=rtw_get_p2p_ie(&pnetwork->network.IEs[12], pnetwork->network.IELength - 12, NULL, &p2pielen))) { - while ( p2pie ) + while (p2pie) { // The P2P Device ID attribute is included in the Beacon frame. // The P2P Device Info attribute is included in the probe response frame. - if ( rtw_get_p2p_attr_content( p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen) ) + if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) { // Handle the P2P Device ID attribute of Beacon first - if ( _rtw_memcmp( attr_content, peerMAC, ETH_ALEN ) ) + if (_rtw_memcmp(attr_content, peerMAC, ETH_ALEN)) { uintPeerChannel = pnetwork->network.Configuration.DSConfig; break; } } - else if ( rtw_get_p2p_attr_content( p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen) ) + else if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen)) { // Handle the P2P Device Info attribute of probe response - if ( _rtw_memcmp( attr_content, peerMAC, ETH_ALEN ) ) + if (_rtw_memcmp(attr_content, peerMAC, ETH_ALEN)) { uintPeerChannel = pnetwork->network.Configuration.DSConfig; break; @@ -5990,13 +5990,13 @@ static int rtw_p2p_prov_disc(struct net_device *dev, u8 wfd_ie[ 128 ] = { 0x00 }; uint wfd_ielen = 0; - if ( rtw_get_wfd_ie( &pnetwork->network.IEs[12], pnetwork->network.IELength - 12, wfd_ie, &wfd_ielen ) ) + if (rtw_get_wfd_ie(&pnetwork->network.IEs[12], pnetwork->network.IELength - 12, wfd_ie, &wfd_ielen)) { u8 wfd_devinfo[ 6 ] = { 0x00 }; uint wfd_devlen = 6; - DBG_871X( "[%s] Found WFD IE!\n", __func__ ); - if ( rtw_get_wfd_attr_content( wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, wfd_devinfo, &wfd_devlen ) ) + DBG_871X("[%s] Found WFD IE!\n", __func__); + if (rtw_get_wfd_attr_content(wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, wfd_devinfo, &wfd_devlen)) { u16 wfd_devinfo_field = 0; @@ -6004,7 +6004,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev, // The first two bytes are the WFD device information field of WFD device information subelement. // In big endian format. wfd_devinfo_field = RTW_GET_BE16(wfd_devinfo); - if ( wfd_devinfo_field & WFD_DEVINFO_SESSION_AVAIL ) + if (wfd_devinfo_field & WFD_DEVINFO_SESSION_AVAIL) { pwfd_info->peer_session_avail = _TRUE; } @@ -6015,43 +6015,43 @@ static int rtw_p2p_prov_disc(struct net_device *dev, } } - if ( _FALSE == pwfd_info->peer_session_avail ) + if (_FALSE == pwfd_info->peer_session_avail) { - DBG_871X( "[%s] WFD Session not avaiable!\n", __func__ ); + DBG_871X("[%s] WFD Session not avaiable!\n", __func__); goto exit; } } #endif // CONFIG_WFD - if ( uintPeerChannel ) + if (uintPeerChannel) { - DBG_871X( "[%s] peer channel: %d!\n", __func__, uintPeerChannel ); + DBG_871X("[%s] peer channel: %d!\n", __func__, uintPeerChannel); #ifdef CONFIG_CONCURRENT_MODE - if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) ) + if (check_fwstate(pbuddy_mlmepriv, _FW_LINKED)) { - _cancel_timer_ex( &pwdinfo->ap_p2p_switch_timer ); + _cancel_timer_ex(&pwdinfo->ap_p2p_switch_timer); } #endif // CONFIG_CONCURRENT_MODE - _rtw_memcpy( pwdinfo->tx_prov_disc_info.peerIFAddr, pnetwork->network.MacAddress, ETH_ALEN ); - _rtw_memcpy( pwdinfo->tx_prov_disc_info.peerDevAddr, peerMAC, ETH_ALEN ); - pwdinfo->tx_prov_disc_info.peer_channel_num[0] = ( u16 ) uintPeerChannel; + _rtw_memcpy(pwdinfo->tx_prov_disc_info.peerIFAddr, pnetwork->network.MacAddress, ETH_ALEN); + _rtw_memcpy(pwdinfo->tx_prov_disc_info.peerDevAddr, peerMAC, ETH_ALEN); + pwdinfo->tx_prov_disc_info.peer_channel_num[0] = (u16) uintPeerChannel; pwdinfo->tx_prov_disc_info.benable = _TRUE; rtw_p2p_set_pre_state(pwdinfo, rtw_p2p_state(pwdinfo)); rtw_p2p_set_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ); if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_CLIENT)) { - _rtw_memcpy( &pwdinfo->tx_prov_disc_info.ssid, &pnetwork->network.Ssid, sizeof( NDIS_802_11_SSID ) ); + _rtw_memcpy(&pwdinfo->tx_prov_disc_info.ssid, &pnetwork->network.Ssid, sizeof(NDIS_802_11_SSID)); } else if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE) || rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) { - _rtw_memcpy( pwdinfo->tx_prov_disc_info.ssid.Ssid, pwdinfo->p2p_wildcard_ssid, P2P_WILDCARD_SSID_LEN ); + _rtw_memcpy(pwdinfo->tx_prov_disc_info.ssid.Ssid, pwdinfo->p2p_wildcard_ssid, P2P_WILDCARD_SSID_LEN); pwdinfo->tx_prov_disc_info.ssid.SsidLength= P2P_WILDCARD_SSID_LEN; } #ifdef CONFIG_CONCURRENT_MODE - if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) ) + if (check_fwstate(pbuddy_mlmepriv, _FW_LINKED)) { // Have to enter the power saving with the AP set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode); @@ -6066,25 +6066,25 @@ static int rtw_p2p_prov_disc(struct net_device *dev, set_channel_bwmode(padapter, uintPeerChannel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); #endif - _set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT ); + _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); #ifdef CONFIG_CONCURRENT_MODE - if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) ) + if (check_fwstate(pbuddy_mlmepriv, _FW_LINKED)) { - _set_timer( &pwdinfo->restore_p2p_state_timer, P2P_CONCURRENT_PROVISION_TIMEOUT ); + _set_timer(&pwdinfo->restore_p2p_state_timer, P2P_CONCURRENT_PROVISION_TIMEOUT); } else { - _set_timer( &pwdinfo->restore_p2p_state_timer, P2P_PROVISION_TIMEOUT ); + _set_timer(&pwdinfo->restore_p2p_state_timer, P2P_PROVISION_TIMEOUT); } #else - _set_timer( &pwdinfo->restore_p2p_state_timer, P2P_PROVISION_TIMEOUT ); + _set_timer(&pwdinfo->restore_p2p_state_timer, P2P_PROVISION_TIMEOUT); #endif // CONFIG_CONCURRENT_MODE } else { - DBG_871X( "[%s] NOT Found in the Scanning Queue!\n", __func__ ); + DBG_871X("[%s] NOT Found in the Scanning Queue!\n", __func__); } exit: @@ -6103,29 +6103,29 @@ static int rtw_p2p_got_wpsinfo(struct net_device *dev, int ret = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - struct wifidirect_info *pwdinfo = &( padapter->wdinfo ); + struct wifidirect_info *pwdinfo = &(padapter->wdinfo); - DBG_871X( "[%s] data = %s\n", __func__, extra ); + DBG_871X("[%s] data = %s\n", __func__, extra); // Added by Albert 20110328 // if the input data is P2P_NO_WPSINFO -> reset the wpsinfo // if the input data is P2P_GOT_WPSINFO_PEER_DISPLAY_PIN -> the utility just input the PIN code got from the peer P2P device. // if the input data is P2P_GOT_WPSINFO_SELF_DISPLAY_PIN -> the utility just got the PIN code from itself. // if the input data is P2P_GOT_WPSINFO_PBC -> the utility just determine to use the PBC - if ( *extra == '0' ) + if (*extra == '0') { pwdinfo->ui_got_wps_info = P2P_NO_WPSINFO; } - else if ( *extra == '1' ) + else if (*extra == '1') { pwdinfo->ui_got_wps_info = P2P_GOT_WPSINFO_PEER_DISPLAY_PIN; } - else if ( *extra == '2' ) + else if (*extra == '2') { pwdinfo->ui_got_wps_info = P2P_GOT_WPSINFO_SELF_DISPLAY_PIN; } - else if ( *extra == '3' ) + else if (*extra == '3') { pwdinfo->ui_got_wps_info = P2P_GOT_WPSINFO_PBC; } @@ -6154,99 +6154,99 @@ static int rtw_p2p_set(struct net_device *dev, struct wifidirect_info *pwdinfo= &(padapter->wdinfo); struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - DBG_871X( "[%s] extra = %s\n", __func__, extra ); + DBG_871X("[%s] extra = %s\n", __func__, extra); - if ( _rtw_memcmp( extra, "enable=", 7 ) ) + if (_rtw_memcmp(extra, "enable=", 7)) { - rtw_wext_p2p_enable( dev, info, wrqu, &extra[7] ); + rtw_wext_p2p_enable(dev, info, wrqu, &extra[7]); } - else if ( _rtw_memcmp( extra, "setDN=", 6 ) ) + else if (_rtw_memcmp(extra, "setDN=", 6)) { wrqu->data.length -= 6; - rtw_p2p_setDN( dev, info, wrqu, &extra[6] ); + rtw_p2p_setDN(dev, info, wrqu, &extra[6]); } - else if ( _rtw_memcmp( extra, "profilefound=", 13 ) ) + else if (_rtw_memcmp(extra, "profilefound=", 13)) { wrqu->data.length -= 13; - rtw_p2p_profilefound( dev, info, wrqu, &extra[13] ); + rtw_p2p_profilefound(dev, info, wrqu, &extra[13]); } - else if ( _rtw_memcmp( extra, "prov_disc=", 10 ) ) + else if (_rtw_memcmp(extra, "prov_disc=", 10)) { wrqu->data.length -= 10; - rtw_p2p_prov_disc( dev, info, wrqu, &extra[10] ); + rtw_p2p_prov_disc(dev, info, wrqu, &extra[10]); } - else if ( _rtw_memcmp( extra, "nego=", 5 ) ) + else if (_rtw_memcmp(extra, "nego=", 5)) { wrqu->data.length -= 5; - rtw_p2p_connect( dev, info, wrqu, &extra[5] ); + rtw_p2p_connect(dev, info, wrqu, &extra[5]); } - else if ( _rtw_memcmp( extra, "intent=", 7 ) ) + else if (_rtw_memcmp(extra, "intent=", 7)) { // Commented by Albert 2011/03/23 // The wrqu->data.length will include the null character // So, we will decrease 7 + 1 wrqu->data.length -= 8; - rtw_p2p_set_intent( dev, info, wrqu, &extra[7] ); + rtw_p2p_set_intent(dev, info, wrqu, &extra[7]); } - else if ( _rtw_memcmp( extra, "ssid=", 5 ) ) + else if (_rtw_memcmp(extra, "ssid=", 5)) { wrqu->data.length -= 5; - rtw_p2p_set_go_nego_ssid( dev, info, wrqu, &extra[5] ); + rtw_p2p_set_go_nego_ssid(dev, info, wrqu, &extra[5]); } - else if ( _rtw_memcmp( extra, "got_wpsinfo=", 12 ) ) + else if (_rtw_memcmp(extra, "got_wpsinfo=", 12)) { wrqu->data.length -= 12; - rtw_p2p_got_wpsinfo( dev, info, wrqu, &extra[12] ); + rtw_p2p_got_wpsinfo(dev, info, wrqu, &extra[12]); } - else if ( _rtw_memcmp( extra, "listen_ch=", 10 ) ) + else if (_rtw_memcmp(extra, "listen_ch=", 10)) { // Commented by Albert 2011/05/24 // The wrqu->data.length will include the null character // So, we will decrease (10 + 1) wrqu->data.length -= 11; - rtw_p2p_set_listen_ch( dev, info, wrqu, &extra[10] ); + rtw_p2p_set_listen_ch(dev, info, wrqu, &extra[10]); } - else if ( _rtw_memcmp( extra, "op_ch=", 6 ) ) + else if (_rtw_memcmp(extra, "op_ch=", 6)) { // Commented by Albert 2011/05/24 // The wrqu->data.length will include the null character // So, we will decrease (6 + 1) wrqu->data.length -= 7; - rtw_p2p_set_op_ch( dev, info, wrqu, &extra[6] ); + rtw_p2p_set_op_ch(dev, info, wrqu, &extra[6]); } - else if ( _rtw_memcmp( extra, "invite=", 7 ) ) + else if (_rtw_memcmp(extra, "invite=", 7)) { wrqu->data.length -= 8; - rtw_p2p_invite_req( dev, info, wrqu, &extra[7] ); + rtw_p2p_invite_req(dev, info, wrqu, &extra[7]); } - else if ( _rtw_memcmp( extra, "persistent=", 11 ) ) + else if (_rtw_memcmp(extra, "persistent=", 11)) { wrqu->data.length -= 11; - rtw_p2p_set_persistent( dev, info, wrqu, &extra[11] ); + rtw_p2p_set_persistent(dev, info, wrqu, &extra[11]); } #ifdef CONFIG_WFD - else if ( _rtw_memcmp( extra, "sa=", 3 ) ) + else if (_rtw_memcmp(extra, "sa=", 3)) { // sa: WFD Session Available information wrqu->data.length -= 3; - rtw_p2p_set_sa( dev, info, wrqu, &extra[3] ); + rtw_p2p_set_sa(dev, info, wrqu, &extra[3]); } - else if ( _rtw_memcmp( extra, "pc=", 3 ) ) + else if (_rtw_memcmp(extra, "pc=", 3)) { // pc: WFD Preferred Connection wrqu->data.length -= 3; - rtw_p2p_set_pc( dev, info, wrqu, &extra[3] ); + rtw_p2p_set_pc(dev, info, wrqu, &extra[3]); } - else if ( _rtw_memcmp( extra, "wfd_type=", 9 ) ) + else if (_rtw_memcmp(extra, "wfd_type=", 9)) { // Specify this device is Mircast source or sink wrqu->data.length -= 9; - rtw_p2p_set_wfd_device_type( dev, info, wrqu, &extra[9] ); + rtw_p2p_set_wfd_device_type(dev, info, wrqu, &extra[9]); } - else if ( _rtw_memcmp( extra, "scan_type=", 10 ) ) + else if (_rtw_memcmp(extra, "scan_type=", 10)) { wrqu->data.length -= 10; - rtw_p2p_set_scan_result_type( dev, info, wrqu, &extra[10] ); + rtw_p2p_set_scan_result_type(dev, info, wrqu, &extra[10]); } #endif //CONFIG_WFD @@ -6271,57 +6271,57 @@ static int rtw_p2p_get(struct net_device *dev, struct wifidirect_info *pwdinfo= &(padapter->wdinfo); struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - if ( padapter->bShowGetP2PState ) + if (padapter->bShowGetP2PState) { - DBG_871X( "[%s] extra = %s\n", __func__, (char*) wrqu->data.pointer ); + DBG_871X("[%s] extra = %s\n", __func__, (char*) wrqu->data.pointer); } - if ( _rtw_memcmp( wrqu->data.pointer, "status", 6 ) ) + if (_rtw_memcmp(wrqu->data.pointer, "status", 6)) { - rtw_p2p_get_status( dev, info, wrqu, extra ); + rtw_p2p_get_status(dev, info, wrqu, extra); } - else if ( _rtw_memcmp( wrqu->data.pointer, "role", 4 ) ) + else if (_rtw_memcmp(wrqu->data.pointer, "role", 4)) { - rtw_p2p_get_role( dev, info, wrqu, extra); + rtw_p2p_get_role(dev, info, wrqu, extra); } - else if ( _rtw_memcmp( wrqu->data.pointer, "peer_ifa", 8 ) ) + else if (_rtw_memcmp(wrqu->data.pointer, "peer_ifa", 8)) { - rtw_p2p_get_peer_ifaddr( dev, info, wrqu, extra); + rtw_p2p_get_peer_ifaddr(dev, info, wrqu, extra); } - else if ( _rtw_memcmp( wrqu->data.pointer, "req_cm", 6 ) ) + else if (_rtw_memcmp(wrqu->data.pointer, "req_cm", 6)) { - rtw_p2p_get_req_cm( dev, info, wrqu, extra); + rtw_p2p_get_req_cm(dev, info, wrqu, extra); } - else if ( _rtw_memcmp( wrqu->data.pointer, "peer_deva", 9 ) ) + else if (_rtw_memcmp(wrqu->data.pointer, "peer_deva", 9)) { // Get the P2P device address when receiving the provision discovery request frame. - rtw_p2p_get_peer_devaddr( dev, info, wrqu, extra); + rtw_p2p_get_peer_devaddr(dev, info, wrqu, extra); } - else if ( _rtw_memcmp( wrqu->data.pointer, "group_id", 8 ) ) + else if (_rtw_memcmp(wrqu->data.pointer, "group_id", 8)) { - rtw_p2p_get_groupid( dev, info, wrqu, extra); + rtw_p2p_get_groupid(dev, info, wrqu, extra); } - else if ( _rtw_memcmp( wrqu->data.pointer, "peer_deva_inv", 9 ) ) + else if (_rtw_memcmp(wrqu->data.pointer, "peer_deva_inv", 9)) { // Get the P2P device address when receiving the P2P Invitation request frame. - rtw_p2p_get_peer_devaddr_by_invitation( dev, info, wrqu, extra); + rtw_p2p_get_peer_devaddr_by_invitation(dev, info, wrqu, extra); } - else if ( _rtw_memcmp( wrqu->data.pointer, "op_ch", 5 ) ) + else if (_rtw_memcmp(wrqu->data.pointer, "op_ch", 5)) { - rtw_p2p_get_op_ch( dev, info, wrqu, extra); + rtw_p2p_get_op_ch(dev, info, wrqu, extra); } #ifdef CONFIG_WFD - else if ( _rtw_memcmp( wrqu->data.pointer, "peer_port", 9 ) ) + else if (_rtw_memcmp(wrqu->data.pointer, "peer_port", 9)) { - rtw_p2p_get_peer_wfd_port( dev, info, wrqu, extra ); + rtw_p2p_get_peer_wfd_port(dev, info, wrqu, extra); } - else if ( _rtw_memcmp( wrqu->data.pointer, "wfd_sa", 6 ) ) + else if (_rtw_memcmp(wrqu->data.pointer, "wfd_sa", 6)) { - rtw_p2p_get_peer_wfd_session_available( dev, info, wrqu, extra ); + rtw_p2p_get_peer_wfd_session_available(dev, info, wrqu, extra); } - else if ( _rtw_memcmp( wrqu->data.pointer, "wfd_pc", 6 ) ) + else if (_rtw_memcmp(wrqu->data.pointer, "wfd_pc", 6)) { - rtw_p2p_get_peer_wfd_preferred_connection( dev, info, wrqu, extra ); + rtw_p2p_get_peer_wfd_preferred_connection(dev, info, wrqu, extra); } #endif // CONFIG_WFD @@ -6346,32 +6346,32 @@ static int rtw_p2p_get2(struct net_device *dev, struct wifidirect_info *pwdinfo= &(padapter->wdinfo); struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - DBG_871X( "[%s] extra = %s\n", __func__, (char*) wrqu->data.pointer ); + DBG_871X("[%s] extra = %s\n", __func__, (char*) wrqu->data.pointer); - if ( _rtw_memcmp( extra, "wpsCM=", 6 ) ) + if (_rtw_memcmp(extra, "wpsCM=", 6)) { wrqu->data.length -= 6; - rtw_p2p_get_wps_configmethod( dev, info, wrqu, &extra[6]); + rtw_p2p_get_wps_configmethod(dev, info, wrqu, &extra[6]); } - else if ( _rtw_memcmp( extra, "devN=", 5 ) ) + else if (_rtw_memcmp(extra, "devN=", 5)) { wrqu->data.length -= 5; - rtw_p2p_get_device_name( dev, info, wrqu, &extra[5] ); + rtw_p2p_get_device_name(dev, info, wrqu, &extra[5]); } - else if ( _rtw_memcmp( extra, "dev_type=", 9 ) ) + else if (_rtw_memcmp(extra, "dev_type=", 9)) { wrqu->data.length -= 9; - rtw_p2p_get_device_type( dev, info, wrqu, &extra[9] ); + rtw_p2p_get_device_type(dev, info, wrqu, &extra[9]); } - else if ( _rtw_memcmp( extra, "go_devadd=", 10 ) ) + else if (_rtw_memcmp(extra, "go_devadd=", 10)) { wrqu->data.length -= 10; - rtw_p2p_get_go_device_address( dev, info, wrqu, &extra[10] ); + rtw_p2p_get_go_device_address(dev, info, wrqu, &extra[10]); } - else if ( _rtw_memcmp( extra, "InvProc=", 8 ) ) + else if (_rtw_memcmp(extra, "InvProc=", 8)) { wrqu->data.length -= 8; - rtw_p2p_get_invitation_procedure( dev, info, wrqu, &extra[8] ); + rtw_p2p_get_invitation_procedure(dev, info, wrqu, &extra[8]); } #endif //CONFIG_P2P @@ -6395,7 +6395,7 @@ static int rtw_cta_test_start(struct net_device *dev, if (padapter->in_cta_test) { u32 v = rtw_read32(padapter, REG_RCR); - v &= ~(RCR_CBSSID_DATA | RCR_CBSSID_BCN );//| RCR_ADF + v &= ~(RCR_CBSSID_DATA | RCR_CBSSID_BCN);//| RCR_ADF rtw_write32(padapter, REG_RCR, v); DBG_871X("enable RCR_ADF\n"); } @@ -6437,16 +6437,16 @@ static int rtw_rereg_nd_name(struct net_device *dev, if (wrqu->data.length > IFNAMSIZ) return -EFAULT; - if ( copy_from_user(new_ifname, wrqu->data.pointer, IFNAMSIZ) ) { + if (copy_from_user(new_ifname, wrqu->data.pointer, IFNAMSIZ)) { return -EFAULT; } - if ( 0 == strcmp(rereg_priv->old_ifname, new_ifname) ) { + if (0 == strcmp(rereg_priv->old_ifname, new_ifname)) { return ret; } DBG_871X("%s new_ifname:%s\n", __func__, new_ifname); - if ( 0 != (ret = rtw_change_ifname(padapter, new_ifname)) ) { + if (0 != (ret = rtw_change_ifname(padapter, new_ifname))) { goto exit; } @@ -6480,57 +6480,7 @@ exit: } -#if 0 -void mac_reg_dump(_adapter *padapter) -{ - int i,j=1; - DBG_871X("\n======= MAC REG =======\n"); - for (i=0x0;i<0x300;i+=4) - { - if (j%4==1) DBG_871X("0x%02x",i); - DBG_871X(" 0x%08x ",rtw_read32(padapter,i)); - if ((j++)%4 == 0) DBG_871X("\n"); - } - for (i=0x400;i<0x800;i+=4) - { - if (j%4==1) DBG_871X("0x%02x",i); - DBG_871X(" 0x%08x ",rtw_read32(padapter,i)); - if ((j++)%4 == 0) DBG_871X("\n"); - } -} -void bb_reg_dump(_adapter *padapter) -{ - int i,j=1; - DBG_871X("\n======= BB REG =======\n"); - for (i=0x800;i<0x1000;i+=4) - { - if (j%4==1) DBG_871X("0x%02x",i); - - DBG_871X(" 0x%08x ",rtw_read32(padapter,i)); - if ((j++)%4 == 0) DBG_871X("\n"); - } -} -void rf_reg_dump(_adapter *padapter) -{ - int i,j=1,path; - u32 value; - DBG_871X("\n======= RF REG =======\n"); - for (path=0;path<2;path++) - { - DBG_871X("\nRF_Path(%x)\n",path); - for (i=0;i<0x100;i++) - { - value = PHY_QueryRFReg(padapter, (RF_RADIO_PATH_E)path,i, bMaskDWord); - if (j%4==1) DBG_871X("0x%02x ",i); - DBG_871X(" 0x%08x ",value); - if ((j++)%4==0) DBG_871X("\n"); - } - } -} - -#endif - -void mac_reg_dump(_adapter *padapter) +static void mac_reg_dump(_adapter *padapter) { int i,j=1; printk("\n======= MAC REG =======\n"); @@ -6547,7 +6497,8 @@ void mac_reg_dump(_adapter *padapter) if ((j++)%4 == 0) printk("\n"); } } -void bb_reg_dump(_adapter *padapter) + +static void bb_reg_dump(_adapter *padapter) { int i,j=1; printk("\n======= BB REG =======\n"); @@ -6559,7 +6510,8 @@ void bb_reg_dump(_adapter *padapter) if ((j++)%4 == 0) printk("\n"); } } -void rf_reg_dump(_adapter *padapter) + +static void rf_reg_dump(_adapter *padapter) { int i,j=1,path; u32 value; @@ -6567,7 +6519,7 @@ void rf_reg_dump(_adapter *padapter) rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type)); printk("\n======= RF REG =======\n"); - if ((RF_1T2R == rf_type) ||(RF_1T1R ==rf_type )) + if ((RF_1T2R == rf_type) ||(RF_1T1R ==rf_type)) path_nums = 1; else path_nums = 2; @@ -6697,7 +6649,7 @@ static int rtw_dbg_port(struct net_device *dev, rtw_IOL_append_LLT_cmd(xmit_frame, page_boundary); - if (_SUCCESS != rtw_IOL_exec_cmds_sync(padapter, xmit_frame, 500,0) ) + if (_SUCCESS != rtw_IOL_exec_cmds_sync(padapter, xmit_frame, 500,0)) ret = -EPERM; } } @@ -6730,7 +6682,7 @@ static int rtw_dbg_port(struct net_device *dev, rtw_IOL_append_DELAY_MS_cmd(xmit_frame, blink_delay_ms); #endif } - if (_SUCCESS != rtw_IOL_exec_cmds_sync(padapter, xmit_frame, (blink_delay_ms*blink_num*2)+200,0) ) + if (_SUCCESS != rtw_IOL_exec_cmds_sync(padapter, xmit_frame, (blink_delay_ms*blink_num*2)+200,0)) ret = -EPERM; } } @@ -6763,7 +6715,7 @@ static int rtw_dbg_port(struct net_device *dev, ret = -EPERM; } - if (start_value+write_num-1 == (final=rtw_read8(padapter, reg)) ) { + if (start_value+write_num-1 == (final=rtw_read8(padapter, reg))) { DBG_871X("continuous IOL_CMD_WB_REG to 0x%x %u times Success, start:%u, final:%u\n", reg, write_num, start_value, final); } else { DBG_871X("continuous IOL_CMD_WB_REG to 0x%x %u times Fail, start:%u, final:%u\n", reg, write_num, start_value, final); @@ -6799,7 +6751,7 @@ static int rtw_dbg_port(struct net_device *dev, ret = -EPERM; } - if (start_value+write_num-1 == (final=rtw_read16(padapter, reg)) ) { + if (start_value+write_num-1 == (final=rtw_read16(padapter, reg))) { DBG_871X("continuous IOL_CMD_WW_REG to 0x%x %u times Success, start:%u, final:%u\n", reg, write_num, start_value, final); } else { DBG_871X("continuous IOL_CMD_WW_REG to 0x%x %u times Fail, start:%u, final:%u\n", reg, write_num, start_value, final); @@ -6836,7 +6788,7 @@ static int rtw_dbg_port(struct net_device *dev, } - if (start_value+write_num-1 == (final=rtw_read32(padapter, reg)) ) { + if (start_value+write_num-1 == (final=rtw_read32(padapter, reg))) { DBG_871X("continuous IOL_CMD_WD_REG to 0x%x %u times Success, start:%u, final:%u\n", reg, write_num, start_value, final); } else { DBG_871X("continuous IOL_CMD_WD_REG to 0x%x %u times Fail, start:%u, final:%u\n", reg, write_num, start_value, final); @@ -7077,7 +7029,7 @@ static int rtw_dbg_port(struct net_device *dev, struct registry_priv *pregpriv = &padapter->registrypriv; // 0: disable, bit(0):enable 2.4g, bit(1):enable 5g, 0x3: enable both 2.4g and 5g //default is set to enable 2.4GHZ for IOT issue with bufflao's AP at 5GHZ - if ( pregpriv && (extra_arg == 0 || extra_arg == 1|| extra_arg == 2 || extra_arg == 3)) + if (pregpriv && (extra_arg == 0 || extra_arg == 1|| extra_arg == 2 || extra_arg == 3)) { pregpriv->rx_stbc= extra_arg; DBG_871X("set rx_stbc=%d\n",pregpriv->rx_stbc); @@ -7091,7 +7043,7 @@ static int rtw_dbg_port(struct net_device *dev, { struct registry_priv *pregpriv = &padapter->registrypriv; // 0: disable, 0x1:enable (but wifi_spec should be 0), 0x2: force enable (don't care wifi_spec) - if ( pregpriv && extra_arg >= 0 && extra_arg < 3 ) + if (pregpriv && extra_arg >= 0 && extra_arg < 3) { pregpriv->ampdu_enable= extra_arg; DBG_871X("set ampdu_enable=%d\n",pregpriv->ampdu_enable); @@ -7472,7 +7424,7 @@ static u8 set_pairwise_key(_adapter *padapter, struct sta_info *psta) u8 res=_SUCCESS; ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj)); - if ( ph2c == NULL){ + if (ph2c == NULL){ res= _FAIL; goto exit; } @@ -8279,7 +8231,7 @@ static int rtw_set_wps_beacon(struct net_device *dev, struct ieee_param *param, { pmlmepriv->wps_beacon_ie = rtw_malloc(ie_len); pmlmepriv->wps_beacon_ie_len = ie_len; - if ( pmlmepriv->wps_beacon_ie == NULL) { + if (pmlmepriv->wps_beacon_ie == NULL) { DBG_871X("%s()-%d: rtw_malloc() ERROR!\n", __func__, __LINE__); return -EINVAL; } @@ -8322,7 +8274,7 @@ static int rtw_set_wps_probe_resp(struct net_device *dev, struct ieee_param *par { pmlmepriv->wps_probe_resp_ie = rtw_malloc(ie_len); pmlmepriv->wps_probe_resp_ie_len = ie_len; - if ( pmlmepriv->wps_probe_resp_ie == NULL) { + if (pmlmepriv->wps_probe_resp_ie == NULL) { DBG_871X("%s()-%d: rtw_malloc() ERROR!\n", __func__, __LINE__); return -EINVAL; } @@ -8359,7 +8311,7 @@ static int rtw_set_wps_assoc_resp(struct net_device *dev, struct ieee_param *par { pmlmepriv->wps_assoc_resp_ie = rtw_malloc(ie_len); pmlmepriv->wps_assoc_resp_ie_len = ie_len; - if ( pmlmepriv->wps_assoc_resp_ie == NULL) { + if (pmlmepriv->wps_assoc_resp_ie == NULL) { DBG_871X("%s()-%d: rtw_malloc() ERROR!\n", __func__, __LINE__); return -EINVAL; } @@ -8680,7 +8632,7 @@ static int rtw_wx_set_priv(struct net_device *dev, } pmlmepriv->wps_probe_req_ie = rtw_malloc(cp_sz); - if ( pmlmepriv->wps_probe_req_ie == NULL) { + if (pmlmepriv->wps_probe_req_ie == NULL) { printk("%s()-%d: rtw_malloc() ERROR!\n", __func__, __LINE__); ret = -EINVAL; goto FREE_EXT; @@ -8767,7 +8719,7 @@ static int rtw_wx_set_priv(struct net_device *dev, } - if (copy_to_user(dwrq->pointer, ext, min(dwrq->length, (u16)(strlen(ext)+1)) ) ) + if (copy_to_user(dwrq->pointer, ext, min(dwrq->length, (u16)(strlen(ext)+1)))) ret = -EFAULT; #ifdef CONFIG_DEBUG_RTW_WX_SET_PRIV @@ -8799,14 +8751,14 @@ static int rtw_pm_set(struct net_device *dev, unsigned mode = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - DBG_871X( "[%s] extra = %s\n", __func__, extra ); + DBG_871X("[%s] extra = %s\n", __func__, extra); - if ( _rtw_memcmp( extra, "lps=", 4 ) ) + if (_rtw_memcmp(extra, "lps=", 4)) { sscanf(extra+4, "%u", &mode); ret = rtw_pm_set_lps(padapter,mode); } - else if ( _rtw_memcmp( extra, "ips=", 4 ) ) + else if (_rtw_memcmp(extra, "ips=", 4)) { sscanf(extra+4, "%u", &mode); ret = rtw_pm_set_ips(padapter,mode); @@ -8833,7 +8785,7 @@ static int rtw_mp_efuse_get(struct net_device *dev, struct pwrctrl_priv *pwrctrlpriv ; u8 *data = NULL; u8 *rawdata = NULL; - char *pch, *ptmp, *token, *tmp[3]={0x00,0x00,0x00}; + char *pch, *ptmp, *token, *tmp[3]={NULL, NULL, NULL}; u16 i=0, j=0, mapLen=0, addr=0, cnts=0; u16 max_available_size=0, raw_cursize=0, raw_maxsize=0; int err; @@ -9340,7 +9292,7 @@ static int rtw_mp_efuse_set(struct net_device *dev, u8 *ShadowMapBT = NULL; u8 *ShadowMapWiFi = NULL; u8 *setrawdata = NULL; - char *pch, *ptmp, *token, *tmp[3]={0x00,0x00,0x00}; + char *pch, *ptmp, *token, *tmp[3] = {NULL, NULL, NULL}; u16 addr=0, cnts=0, max_available_size=0; int err; @@ -9459,7 +9411,7 @@ static int rtw_mp_efuse_set(struct net_device *dev, goto exit; } - addr = simple_strtoul( tmp[1], &ptmp, 16 ); + addr = simple_strtoul(tmp[1], &ptmp, 16); addr &= 0xFFF; cnts = strlen(tmp[2]); @@ -9958,14 +9910,14 @@ static int rtw_mp_read_reg(struct net_device *dev, // 2 bytes //*(u16*)data = rtw_read16(padapter, addr); sprintf(data, "%04x\n", rtw_read16(padapter, addr)); - for ( i=0 ; i <= strlen(data) ; i++) + for (i=0 ; i <= strlen(data) ; i++) { - if ( i%2==0 ) + if (i%2==0) { tmp[j]=' '; j++; } - if ( data[i] != '\0' ) + if (data[i] != '\0') tmp[j] = data[i]; j++; @@ -9973,17 +9925,17 @@ static int rtw_mp_read_reg(struct net_device *dev, pch = tmp; DBG_871X("pch=%s",pch); - while ( *pch != '\0' ) + while (*pch != '\0') { pnext = strpbrk(pch, " "); if (!pnext) break; pnext++; - if ( *pnext != '\0' ) + if (*pnext != '\0') { strtout = simple_strtoul (pnext , &ptmp, 16); - sprintf( extra, "%s %d" ,extra ,strtout ); + sprintf(extra, "%s %d" ,extra ,strtout); } else{ break; @@ -9997,14 +9949,14 @@ static int rtw_mp_read_reg(struct net_device *dev, //*data = rtw_read32(padapter, addr); sprintf(data, "%08x", rtw_read32(padapter, addr)); //add read data format blank - for ( i=0 ; i <= strlen(data) ; i++) + for (i=0 ; i <= strlen(data) ; i++) { - if ( i%2==0 ) + if (i%2==0) { tmp[j]=' '; j++; } - if ( data[i] != '\0' ) + if (data[i] != '\0') tmp[j] = data[i]; j++; @@ -10012,17 +9964,17 @@ static int rtw_mp_read_reg(struct net_device *dev, pch = tmp; DBG_871X("pch=%s",pch); - while ( *pch != '\0' ) + while (*pch != '\0') { pnext = strpbrk(pch, " "); if (!pnext) break; pnext++; - if ( *pnext != '\0' ) + if (*pnext != '\0') { strtout = simple_strtoul (pnext , &ptmp, 16); - sprintf( extra, "%s %d" ,extra ,strtout ); + sprintf(extra, "%s %d" ,extra ,strtout); } else{ break; @@ -10114,9 +10066,9 @@ static int rtw_mp_read_rf(struct net_device *dev, //*data = read_rfreg(padapter, path, addr); sprintf(data, "%08x", read_rfreg(padapter, path, addr)); //add read data format blank - for ( i=0 ; i <= strlen(data) ; i++) + for (i=0 ; i <= strlen(data) ; i++) { - if ( i%2==0 ) + if (i%2==0) { tmp[j]=' '; j++; @@ -10127,14 +10079,14 @@ static int rtw_mp_read_rf(struct net_device *dev, pch = tmp; DBG_871X("pch=%s",pch); - while ( *pch != '\0' ) + while (*pch != '\0') { pnext = strpbrk(pch, " "); pnext++; - if ( *pnext != '\0' ) + if (*pnext != '\0') { strtou = simple_strtoul (pnext , &ptmp, 16); - sprintf( extra, "%s %d" ,extra ,strtou ); + sprintf(extra, "%s %d" ,extra ,strtou); } else{ break; @@ -10219,16 +10171,16 @@ static int rtw_mp_rate(struct net_device *dev, return -EFAULT; rate = rtw_atoi(input); - sprintf( extra, "Set data rate to %d" , rate ); + sprintf(extra, "Set data rate to %d" , rate); if (rate <= 0x7f) - rate = wifirate2_ratetbl_inx( (u8)rate); + rate = wifirate2_ratetbl_inx((u8)rate); else rate =(rate-0x80+MPT_RATE_MCS0); //DBG_871X("%s: rate=%d\n", __func__, rate); - if (rate >= MPT_RATE_LAST ) + if (rate >= MPT_RATE_LAST) return -EINVAL; padapter->mppriv.rateidx = rate; @@ -10252,7 +10204,7 @@ static int rtw_mp_channel(struct net_device *dev, channel = rtw_atoi(input); //DBG_871X("%s: channel=%d\n", __func__, channel); - sprintf( extra, "Change channel %d to channel %d", padapter->mppriv.channel , channel ); + sprintf(extra, "Change channel %d to channel %d", padapter->mppriv.channel , channel); padapter->mppriv.channel = channel; Hal_SetChannel(padapter); @@ -10304,7 +10256,7 @@ static int rtw_mp_txpower(struct net_device *dev, sscanf(input,"patha=%d,pathb=%d",&idx_a,&idx_b); //DBG_871X("%s: tx_pwr_idx_a=%x b=%x\n", __func__, idx_a, idx_b); - sprintf( extra, "Set power level path_A:%d path_B:%d", idx_a , idx_b ); + sprintf(extra, "Set power level path_A:%d path_B:%d", idx_a , idx_b); padapter->mppriv.txpoweridx = (u8)idx_a; padapter->mppriv.txpoweridx_b = (u8)idx_b; padapter->mppriv.bSetTxPower = 1; @@ -10328,7 +10280,7 @@ static int rtw_mp_ant_tx(struct net_device *dev, //DBG_871X("%s: input=%s\n", __func__, input); - sprintf( extra, "switch Tx antenna to %s", input ); + sprintf(extra, "switch Tx antenna to %s", input); for (i=0; i < strlen(input); i++) { @@ -10367,11 +10319,11 @@ static int rtw_mp_ant_rx(struct net_device *dev, //DBG_871X("%s: input=%s\n", __func__, input); _rtw_memset(extra, 0, wrqu->length); - sprintf( extra, "switch Rx antenna to %s", input ); + sprintf(extra, "switch Rx antenna to %s", input); for (i=0; i < strlen(input); i++) { - switch ( input[i] ) + switch (input[i]) { case 'a' : antenna|=ANTENNA_A; @@ -10426,7 +10378,7 @@ static int rtw_mp_ctx(struct net_device *dev, if (stop == 0) { bStartTest = 0; // To set Stop pmp_priv->tx.stop = 1; - sprintf( extra, "Stop continuous Tx"); + sprintf(extra, "Stop continuous Tx"); } else { bStartTest = 1; if (pmp_priv->mode != MP_ON) { @@ -10457,11 +10409,11 @@ static int rtw_mp_ctx(struct net_device *dev, { pmp_priv->tx.stop = 1; pmp_priv->mode = MP_ON; - sprintf( extra, "Stop continuous Tx"); + sprintf(extra, "Stop continuous Tx"); } else if (pmp_priv->tx.stop == 1) { - sprintf( extra, "Start continuous DA=ffffffffffff len=1500 count=%u,\n",count); + sprintf(extra, "Start continuous DA=ffffffffffff len=1500 count=%u,\n",count); //DBG_871X("%s:countPkTx %d\n", __func__,count); pmp_priv->tx.stop = 0; pmp_priv->tx.count = count; @@ -10481,7 +10433,7 @@ static int rtw_mp_ctx(struct net_device *dev, case MP_SINGLE_TONE_TX: //DBG_871X("%s: sgleTx %d\n", __func__, bStartTest); if (bStartTest != 0){ - sprintf( extra, "Start continuous DA=ffffffffffff len=1500\n infinite=yes."); + sprintf(extra, "Start continuous DA=ffffffffffff len=1500\n infinite=yes."); } Hal_SetSingleToneTx(padapter, (u8)bStartTest); break; @@ -10489,7 +10441,7 @@ static int rtw_mp_ctx(struct net_device *dev, case MP_CONTINUOUS_TX: //DBG_871X("%s: cotuTx %d\n", __func__, bStartTest); if (bStartTest != 0){ - sprintf( extra, "Start continuous DA=ffffffffffff len=1500\n infinite=yes."); + sprintf(extra, "Start continuous DA=ffffffffffff len=1500\n infinite=yes."); } Hal_SetContinuousTx(padapter, (u8)bStartTest); break; @@ -10497,30 +10449,30 @@ static int rtw_mp_ctx(struct net_device *dev, case MP_CARRIER_SUPPRISSION_TX: //DBG_871X("%s: CarrSprTx %d\n", __func__, bStartTest); if (bStartTest != 0){ - if ( pmp_priv->rateidx <= MPT_RATE_11M ) + if (pmp_priv->rateidx <= MPT_RATE_11M) { - sprintf( extra, "Start continuous DA=ffffffffffff len=1500\n infinite=yes."); + sprintf(extra, "Start continuous DA=ffffffffffff len=1500\n infinite=yes."); Hal_SetCarrierSuppressionTx(padapter, (u8)bStartTest); }else - sprintf( extra, "Specify carrier suppression but not CCK rate"); + sprintf(extra, "Specify carrier suppression but not CCK rate"); } break; case MP_SINGLE_CARRIER_TX: //DBG_871X("%s: scTx %d\n", __func__, bStartTest); if (bStartTest != 0){ - sprintf( extra, "Start continuous DA=ffffffffffff len=1500\n infinite=yes."); + sprintf(extra, "Start continuous DA=ffffffffffff len=1500\n infinite=yes."); } Hal_SetSingleCarrierTx(padapter, (u8)bStartTest); break; default: //DBG_871X("%s:No Match MP_MODE\n", __func__); - sprintf( extra, "Error! Continuous-Tx is not on-going."); + sprintf(extra, "Error! Continuous-Tx is not on-going."); return -EFAULT; } - if ( bStartTest==1 && pmp_priv->mode != MP_ON) { + if (bStartTest==1 && pmp_priv->mode != MP_ON) { struct mp_priv *pmp_priv = &padapter->mppriv; if (pmp_priv->tx.stop == 0) { pmp_priv->tx.stop = 1; @@ -10560,13 +10512,13 @@ static int rtw_mp_arx(struct net_device *dev, if (bStartRx) { - sprintf( extra, "start"); + sprintf(extra, "start"); SetPacketRx(padapter, bStartRx); } else if (bStopRx) { SetPacketRx(padapter, 0); - sprintf( extra, "Received packet OK:%d CRC error:%d",padapter->mppriv.rx_pktcount,padapter->mppriv.rx_crcerrpktcount); + sprintf(extra, "Received packet OK:%d CRC error:%d",padapter->mppriv.rx_pktcount,padapter->mppriv.rx_crcerrpktcount); } else if (bQueryPhy) { @@ -10581,22 +10533,22 @@ static int rtw_mp_arx(struct net_device *dev, CCK FA (RegA5B<<8) | RegA5C */ - cckok = read_bbreg(padapter, 0xf88, 0xffffffff ); - cckcrc = read_bbreg(padapter, 0xf84, 0xffffffff ); - ofdmok = read_bbreg(padapter, 0xf94, 0x0000FFFF ); - ofdmcrc = read_bbreg(padapter, 0xf94 , 0xFFFF0000 ); - htok = read_bbreg(padapter, 0xf90, 0x0000FFFF ); - htcrc = read_bbreg(padapter,0xf90, 0xFFFF0000 ); + cckok = read_bbreg(padapter, 0xf88, 0xffffffff); + cckcrc = read_bbreg(padapter, 0xf84, 0xffffffff); + ofdmok = read_bbreg(padapter, 0xf94, 0x0000FFFF); + ofdmcrc = read_bbreg(padapter, 0xf94 , 0xFFFF0000); + htok = read_bbreg(padapter, 0xf90, 0x0000FFFF); + htcrc = read_bbreg(padapter,0xf90, 0xFFFF0000); - OFDM_FA=+read_bbreg(padapter, 0xcf0, 0x0000FFFF ); - OFDM_FA=+read_bbreg(padapter, 0xcf2, 0xFFFF0000 ); - OFDM_FA=+read_bbreg(padapter, 0xda0, 0xFFFF0000 ); - OFDM_FA=+read_bbreg(padapter, 0xda4, 0x0000FFFF ); - OFDM_FA=+read_bbreg(padapter, 0xda4, 0xFFFF0000 ); - OFDM_FA=+read_bbreg(padapter, 0xda8, 0x0000FFFF ); - CCK_FA=(rtw_read8(padapter, 0xa5b )<<8 ) | (rtw_read8(padapter, 0xa5c)); + OFDM_FA=+read_bbreg(padapter, 0xcf0, 0x0000FFFF); + OFDM_FA=+read_bbreg(padapter, 0xcf2, 0xFFFF0000); + OFDM_FA=+read_bbreg(padapter, 0xda0, 0xFFFF0000); + OFDM_FA=+read_bbreg(padapter, 0xda4, 0x0000FFFF); + OFDM_FA=+read_bbreg(padapter, 0xda4, 0xFFFF0000); + OFDM_FA=+read_bbreg(padapter, 0xda8, 0x0000FFFF); + CCK_FA=(rtw_read8(padapter, 0xa5b)<<8) | (rtw_read8(padapter, 0xa5c)); - sprintf( extra, "Phy Received packet OK:%d CRC error:%d FA Counter: %d",cckok+ofdmok+htok,cckcrc+ofdmcrc+htcrc,OFDM_FA+CCK_FA); + sprintf(extra, "Phy Received packet OK:%d CRC error:%d FA Counter: %d",cckok+ofdmok+htok,cckcrc+ofdmcrc+htcrc,OFDM_FA+CCK_FA); } wrqu->length = strlen(extra) + 1; return 0; @@ -10711,16 +10663,16 @@ static int rtw_mp_thermal(struct net_device *dev, Hal_GetThermalMeter(padapter, &val); - if ( bwrite == 0 ) + if (bwrite == 0) { //DBG_871X("to write val:%d",val); EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (PVOID)&max_available_size, _FALSE); - if ( 2 > max_available_size ) + if (2 > max_available_size) { DBG_871X("no available efuse!\n"); return -EFAULT; } - if ( rtw_efuse_map_write(padapter, addr, cnt, &val) == _FAIL ) + if (rtw_efuse_map_write(padapter, addr, cnt, &val) == _FAIL) { DBG_871X("rtw_efuse_map_write error\n"); return -EFAULT; @@ -10779,16 +10731,16 @@ static int rtw_mp_dump(struct net_device *dev, //if (copy_from_user(extra, wrqu->data.pointer, wrqu->data.length)) // return -EFAULT; - if ( strncmp(extra, "all", 4)==0 ) + if (strncmp(extra, "all", 4)==0) { DBG_871X("\n======= MAC REG =======\n"); - for ( i=0x0;i<0x300;i+=4 ) + for (i=0x0;i<0x300;i+=4) { if (j%4==1) DBG_871X("0x%02x",i); DBG_871X(" 0x%08x ",rtw_read32(padapter,i)); if ((j++)%4 == 0) DBG_871X("\n"); } - for ( i=0x400;i<0x1000;i+=4 ) + for (i=0x400;i<0x1000;i+=4) { if (j%4==1) DBG_871X("0x%02x",i); DBG_871X(" 0x%08x ",rtw_read32(padapter,i)); @@ -10799,7 +10751,7 @@ static int rtw_mp_dump(struct net_device *dev, rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type)); DBG_871X("\n======= RF REG =======\n"); - if (( RF_1T2R == rf_type ) ||( RF_1T1R ==rf_type )) + if ((RF_1T2R == rf_type) ||(RF_1T1R ==rf_type)) path_nums = 1; else path_nums = 2; @@ -10842,10 +10794,10 @@ static int rtw_mp_phypara(struct net_device *dev, if (!IS_HARDWARE_TYPE_8192D(padapter)) return 0; #ifdef CONFIG_RTL8192D - Hal_ProSetCrystalCap( padapter , valxcap ); + Hal_ProSetCrystalCap(padapter , valxcap); #endif - sprintf( extra, "Set xcap=%d",valxcap ); + sprintf(extra, "Set xcap=%d",valxcap); wrqu->length = strlen(extra) + 1; return 0; @@ -10953,7 +10905,7 @@ static int rtw_mp_SetBT(struct net_device *dev, testctrl = strncmp(extra, "testctrl", 8); testbt = strncmp(extra, "testbt", 6); - if ( strncmp(extra, "dlfw", 4) == 0) + if (strncmp(extra, "dlfw", 4) == 0) { status = rtl8723a_FirmwareDownload(padapter); if (status==_SUCCESS) @@ -10965,14 +10917,14 @@ static int rtw_mp_SetBT(struct net_device *dev, } goto exit; } - if ( testbt==0 ) + if (testbt==0) { BtReq.opCodeVer=1; BtReq.OpCode=6; BtReq.paraLength=cnts/2; goto todo; } - if ( ready==0 ) + if (ready==0) { BtReq.opCodeVer=1; BtReq.OpCode=0; @@ -11009,33 +10961,33 @@ static int rtw_mp_SetBT(struct net_device *dev, } } - if ( testmode==0 ) + if (testmode==0) { BtReq.opCodeVer=1; BtReq.OpCode=1; BtReq.paraLength=1; } - if ( trxparam==0 ) + if (trxparam==0) { BtReq.opCodeVer=1; BtReq.OpCode=2; BtReq.paraLength=cnts/2; } - if ( setgen==0 ) + if (setgen==0) { DBG_871X("%s: BT_SET_GENERAL\n", __func__); BtReq.opCodeVer=1; BtReq.OpCode=3; //BT_SET_GENERAL 3 BtReq.paraLength=cnts/2; } - if ( getgen==0 ) + if (getgen==0) { DBG_871X("%s: BT_GET_GENERAL\n", __func__); BtReq.opCodeVer=1; BtReq.OpCode=4; //BT_GET_GENERAL 4 BtReq.paraLength=cnts/2; } - if ( testctrl==0 ) + if (testctrl==0) { DBG_871X("%s: BT_TEST_CTRL\n", __func__); BtReq.opCodeVer=1; @@ -11276,9 +11228,9 @@ static int rtw_wfd_tdls_enable(struct net_device *dev, _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - printk( "[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); + printk("[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); - if ( extra[ 0 ] == '0' ) + if (extra[ 0 ] == '0') { padapter->wdinfo.wfd_tdls_enable = 0; } @@ -11304,9 +11256,9 @@ static int rtw_tdls_weaksec(struct net_device *dev, u8 i, j; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - DBG_871X( "[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); + DBG_871X("[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); - if ( extra[ 0 ] == '0' ) + if (extra[ 0 ] == '0') { padapter->wdinfo.wfd_tdls_weaksec = 0; } @@ -11338,11 +11290,11 @@ static int rtw_tdls_enable(struct net_device *dev, u8 tdls_sta[NUM_STA][ETH_ALEN]; u8 empty_hwaddr[ETH_ALEN] = { 0x00 }; - printk( "[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); + printk("[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); _rtw_memset(tdls_sta, 0x00, sizeof(tdls_sta)); - if ( extra[ 0 ] == '0' ) + if (extra[ 0 ] == '0') { ptdlsinfo->enable = 0; @@ -11371,7 +11323,7 @@ static int rtw_tdls_enable(struct net_device *dev, for (index=0; index< NUM_STA; index++) { - if ( !_rtw_memcmp(tdls_sta[index], empty_hwaddr, ETH_ALEN) ) + if (!_rtw_memcmp(tdls_sta[index], empty_hwaddr, ETH_ALEN)) { printk("issue tear down to "MAC_FMT"\n", MAC_ARG(tdls_sta[index])); issue_tdls_teardown(padapter, tdls_sta[index]); @@ -11380,7 +11332,7 @@ static int rtw_tdls_enable(struct net_device *dev, rtw_tdls_cmd(padapter, myid(&(padapter->eeprompriv)), TDLS_RS_RCR); rtw_reset_tdls_info(padapter); } - else if ( extra[ 0 ] == '1' ) + else if (extra[ 0 ] == '1') { ptdlsinfo->enable = 1; } @@ -11405,20 +11357,20 @@ static int rtw_tdls_setup(struct net_device *dev, struct wifidirect_info *pwdinfo= &(padapter->wdinfo); #endif // CONFIG_WFD - printk( "[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); + printk("[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); - for ( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){ + for (i=0, j=0 ; i < ETH_ALEN; i++, j+=3){ mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1)); } #ifdef CONFIG_WFD - if ( _AES_ != padapter->securitypriv.dot11PrivacyAlgrthm ) + if (_AES_ != padapter->securitypriv.dot11PrivacyAlgrthm) { // Weak Security situation with AP. - if ( 0 == pwdinfo->wfd_tdls_weaksec ) + if (0 == pwdinfo->wfd_tdls_weaksec) { // Can't send the tdls setup request out!! - DBG_871X( "[%s] Current link is not AES, SKIP sending the tdls setup request!!\n", __func__ ); + DBG_871X("[%s] Current link is not AES, SKIP sending the tdls setup request!!\n", __func__); } else { @@ -11448,13 +11400,13 @@ static int rtw_tdls_teardown(struct net_device *dev, struct sta_info *ptdls_sta = NULL; u8 mac_addr[ETH_ALEN]; - DBG_871X( "[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); + DBG_871X("[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); - for ( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){ + for (i=0, j=0 ; i < ETH_ALEN; i++, j+=3){ mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1)); } - ptdls_sta = rtw_get_stainfo( &(padapter->stapriv), mac_addr); + ptdls_sta = rtw_get_stainfo(&(padapter->stapriv), mac_addr); if (ptdls_sta != NULL) { @@ -11479,7 +11431,7 @@ static int rtw_tdls_discovery(struct net_device *dev, struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - DBG_871X( "[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); + DBG_871X("[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); issue_tdls_dis_req(padapter, NULL); @@ -11501,14 +11453,14 @@ static int rtw_tdls_ch_switch (struct net_device *dev, u8 i, j, mac_addr[ETH_ALEN]; struct sta_info *ptdls_sta = NULL; - DBG_8192C( "[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); + DBG_8192C("[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); - for ( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){ + for (i=0, j=0 ; i < ETH_ALEN; i++, j+=3){ mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1)); } ptdls_sta = rtw_get_stainfo(&padapter->stapriv, mac_addr); - if ( ptdls_sta == NULL ) + if (ptdls_sta == NULL) return ret; ptdlsinfo->ch_sensing=1; @@ -11533,9 +11485,9 @@ static int rtw_tdls_pson(struct net_device *dev, u8 i, j, mac_addr[ETH_ALEN]; struct sta_info *ptdls_sta = NULL; - DBG_871X( "[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); + DBG_871X("[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); - for ( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){ + for (i=0, j=0 ; i < ETH_ALEN; i++, j+=3){ mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1)); } @@ -11562,9 +11514,9 @@ static int rtw_tdls_psoff(struct net_device *dev, u8 i, j, mac_addr[ETH_ALEN]; struct sta_info *ptdls_sta = NULL; - DBG_8192C( "[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); + DBG_8192C("[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); - for ( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){ + for (i=0, j=0 ; i < ETH_ALEN; i++, j+=3){ mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1)); } @@ -11591,21 +11543,21 @@ static int rtw_tdls_setip(struct net_device *dev, struct wifi_display_info *pwfd_info = ptdlsinfo->wfd_info; u8 i=0, j=0, k=0, tag=0, ip[3] = { 0xff }, *ptr = extra; - printk( "[%s] %s %d\n", __func__, extra, wrqu->data.length - 1 ); + printk("[%s] %s %d\n", __func__, extra, wrqu->data.length - 1 ); - while ( i < 4 ) + while (i < 4) { - for ( j=0; j < 4; j++) + for (j=0; j < 4; j++) { - if ( *( extra + j + tag ) == '.' || *( extra + j + tag ) == '\0' ) + if (*(extra + j + tag) == '.' || *(extra + j + tag) == '\0') { - if ( j == 1 ) - pwfd_info->ip_address[i]=convert_ip_addr( '0', '0', *(extra+(j-1)+tag)); - if ( j == 2 ) - pwfd_info->ip_address[i]=convert_ip_addr( '0', *(extra+(j-2)+tag), *(extra+(j-1)+tag)); - if ( j == 3 ) - pwfd_info->ip_address[i]=convert_ip_addr( *(extra+(j-3)+tag), *(extra+(j-2)+tag), *(extra+(j-1)+tag)); + if (j == 1) + pwfd_info->ip_address[i]=convert_ip_addr('0', '0', *(extra+(j-1)+tag)); + if (j == 2) + pwfd_info->ip_address[i]=convert_ip_addr('0', *(extra+(j-2)+tag), *(extra+(j-1)+tag)); + if (j == 3) + pwfd_info->ip_address[i]=convert_ip_addr(*(extra+(j-3)+tag), *(extra+(j-2)+tag), *(extra+(j-1)+tag)); tag += j + 1; break; @@ -11614,7 +11566,7 @@ static int rtw_tdls_setip(struct net_device *dev, i++; } - printk( "[%s] Set IP = %u.%u.%u.%u\n", __func__, + printk("[%s] Set IP = %u.%u.%u.%u\n", __func__, ptdlsinfo->wfd_info->ip_address[0], ptdlsinfo->wfd_info->ip_address[1], ptdlsinfo->wfd_info->ip_address[2], ptdlsinfo->wfd_info->ip_address[3] ); @@ -11638,19 +11590,19 @@ static int rtw_tdls_getip(struct net_device *dev, struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; struct wifi_display_info *pwfd_info = ptdlsinfo->wfd_info; - printk( "[%s]\n", __func__); + printk("[%s]\n", __func__); - sprintf( extra, "\n\n%u.%u.%u.%u\n", + sprintf(extra, "\n\n%u.%u.%u.%u\n", pwfd_info->peer_ip_address[0], pwfd_info->peer_ip_address[1], pwfd_info->peer_ip_address[2], pwfd_info->peer_ip_address[3] ); - printk( "[%s] IP=%u.%u.%u.%u\n", __func__, + printk("[%s] IP=%u.%u.%u.%u\n", __func__, pwfd_info->peer_ip_address[0], pwfd_info->peer_ip_address[1], pwfd_info->peer_ip_address[2], pwfd_info->peer_ip_address[3] ); - wrqu->data.length = strlen( extra ); + wrqu->data.length = strlen(extra); #endif //CONFIG_WFD #endif //CONFIG_TDLS @@ -11672,12 +11624,12 @@ static int rtw_tdls_getport(struct net_device *dev, struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; struct wifi_display_info *pwfd_info = ptdlsinfo->wfd_info; - printk( "[%s]\n", __func__); + printk("[%s]\n", __func__); - sprintf( extra, "\n\n%d\n", pwfd_info->peer_rtsp_ctrlport ); - printk( "[%s] remote port = %d\n", __func__, pwfd_info->peer_rtsp_ctrlport ); + sprintf(extra, "\n\n%d\n", pwfd_info->peer_rtsp_ctrlport); + printk("[%s] remote port = %d\n", __func__, pwfd_info->peer_rtsp_ctrlport); - wrqu->data.length = strlen( extra ); + wrqu->data.length = strlen(extra); #endif //CONFIG_WFD #endif //CONFIG_TDLS @@ -11701,15 +11653,15 @@ static int rtw_tdls_dis_result(struct net_device *dev, struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; struct wifi_display_info *pwfd_info = ptdlsinfo->wfd_info; - printk( "[%s]\n", __func__); + printk("[%s]\n", __func__); - if (ptdlsinfo->dev_discovered == 1 ) + if (ptdlsinfo->dev_discovered == 1) { - sprintf( extra, "\n\nDis=1\n" ); + sprintf(extra, "\n\nDis=1\n"); ptdlsinfo->dev_discovered = 0; } - wrqu->data.length = strlen( extra ); + wrqu->data.length = strlen(extra); #endif //CONFIG_WFD #endif //CONFIG_TDLS @@ -11733,18 +11685,18 @@ static int rtw_wfd_tdls_status(struct net_device *dev, struct tdls_info *ptdlsinfo = &padapter->tdlsinfo; struct wifi_display_info *pwfd_info = ptdlsinfo->wfd_info; - printk( "[%s]\n", __func__); + printk("[%s]\n", __func__); - if (ptdlsinfo->setup_state == TDLS_LINKED_STATE ) + if (ptdlsinfo->setup_state == TDLS_LINKED_STATE) { - sprintf( extra, "\n\nStatus=1\n" ); + sprintf(extra, "\n\nStatus=1\n"); } else { - sprintf( extra, "\n\nStatus=0\n" ); + sprintf(extra, "\n\nStatus=0\n"); } - wrqu->data.length = strlen( extra ); + wrqu->data.length = strlen(extra); #endif //CONFIG_WFD #endif //CONFIG_TDLS @@ -11765,9 +11717,9 @@ static int rtw_tdls_ch_switch_off(struct net_device *dev, u8 i, j, mac_addr[ETH_ALEN]; struct sta_info *ptdls_sta = NULL; - DBG_871X( "[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); + DBG_871X("[%s] %s %d\n", __func__, extra, wrqu->data.length -1 ); - for ( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){ + for (i=0, j=0 ; i < ETH_ALEN; i++, j+=3){ mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1)); } @@ -11796,75 +11748,75 @@ static int rtw_tdls(struct net_device *dev, #ifdef CONFIG_TDLS _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); - DBG_871X( "[%s] extra = %s\n", __func__, extra ); + DBG_871X("[%s] extra = %s\n", __func__, extra); // WFD Sigma will use the tdls enable command to let the driver know we want to test the tdls now! - if ( _rtw_memcmp( extra, "wfdenable=", 10 ) ) + if (_rtw_memcmp(extra, "wfdenable=", 10)) { wrqu->data.length -=10; - rtw_wfd_tdls_enable( dev, info, wrqu, &extra[10] ); + rtw_wfd_tdls_enable(dev, info, wrqu, &extra[10]); return ret; } - else if ( _rtw_memcmp( extra, "weaksec=", 8 ) ) + else if (_rtw_memcmp(extra, "weaksec=", 8)) { wrqu->data.length -=8; - rtw_tdls_weaksec( dev, info, wrqu, &extra[8] ); + rtw_tdls_weaksec(dev, info, wrqu, &extra[8]); return ret; } - else if ( _rtw_memcmp( extra, "tdlsenable=", 11 ) ) + else if (_rtw_memcmp(extra, "tdlsenable=", 11)) { wrqu->data.length -=11; - rtw_tdls_enable( dev, info, wrqu, &extra[11] ); + rtw_tdls_enable(dev, info, wrqu, &extra[11]); return ret; } - if ( padapter->tdlsinfo.enable == 0 ) + if (padapter->tdlsinfo.enable == 0) { printk("tdls haven't enabled\n"); return 0; } - if ( _rtw_memcmp( extra, "setup=", 6 ) ) + if (_rtw_memcmp(extra, "setup=", 6)) { wrqu->data.length -=6; - rtw_tdls_setup( dev, info, wrqu, &extra[6] ); + rtw_tdls_setup(dev, info, wrqu, &extra[6]); } - else if (_rtw_memcmp( extra, "tear=", 5 ) ) + else if (_rtw_memcmp(extra, "tear=", 5)) { wrqu->data.length -= 5; - rtw_tdls_teardown( dev, info, wrqu, &extra[5] ); + rtw_tdls_teardown(dev, info, wrqu, &extra[5]); } - else if (_rtw_memcmp( extra, "dis=", 4 ) ) + else if (_rtw_memcmp(extra, "dis=", 4)) { wrqu->data.length -= 4; - rtw_tdls_discovery( dev, info, wrqu, &extra[4] ); + rtw_tdls_discovery(dev, info, wrqu, &extra[4]); } - else if (_rtw_memcmp( extra, "sw=", 3 ) ) + else if (_rtw_memcmp(extra, "sw=", 3)) { wrqu->data.length -= 3; - rtw_tdls_ch_switch ( dev, info, wrqu, &extra[3] ); + rtw_tdls_ch_switch (dev, info, wrqu, &extra[3]); } - else if (_rtw_memcmp( extra, "swoff=", 6 ) ) + else if (_rtw_memcmp(extra, "swoff=", 6)) { wrqu->data.length -= 6; - rtw_tdls_ch_switch_off( dev, info, wrqu, &extra[6] ); + rtw_tdls_ch_switch_off(dev, info, wrqu, &extra[6]); } - else if (_rtw_memcmp( extra, "pson=", 5 ) ) + else if (_rtw_memcmp(extra, "pson=", 5)) { wrqu->data.length -= 5; - rtw_tdls_pson( dev, info, wrqu, &extra[5] ); + rtw_tdls_pson(dev, info, wrqu, &extra[5]); } - else if (_rtw_memcmp( extra, "psoff=", 6 ) ) + else if (_rtw_memcmp(extra, "psoff=", 6)) { wrqu->data.length -= 6; - rtw_tdls_psoff( dev, info, wrqu, &extra[6] ); + rtw_tdls_psoff(dev, info, wrqu, &extra[6]); } #ifdef CONFIG_WFD - else if (_rtw_memcmp( extra, "setip=", 6 ) ) + else if (_rtw_memcmp(extra, "setip=", 6)) { wrqu->data.length -= 6; - rtw_tdls_setip( dev, info, wrqu, &extra[6] ); + rtw_tdls_setip(dev, info, wrqu, &extra[6]); } - else if (_rtw_memcmp( extra, "tprobe=", 6 ) ) + else if (_rtw_memcmp(extra, "tprobe=", 6)) { issue_tunneled_probe_req((_adapter *)rtw_netdev_priv(dev)); } @@ -11884,24 +11836,24 @@ static int rtw_tdls_get(struct net_device *dev, #ifdef CONFIG_WFD - DBG_871X( "[%s] extra = %s\n", __func__, (char*) wrqu->data.pointer ); + DBG_871X("[%s] extra = %s\n", __func__, (char*) wrqu->data.pointer); - if ( _rtw_memcmp( wrqu->data.pointer, "ip", 2 ) ) + if (_rtw_memcmp(wrqu->data.pointer, "ip", 2)) { - rtw_tdls_getip( dev, info, wrqu, extra ); + rtw_tdls_getip(dev, info, wrqu, extra); } - if ( _rtw_memcmp( wrqu->data.pointer, "port", 4 ) ) + if (_rtw_memcmp(wrqu->data.pointer, "port", 4)) { - rtw_tdls_getport( dev, info, wrqu, extra ); + rtw_tdls_getport(dev, info, wrqu, extra); } //WFDTDLS, for sigma test - if ( _rtw_memcmp( wrqu->data.pointer, "dis", 3 ) ) + if (_rtw_memcmp(wrqu->data.pointer, "dis", 3)) { - rtw_tdls_dis_result( dev, info, wrqu, extra ); + rtw_tdls_dis_result(dev, info, wrqu, extra); } - if ( _rtw_memcmp( wrqu->data.pointer, "status", 6 ) ) + if (_rtw_memcmp(wrqu->data.pointer, "status", 6)) { - rtw_wfd_tdls_status( dev, info, wrqu, extra ); + rtw_wfd_tdls_status(dev, info, wrqu, extra); } #endif //CONFIG_WFD @@ -11942,7 +11894,7 @@ static int rtw_widi_set_probe_request(struct net_device *dev, intel_widi_wk_cmd(padapter, INTEL_WIDI_ISSUE_PROB_WK, pbuf); } #else - DBG_871X( "[%s] len = %d\n", __func__,wrqu->data.length); + DBG_871X("[%s] len = %d\n", __func__,wrqu->data.length); issue_probereq_widi(padapter, wrqu->data.pointer); #endif diff --git a/os_dep/mlme_linux.c b/os_dep/mlme_linux.c index e687755..98193bb 100644 --- a/os_dep/mlme_linux.c +++ b/os_dep/mlme_linux.c @@ -137,9 +137,6 @@ void rtw_init_mlme_timer(_adapter *padapter) #endif } -extern void rtw_indicate_wx_assoc_event(_adapter *padapter); -extern void rtw_indicate_wx_disassoc_event(_adapter *padapter); - void rtw_os_indicate_connect(_adapter *adapter) {