diff options
Diffstat (limited to 'drivers/staging/rtl8192e')
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 9 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.h | 4 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 6 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/rtl_pci.c | 8 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtllib.h | 8 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_softmac.c | 24 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_softmac_wx.c | 7 |
8 files changed, 33 insertions, 35 deletions
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c index b526fa42867..dd2a96bfcc0 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c @@ -265,10 +265,11 @@ bool init_firmware(struct net_device *dev) case FW_SOURCE_IMG_FILE: { if (pfirmware->firmware_buf_size[init_step] == 0) { - const char *fw_name[3] = { "RTL8192E/boot.img", - "RTL8192E/main.img", - "RTL8192E/data.img" - }; + const char *fw_name[3] = { + RTL8192E_BOOT_IMG_FW, + RTL8192E_MAIN_IMG_FW, + RTL8192E_DATA_IMG_FW + }; const struct firmware *fw_entry; int rc; rc = request_firmware(&fw_entry, diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.h index caa87883310..06d6abc8345 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.h +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.h @@ -23,6 +23,10 @@ #define GET_COMMAND_PACKET_FRAG_THRESHOLD(v) (4*(v/4) - 8) +#define RTL8192E_BOOT_IMG_FW "RTL8192E/boot.img" +#define RTL8192E_MAIN_IMG_FW "RTL8192E/main.img" +#define RTL8192E_DATA_IMG_FW "RTL8192E/data.img" + enum firmware_init_step { FW_INIT_STEP0_BOOT = 0, FW_INIT_STEP1_MAIN = 1, diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 4f602b227b5..81134d312ee 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -734,8 +734,7 @@ static void rtl8192_prepare_beacon(struct r8192_priv *priv) ring = &priv->tx_ring[BEACON_QUEUE]; pskb = __skb_dequeue(&ring->queue); - if (pskb) - kfree_skb(pskb); + kfree_skb(pskb); pnewskb = rtllib_get_beacon(priv->rtllib); if (!pnewskb) @@ -3125,6 +3124,9 @@ MODULE_DESCRIPTION("Linux driver for Realtek RTL819x WiFi cards"); MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR); MODULE_VERSION(DRV_VERSION); MODULE_LICENSE("GPL"); +MODULE_FIRMWARE(RTL8192E_BOOT_IMG_FW); +MODULE_FIRMWARE(RTL8192E_MAIN_IMG_FW); +MODULE_FIRMWARE(RTL8192E_DATA_IMG_FW); module_param(ifname, charp, S_IRUGO|S_IWUSR); module_param(hwwep, int, S_IRUGO|S_IWUSR); diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c index 481b1e4d491..1853665764a 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c @@ -202,7 +202,7 @@ static void dm_check_ac_dc_power(struct net_device *dev) if (priv->ResetProgress == RESET_TYPE_SILENT) { RT_TRACE((COMP_INIT | COMP_POWER | COMP_RF), - "GPIOChangeRFWorkItemCallBack(): Silent Reseting!!!!!!!\n"); + "GPIOChangeRFWorkItemCallBack(): Silent Reset!!!!!!!\n"); return; } diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c b/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c index ddadcc3e4e7..5abbee37cdc 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c @@ -31,12 +31,10 @@ static void rtl8192_parse_pci_configuration(struct pci_dev *pdev, struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); u8 tmp; - int pos; - u8 LinkCtrlReg; + u16 LinkCtrlReg; - pos = pci_find_capability(priv->pdev, PCI_CAP_ID_EXP); - pci_read_config_byte(priv->pdev, pos + PCI_EXP_LNKCTL, &LinkCtrlReg); - priv->NdisAdapter.LinkCtrlReg = LinkCtrlReg; + pcie_capability_read_word(priv->pdev, PCI_EXP_LNKCTL, &LinkCtrlReg); + priv->NdisAdapter.LinkCtrlReg = (u8)LinkCtrlReg; RT_TRACE(COMP_INIT, "Link Control Register =%x\n", priv->NdisAdapter.LinkCtrlReg); diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index d7460ae3a76..9ac8d8ea4ae 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -2397,12 +2397,12 @@ struct rtllib_device { struct rtllib_network *network, u16 type); int (*is_qos_active)(struct net_device *dev, struct sk_buff *skb); - /* Softmac-generated frames (mamagement) are TXed via this + /* Softmac-generated frames (management) are TXed via this * callback if the flag IEEE_SOFTMAC_SINGLE_QUEUE is * not set. As some cards may have different HW queues that * one might want to use for data and management frames * the option to have two callbacks might be useful. - * This fucntion can't sleep. + * This function can't sleep. */ int (*softmac_hard_start_xmit)(struct sk_buff *skb, struct net_device *dev); @@ -2441,9 +2441,9 @@ struct rtllib_device { * it is called in a work_queue when switching to ad-hoc mode * or in behalf of iwlist scan when the card is associated * and root user ask for a scan. - * the fucntion stop_scan should stop both the syncro and + * the function stop_scan should stop both the syncro and * background scanning and can sleep. - * The fucntion start_scan should initiate the background + * The function start_scan should initiate the background * scanning and can't sleep. */ void (*scan_syncro)(struct net_device *dev); diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index a21b4d91a59..4feecec8609 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -19,6 +19,7 @@ #include <linux/random.h> #include <linux/delay.h> #include <linux/uaccess.h> +#include <linux/etherdevice.h> #include "dot11d.h" short rtllib_is_54g(struct rtllib_network *net) @@ -266,7 +267,7 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct rtllib_device *ieee) else ieee->seq_ctrl[0]++; - /* check wether the managed packet queued greater than 5 */ + /* check whether the managed packet queued greater than 5 */ if (!ieee->check_nic_enough_desc(ieee->dev, tcb_desc->queue_index) || (skb_queue_len(&ieee->skb_waitQ[tcb_desc->queue_index]) != 0) || (ieee->queue_stop)) { @@ -1687,7 +1688,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, * if the network does broadcast and the user did set essid * check if essid match * if the ap is not set, check that the user set the bssid - * and the network does bradcast and that those two bssid match + * and the network does broadcast and that those two bssid match */ if ((apset && apmatch && ((ssidset && ssidbroad && ssidmatch) || @@ -1843,7 +1844,7 @@ static short probe_rq_parse(struct rtllib_device *ieee, struct sk_buff *skb, bssid_match = (memcmp(header->addr3, ieee->current_network.bssid, ETH_ALEN) != 0) && - (memcmp(header->addr3, "\xff\xff\xff\xff\xff\xff", ETH_ALEN) != 0); + (!is_broadcast_ether_addr(header->addr3)); if (bssid_match) return -1; @@ -2442,7 +2443,7 @@ inline int rtllib_rx_frame_softmac(struct rtllib_device *ieee, return 0; } -/* following are for a simplier TX queue management. +/* following are for a simpler TX queue management. * Instead of using netif_[stop/wake]_queue the driver * will use these two functions (plus a reset one), that * will internally use the kernel netif_* and takes @@ -2619,13 +2620,7 @@ void rtllib_wake_all_queues(struct rtllib_device *ieee) inline void rtllib_randomize_cell(struct rtllib_device *ieee) { - get_random_bytes(ieee->current_network.bssid, ETH_ALEN); - - /* an IBSS cell address must have the two less significant - * bits of the first byte = 2 - */ - ieee->current_network.bssid[0] &= ~0x01; - ieee->current_network.bssid[0] |= 0x02; + random_ether_addr(ieee->current_network.bssid); } /* called in user context only */ @@ -3361,9 +3356,7 @@ static int rtllib_wpa_set_encryption(struct rtllib_device *ieee, param->u.crypt.key_len); return -EINVAL; } - if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff && - param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff && - param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) { + if (is_broadcast_ether_addr(param->sta_addr)) { if (param->u.crypt.idx >= NUM_WEP_KEYS) return -EINVAL; crypt = &ieee->crypt_info.crypt[param->u.crypt.idx]; @@ -3411,8 +3404,7 @@ static int rtllib_wpa_set_encryption(struct rtllib_device *ieee, lib80211_crypt_delayed_deinit(&ieee->crypt_info, crypt); - new_crypt = (struct lib80211_crypt_data *) - kmalloc(sizeof(*new_crypt), GFP_KERNEL); + new_crypt = kmalloc(sizeof(*new_crypt), GFP_KERNEL); if (new_crypt == NULL) { ret = -ENOMEM; goto done; diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index 1bb6b52e0f2..740cf85e9d5 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -14,6 +14,8 @@ */ +#include <linux/etherdevice.h> + #include "rtllib.h" #include "dot11d.h" /* FIXME: add A freqs */ @@ -137,7 +139,6 @@ int rtllib_wx_set_wap(struct rtllib_device *ieee, { int ret = 0; - u8 zero[] = {0, 0, 0, 0, 0, 0}; unsigned long flags; short ifup = ieee->proto_started; @@ -157,7 +158,7 @@ int rtllib_wx_set_wap(struct rtllib_device *ieee, goto out; } - if (memcmp(temp->sa_data, zero, ETH_ALEN) == 0) { + if (is_zero_ether_addr(temp->sa_data)) { spin_lock_irqsave(&ieee->lock, flags); memcpy(ieee->current_network.bssid, temp->sa_data, ETH_ALEN); ieee->wap_set = 0; @@ -177,7 +178,7 @@ int rtllib_wx_set_wap(struct rtllib_device *ieee, ieee->cannot_notify = false; memcpy(ieee->current_network.bssid, temp->sa_data, ETH_ALEN); - ieee->wap_set = (memcmp(temp->sa_data, zero, ETH_ALEN) != 0); + ieee->wap_set = !is_zero_ether_addr(temp->sa_data); spin_unlock_irqrestore(&ieee->lock, flags); |