diff options
Diffstat (limited to 'drivers/staging/rtl8192u')
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211.h | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 25 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/r8192U_core.c | 15 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/r8192U_dm.c | 6 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/r8192U_hw.h | 19 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/r819xU_cmdpkt.c | 41 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/r819xU_phy.c | 48 |
8 files changed, 71 insertions, 87 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index 39f4ddd86796..7903c777a417 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -2249,10 +2249,8 @@ void ieee80211_wake_queue(struct ieee80211_device *ieee); void ieee80211_stop_queue(struct ieee80211_device *ieee); struct sk_buff *ieee80211_get_beacon(struct ieee80211_device *ieee); void ieee80211_start_send_beacons(struct ieee80211_device *ieee); -void ieee80211_stop_send_beacons(struct ieee80211_device *ieee); int ieee80211_wpa_supplicant_ioctl(struct ieee80211_device *ieee, struct iw_point *p); -void notify_wx_assoc_event(struct ieee80211_device *ieee); void ieee80211_ps_tx_ack(struct ieee80211_device *ieee, short success); void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee); diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index 25ea8e1b6b65..ab885353f668 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c @@ -33,9 +33,9 @@ short ieee80211_is_shortslot(const struct ieee80211_network *net) } EXPORT_SYMBOL(ieee80211_is_shortslot); -/* returns the total length needed for pleacing the RATE MFIE +/* returns the total length needed for placing the RATE MFIE * tag and the EXTENDED RATE MFIE tag if needed. - * It encludes two bytes per tag for the tag itself and its len + * It includes two bytes per tag for the tag itself and its len */ static unsigned int ieee80211_MFIE_rate_len(struct ieee80211_device *ieee) { @@ -50,7 +50,7 @@ static unsigned int ieee80211_MFIE_rate_len(struct ieee80211_device *ieee) return rate_len; } -/* pleace the MFIE rate, tag to the memory (double) poined. +/* place the MFIE rate, tag to the memory (double) pointer. * Then it updates the pointer so that * it points after the new MFIE tag added. */ @@ -436,7 +436,7 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee) * So we switch to IEEE80211_LINKED_SCANNING to remember * that we are still logically linked (not interested in * new network events, despite for updating the net list, - * but we are temporarly 'unlinked' as the driver shall + * but we are temporarily 'unlinked' as the driver shall * not filter RX frames and the channel is changing. * So the only situation in witch are interested is to check * if the state become LINKED because of the #1 situation @@ -1162,7 +1162,7 @@ void ieee80211_associate_abort(struct ieee80211_device *ieee) ieee->associate_seq++; - /* don't scan, and avoid to have the RX path possibily + /* don't scan, and avoid having the RX path possibly * try again to associate. Even do not react to AUTH or * ASSOC response. Just wait for the retry wq to be scheduled. * Here we will check if there are good nets to associate @@ -1373,7 +1373,7 @@ inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee, struct ieee /* if the user set the AP check if match. * if the network does not broadcast essid we check the user supplyed ANY essid * if the network does broadcast and the user does not set essid it is OK - * if the network does broadcast and the user did set essid chech if essid match + * if the network does broadcast and the user did set essid check if essid match */ if ((apset && apmatch && ((ssidset && ssidbroad && ssidmatch) || (ssidbroad && !ssidset) || (!ssidbroad && ssidset))) || @@ -1911,8 +1911,11 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb, if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) && ieee->state == IEEE80211_ASSOCIATING_AUTHENTICATED && ieee->iw_mode == IW_MODE_INFRA) { - struct ieee80211_network network_resp; - struct ieee80211_network *network = &network_resp; + struct ieee80211_network *network; + + network = kzalloc(sizeof(*network), GFP_KERNEL); + if (!network) + return -ENOMEM; errcode = assoc_parse(ieee, skb, &aid); if (!errcode) { @@ -1923,7 +1926,6 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb, /* Let the register setting defaultly with Legacy station */ if (ieee->qos_support) { assoc_resp = (struct ieee80211_assoc_response_frame *)skb->data; - memset(network, 0, sizeof(*network)); if (ieee80211_parse_info_param(ieee, assoc_resp->info_element,\ rx_stats->len - sizeof(*assoc_resp), \ network, rx_stats)) { @@ -1949,6 +1951,7 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb, else ieee80211_associate_abort(ieee); } + kfree(network); } break; @@ -2240,9 +2243,9 @@ static void ieee80211_start_ibss_wq(struct work_struct *work) * time to scan all the chans..) or we have just run up the iface * after setting ad-hoc mode. So we have to give another try.. * Here, in ibss mode, should be safe to do this without extra care - * (in bss mode we had to make sure no-one tryed to associate when + * (in bss mode we had to make sure no-one tried to associate when * we had just checked the ieee->state and we was going to start the - * scan) beacause in ibss mode the ieee80211_new_net function, when + * scan) because in ibss mode the ieee80211_new_net function, when * finds a good net, just set the ieee->state to IEEE80211_LINKED, * so, at worst, we waste a bit of time to initiate an unneeded syncro * scan, that will stop at the first round because it sees the state diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c index 96e6aaf859ec..8602e3a6c837 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c @@ -795,7 +795,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) success: //WB add to fill data tcb_desc here. only first fragment is considered, need to change, and you may remove to other place. if (txb) { - struct cb_desc *tcb_desc = (struct cb_desc *)(txb->fragments[0]->cb + MAX_DEV_ADDR_SIZE); + tcb_desc = (struct cb_desc *)(txb->fragments[0]->cb + MAX_DEV_ADDR_SIZE); tcb_desc->bTxEnableFwCalcDur = 1; if (is_multicast_ether_addr(header.addr1)) tcb_desc->bMulticast = 1; diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index f48186a89fa1..db26edeccea6 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -902,7 +902,6 @@ static void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev, int rate) { struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); - int ret; unsigned long flags; struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); u8 queue_index = tcb_desc->queue_index; @@ -915,7 +914,7 @@ static void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev, *(struct net_device **)(skb->cb) = dev; tcb_desc->bTxEnableFwCalcDur = 1; skb_push(skb, priv->ieee80211->tx_headroom); - ret = rtl8192_tx(dev, skb); + rtl8192_tx(dev, skb); spin_unlock_irqrestore(&priv->tx_lock, flags); } @@ -2304,8 +2303,6 @@ static int rtl8192_read_eeprom_info(struct net_device *dev) /* set channelplan from eeprom */ priv->ChannelPlan = priv->eeprom_ChannelPlan; if (bLoad_From_EEPOM) { - int i; - for (i = 0; i < 6; i += 2) { ret = eprom_read(dev, (u16)((EEPROM_NODE_ADDRESS_BYTE_0 + i) >> 1)); if (ret < 0) @@ -2369,8 +2366,6 @@ static int rtl8192_read_eeprom_info(struct net_device *dev) priv->EEPROM_Def_Ver = 1; RT_TRACE(COMP_EPROM, "EEPROM_DEF_VER:%d\n", priv->EEPROM_Def_Ver); if (priv->EEPROM_Def_Ver == 0) { /* old eeprom definition */ - int i; - if (bLoad_From_EEPOM) { ret = eprom_read(dev, (EEPROM_TX_PW_INDEX_CCK >> 1)); if (ret < 0) @@ -2972,12 +2967,10 @@ static RESET_TYPE RxCheckStuck(struct net_device *dev) return RESET_TYPE_NORESET; } -/** +/* * This function is called by Checkforhang to check whether we should * ask OS to reset driver * - * \param pAdapter The adapter context for this miniport - * * Note:NIC with USB interface sholud not call this function because we * cannot scan descriptor to judge whether there is tx stuck. * Note: This function may be required to be rewrite for Vista OS. @@ -3697,7 +3690,7 @@ static u8 HwRateToMRate90(bool bIsHT, u8 rate) return ret_rate; } -/** +/* * Function: UpdateRxPktTimeStamp * Overview: Record the TSF time stamp when receiving a packet * @@ -4297,7 +4290,7 @@ static void TranslateRxSignalStuff819xUsb(struct sk_buff *skb, rtl8192_record_rxdesc_forlateruse(pstats, &previous_stats); } -/** +/* * Function: UpdateReceivedRateHistogramStatistics * Overview: Record the received data rate * diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index bac402b40121..725bf5ca9e34 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -2876,7 +2876,8 @@ void dm_check_fsync(struct net_device *dev) * When Who Remark * 05/29/2008 amy Create Version 0 porting from windows code. * - *---------------------------------------------------------------------------*/ + *--------------------------------------------------------------------------- + */ void dm_shadow_init(struct net_device *dev) { u8 page; @@ -2915,7 +2916,8 @@ void dm_shadow_init(struct net_device *dev) * When Who Remark * 03/06/2008 Jacken Create Version 0. * - *---------------------------------------------------------------------------*/ + *--------------------------------------------------------------------------- + */ static void dm_init_dynamic_txpower(struct net_device *dev) { struct r8192_priv *priv = ieee80211_priv(dev); diff --git a/drivers/staging/rtl8192u/r8192U_hw.h b/drivers/staging/rtl8192u/r8192U_hw.h index 8d3a592f1c35..217e77766442 100644 --- a/drivers/staging/rtl8192u/r8192U_hw.h +++ b/drivers/staging/rtl8192u/r8192U_hw.h @@ -88,7 +88,7 @@ enum _RTL8192Usb_HW { #define RX_FIFO_THRESHOLD_MASK (BIT(13) | BIT(14) | BIT(15)) #define RX_FIFO_THRESHOLD_SHIFT 13 #define RX_FIFO_THRESHOLD_NONE 7 -#define MAX_RX_DMA_MASK (BIT(8) | BIT(9) | BIT(10)) +#define MAX_RX_DMA_MASK (BIT(8) | BIT(9) | BIT(10)) #define RCR_MXDMA_OFFSET 8 #define RCR_FIFO_OFFSET 13 #define RCR_ONLYERLPKT BIT(31) // Early Receiving based on Packet Size. @@ -159,7 +159,7 @@ enum _RTL8192Usb_HW { #define BW_OPMODE_20MHZ BIT(2) BW_OPMODE = 0x300, // Bandwidth operation mode MSR = 0x303, // Media Status register -#define MSR_LINK_MASK (BIT(0)|BIT(1)) +#define MSR_LINK_MASK (BIT(0) | BIT(1)) #define MSR_LINK_MANAGED 2 #define MSR_LINK_NONE 0 #define MSR_LINK_SHIFT 0 @@ -221,14 +221,13 @@ enum _RTL8192Usb_HW { #define RATR_MCS14 0x04000000 #define RATR_MCS15 0x08000000 // ALL CCK Rate -#define RATE_ALL_CCK RATR_1M|RATR_2M|RATR_55M|RATR_11M -#define RATE_ALL_OFDM_AG RATR_6M|RATR_9M|RATR_12M|RATR_18M|RATR_24M\ - |RATR_36M|RATR_48M|RATR_54M -#define RATE_ALL_OFDM_1SS RATR_MCS0|RATR_MCS1|RATR_MCS2|RATR_MCS3 | \ - RATR_MCS4|RATR_MCS5|RATR_MCS6|RATR_MCS7 -#define RATE_ALL_OFDM_2SS RATR_MCS8|RATR_MCS9 |RATR_MCS10|RATR_MCS11| \ - RATR_MCS12|RATR_MCS13|RATR_MCS14|RATR_MCS15 - +#define RATE_ALL_CCK (RATR_1M | RATR_2M | RATR_55M | RATR_11M) +#define RATE_ALL_OFDM_AG (RATR_6M | RATR_9M | RATR_12M | RATR_18M |\ + RATR_24M | RATR_36M | RATR_48M | RATR_54M) +#define RATE_ALL_OFDM_1SS (RATR_MCS0 | RATR_MCS1 | RATR_MCS2 | RATR_MCS3 |\ + RATR_MCS4 | RATR_MCS5 | RATR_MCS6 | RATR_MCS7) +#define RATE_ALL_OFDM_2SS (RATR_MCS8 | RATR_MCS9 | RATR_MCS10 | RATR_MCS11 |\ + RATR_MCS12 | RATR_MCS13 | RATR_MCS14 | RATR_MCS15) EPROM_CMD = 0xfe58, #define Cmd9346CR_9356SEL BIT(4) #define EPROM_CMD_OPERATING_MODE_SHIFT 6 diff --git a/drivers/staging/rtl8192u/r819xU_cmdpkt.c b/drivers/staging/rtl8192u/r819xU_cmdpkt.c index 4cece40a92f6..30a320422358 100644 --- a/drivers/staging/rtl8192u/r819xU_cmdpkt.c +++ b/drivers/staging/rtl8192u/r819xU_cmdpkt.c @@ -250,46 +250,6 @@ static void cmpk_handle_interrupt_status(struct net_device *dev, u8 *pmsg) } /*----------------------------------------------------------------------------- - * Function: cmpk_handle_query_config_rx() - * - * Overview: The function is responsible for extract the message from - * firmware. It will contain dedicated info in - * ws-06-0063-rtl8190-command-packet-specification. Please - * refer to chapter "Beacon State Element". - * - * Input: u8 *pmsg - Message Pointer of the command packet. - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/12/2008 amy Create Version 0 porting from windows code. - * - *--------------------------------------------------------------------------- - */ -static void cmpk_handle_query_config_rx(struct net_device *dev, u8 *pmsg) -{ - struct cmpk_query_cfg rx_query_cfg; - - /* 1. Extract TX feedback info from RFD to temp structure buffer. */ - /* It seems that FW use big endian(MIPS) and DRV use little endian in - * windows OS. So we have to read the content byte by byte or transfer - * endian type before copy the message copy. - */ - rx_query_cfg.cfg_action = (pmsg[4] & 0x80) >> 7; - rx_query_cfg.cfg_type = (pmsg[4] & 0x60) >> 5; - rx_query_cfg.cfg_size = (pmsg[4] & 0x18) >> 3; - rx_query_cfg.cfg_page = (pmsg[6] & 0x0F) >> 0; - rx_query_cfg.cfg_offset = pmsg[7]; - rx_query_cfg.value = (pmsg[8] << 24) | (pmsg[9] << 16) | - (pmsg[10] << 8) | (pmsg[11] << 0); - rx_query_cfg.mask = (pmsg[12] << 24) | (pmsg[13] << 16) | - (pmsg[14] << 8) | (pmsg[15] << 0); -} - -/*----------------------------------------------------------------------------- * Function: cmpk_count_tx_status() * * Overview: Count aggregated tx status from firmwar of one type rx command @@ -514,7 +474,6 @@ u32 cmpk_message_handle_rx(struct net_device *dev, break; case BOTH_QUERY_CONFIG: - cmpk_handle_query_config_rx(dev, pcmd_buff); cmd_length = CMPK_BOTH_QUERY_CONFIG_SIZE; break; diff --git a/drivers/staging/rtl8192u/r819xU_phy.c b/drivers/staging/rtl8192u/r819xU_phy.c index eef751d2b12e..37b82553412e 100644 --- a/drivers/staging/rtl8192u/r819xU_phy.c +++ b/drivers/staging/rtl8192u/r819xU_phy.c @@ -1185,14 +1185,32 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, u8 *stage, u8 *step, u32 *delay) { struct r8192_priv *priv = ieee80211_priv(dev); - struct sw_chnl_cmd PreCommonCmd[MAX_PRECMD_CNT]; + struct sw_chnl_cmd *PreCommonCmd; u32 PreCommonCmdCnt; - struct sw_chnl_cmd PostCommonCmd[MAX_POSTCMD_CNT]; + struct sw_chnl_cmd *PostCommonCmd; u32 PostCommonCmdCnt; - struct sw_chnl_cmd RfDependCmd[MAX_RFDEPENDCMD_CNT]; + struct sw_chnl_cmd *RfDependCmd; u32 RfDependCmdCnt; struct sw_chnl_cmd *CurrentCmd = NULL; u8 e_rfpath; + bool ret; + + PreCommonCmd = kzalloc(sizeof(*PreCommonCmd) * MAX_PRECMD_CNT, GFP_KERNEL); + if (!PreCommonCmd) + return false; + + PostCommonCmd = kzalloc(sizeof(*PostCommonCmd) * MAX_POSTCMD_CNT, GFP_KERNEL); + if (!PostCommonCmd) { + kfree(PreCommonCmd); + return false; + } + + RfDependCmd = kzalloc(sizeof(*RfDependCmd) * MAX_RFDEPENDCMD_CNT, GFP_KERNEL); + if (!RfDependCmd) { + kfree(PreCommonCmd); + kfree(PostCommonCmd); + return false; + } RT_TRACE(COMP_CH, "%s() stage: %d, step: %d, channel: %d\n", __func__, *stage, *step, channel); @@ -1201,7 +1219,8 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, /* return true to tell upper caller function this channel * setting is finished! Or it will in while loop. */ - return true; + ret = true; + goto out; } /* FIXME: need to check whether channel is legal or not here */ @@ -1227,7 +1246,8 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, RT_TRACE(COMP_ERR, "illegal channel for Zebra 8225: %d\n", channel); - return true; + ret = true; + goto out; } rtl8192_phy_SetSwChnlCmdArray(RfDependCmd, RfDependCmdCnt++, MAX_RFDEPENDCMD_CNT, @@ -1246,7 +1266,8 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, RT_TRACE(COMP_ERR, "illegal channel for Zebra 8256: %d\n", channel); - return true; + ret = true; + goto out; } rtl8192_phy_SetSwChnlCmdArray(RfDependCmd, RfDependCmdCnt++, MAX_RFDEPENDCMD_CNT, @@ -1262,7 +1283,8 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, default: RT_TRACE(COMP_ERR, "Unknown RFChipID: %d\n", priv->rf_chip); - return true; + ret = true; + goto out; } do { @@ -1281,7 +1303,8 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, if (CurrentCmd->cmd_id == CMD_ID_END) { if ((*stage) == 2) { (*delay) = CurrentCmd->ms_delay; - return true; + ret = true; + goto out; } (*stage)++; (*step) = 0; @@ -1324,7 +1347,14 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, (*delay) = CurrentCmd->ms_delay; (*step)++; - return false; + ret = false; + +out: + kfree(PreCommonCmd); + kfree(PostCommonCmd); + kfree(RfDependCmd); + + return ret; } /****************************************************************************** |