diff options
Diffstat (limited to 'drivers/staging')
36 files changed, 313 insertions, 506 deletions
diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c index 98db47cb4fa4..727b956aa231 100644 --- a/drivers/staging/axis-fifo/axis-fifo.c +++ b/drivers/staging/axis-fifo/axis-fifo.c @@ -15,6 +15,8 @@ */ #include <linux/kernel.h> +#include <linux/of.h> +#include <linux/platform_device.h> #include <linux/wait.h> #include <linux/mutex.h> #include <linux/device.h> @@ -32,10 +34,6 @@ #include <linux/jiffies.h> #include <linux/miscdevice.h> -#include <linux/of_address.h> -#include <linux/of_device.h> -#include <linux/of_platform.h> - /* ---------------------------- * driver parameters * ---------------------------- @@ -839,16 +837,8 @@ static int axis_fifo_probe(struct platform_device *pdev) * ---------------------------- */ - /* get iospace for the device */ - r_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!r_mem) { - dev_err(fifo->dt_device, "invalid address\n"); - rc = -ENODEV; - goto err_initial; - } - - /* request physical memory */ - fifo->base_addr = devm_ioremap_resource(fifo->dt_device, r_mem); + /* get iospace for the device and request physical memory */ + fifo->base_addr = devm_platform_get_and_ioremap_resource(pdev, 0, &r_mem); if (IS_ERR(fifo->base_addr)) { rc = PTR_ERR(fifo->base_addr); goto err_initial; diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c index ebe835f25d13..891b75327d7f 100644 --- a/drivers/staging/greybus/arche-platform.c +++ b/drivers/staging/greybus/arche-platform.c @@ -20,6 +20,7 @@ #include <linux/suspend.h> #include <linux/time.h> #include <linux/greybus.h> +#include <linux/of.h> #include "arche_platform.h" #if IS_ENABLED(CONFIG_USB_HSIC_USB3613) diff --git a/drivers/staging/greybus/pwm.c b/drivers/staging/greybus/pwm.c index 88da1d796f13..f569d371a007 100644 --- a/drivers/staging/greybus/pwm.c +++ b/drivers/staging/greybus/pwm.c @@ -19,7 +19,6 @@ struct gb_pwm_chip { u8 pwm_max; /* max pwm number */ struct pwm_chip chip; - struct pwm_chip *pwm; }; static inline struct gb_pwm_chip *pwm_chip_to_gb_pwm_chip(struct pwm_chip *chip) diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index 4364df27c6d2..4846078315ff 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -7,7 +7,6 @@ #include <linux/delay.h> #include <linux/fs.h> #include <linux/module.h> -#include <linux/of_platform.h> #include <linux/pinctrl/consumer.h> #include <linux/platform_device.h> #include <linux/sched.h> diff --git a/drivers/staging/media/imx/imx-media-dev-common.c b/drivers/staging/media/imx/imx-media-dev-common.c index 991820a8500f..7b7cbec08326 100644 --- a/drivers/staging/media/imx/imx-media-dev-common.c +++ b/drivers/staging/media/imx/imx-media-dev-common.c @@ -6,8 +6,6 @@ * Copyright (c) 2016 Mentor Graphics Inc. */ -#include <linux/of_graph.h> -#include <linux/of_platform.h> #include <media/v4l2-ctrls.h> #include <media/v4l2-event.h> #include <media/v4l2-ioctl.h> diff --git a/drivers/staging/media/imx/imx8mq-mipi-csi2.c b/drivers/staging/media/imx/imx8mq-mipi-csi2.c index ca2efcc21efe..c84b6dceece2 100644 --- a/drivers/staging/media/imx/imx8mq-mipi-csi2.c +++ b/drivers/staging/media/imx/imx8mq-mipi-csi2.c @@ -17,7 +17,6 @@ #include <linux/module.h> #include <linux/mutex.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/regmap.h> diff --git a/drivers/staging/media/meson/vdec/esparser.c b/drivers/staging/media/meson/vdec/esparser.c index 7b15fc54efe4..4632346f04a9 100644 --- a/drivers/staging/media/meson/vdec/esparser.c +++ b/drivers/staging/media/meson/vdec/esparser.c @@ -11,7 +11,6 @@ #include <linux/ioctl.h> #include <linux/list.h> #include <linux/module.h> -#include <linux/of_device.h> #include <linux/reset.h> #include <linux/interrupt.h> #include <media/videobuf2-dma-contig.h> diff --git a/drivers/staging/media/meson/vdec/vdec.c b/drivers/staging/media/meson/vdec/vdec.c index 5ca4b1200831..219185aaa588 100644 --- a/drivers/staging/media/meson/vdec/vdec.c +++ b/drivers/staging/media/meson/vdec/vdec.c @@ -4,7 +4,7 @@ * Author: Maxime Jourdan <mjourdan@baylibre.com> */ -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/clk.h> #include <linux/io.h> #include <linux/module.h> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c index fa86a658fdc6..b696bf884cbd 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c @@ -14,8 +14,8 @@ */ #include <linux/platform_device.h> +#include <linux/of.h> #include <linux/of_reserved_mem.h> -#include <linux/of_device.h> #include <linux/dma-mapping.h> #include <linux/interrupt.h> #include <linux/clk.h> diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c index 0dc75adbd9d8..8337dc487047 100644 --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c @@ -10,7 +10,6 @@ #include <linux/interrupt.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/regmap.h> diff --git a/drivers/staging/media/tegra-video/csi.c b/drivers/staging/media/tegra-video/csi.c index 052172017b3b..e79657920dc8 100644 --- a/drivers/staging/media/tegra-video/csi.c +++ b/drivers/staging/media/tegra-video/csi.c @@ -10,7 +10,6 @@ #include <linux/module.h> #include <linux/of.h> #include <linux/of_graph.h> -#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c index 79284c3b6cae..4add037537a2 100644 --- a/drivers/staging/media/tegra-video/vi.c +++ b/drivers/staging/media/tegra-video/vi.c @@ -11,8 +11,8 @@ #include <linux/list.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/of_graph.h> +#include <linux/of_platform.h> #include <linux/platform_device.h> #include <linux/regulator/consumer.h> #include <linux/pm_runtime.h> diff --git a/drivers/staging/media/tegra-video/vip.c b/drivers/staging/media/tegra-video/vip.c index a1ab886acc18..4cf3fde7e034 100644 --- a/drivers/staging/media/tegra-video/vip.c +++ b/drivers/staging/media/tegra-video/vip.c @@ -13,7 +13,6 @@ #include <linux/module.h> #include <linux/of.h> #include <linux/of_graph.h> -#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> diff --git a/drivers/staging/most/dim2/dim2.c b/drivers/staging/most/dim2/dim2.c index 44d3252d4612..ed6a9cc88541 100644 --- a/drivers/staging/most/dim2/dim2.c +++ b/drivers/staging/most/dim2/dim2.c @@ -8,7 +8,6 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/module.h> -#include <linux/of_platform.h> #include <linux/printk.h> #include <linux/kernel.h> #include <linux/init.h> @@ -21,6 +20,7 @@ #include <linux/sched.h> #include <linux/kthread.h> #include <linux/most.h> +#include <linux/of.h> #include "hal.h" #include "errors.h" #include "sysfs.h" diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index 220e157d4a5e..58887619b83f 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -31,7 +31,6 @@ #include <linux/errno.h> #include <linux/mutex.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/interrupt.h> #include <linux/irq.h> #include <linux/gpio/consumer.h> diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c index e5925899402c..5bfd84b08dd9 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c @@ -419,10 +419,7 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev) rtl92e_init_adaptive_rate(dev); - if (priv->reg_chnl_plan == 0xf) - priv->chnl_plan = priv->eeprom_chnl_plan; - else - priv->chnl_plan = priv->reg_chnl_plan; + priv->chnl_plan = priv->eeprom_chnl_plan; switch (priv->eeprom_customer_id) { case EEPROM_CID_NetCore: @@ -1915,7 +1912,7 @@ void rtl92e_enable_tx(struct net_device *dev) rtl92e_writel(dev, TX_DESC_BASE[i], priv->tx_ring[i].dma); } -void rtl92e_ack_irq(struct net_device *dev, u32 *p_inta, u32 *p_intb) +void rtl92e_ack_irq(struct net_device *dev, u32 *p_inta) { *p_inta = rtl92e_readl(dev, ISR); rtl92e_writel(dev, ISR, *p_inta); diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.h index fa3b71dbb091..11366fda4ec3 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.h +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.h @@ -13,7 +13,7 @@ bool rtl92e_is_halfn_supported_by_ap(struct net_device *dev); bool rtl92e_get_nmode_support_by_sec(struct net_device *dev); bool rtl92e_is_tx_stuck(struct net_device *dev); bool rtl92e_is_rx_stuck(struct net_device *dev); -void rtl92e_ack_irq(struct net_device *dev, u32 *p_inta, u32 *p_intb); +void rtl92e_ack_irq(struct net_device *dev, u32 *p_inta); void rtl92e_enable_rx(struct net_device *dev); void rtl92e_enable_tx(struct net_device *dev); void rtl92e_enable_irq(struct net_device *dev); diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c index 6d9e5c27017d..944cc73fb2b6 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c @@ -49,8 +49,7 @@ void rtl92e_enable_hw_security_config(struct net_device *dev) } void rtl92e_set_swcam(struct net_device *dev, u8 EntryNo, u8 KeyIndex, - u16 KeyType, const u8 *MacAddr, u8 DefaultKey, - u32 *KeyContent, u8 is_mesh) + u16 KeyType, const u8 *MacAddr, u32 *KeyContent) { struct r8192_priv *priv = rtllib_priv(dev); struct rtllib_device *ieee = priv->rtllib; @@ -58,14 +57,12 @@ void rtl92e_set_swcam(struct net_device *dev, u8 EntryNo, u8 KeyIndex, if (EntryNo >= TOTAL_CAM_ENTRY) return; - if (!is_mesh) { - ieee->swcamtable[EntryNo].bused = true; - ieee->swcamtable[EntryNo].key_index = KeyIndex; - ieee->swcamtable[EntryNo].key_type = KeyType; - memcpy(ieee->swcamtable[EntryNo].macaddr, MacAddr, 6); - ieee->swcamtable[EntryNo].useDK = DefaultKey; - memcpy(ieee->swcamtable[EntryNo].key_buf, (u8 *)KeyContent, 16); - } + ieee->swcamtable[EntryNo].bused = true; + ieee->swcamtable[EntryNo].key_index = KeyIndex; + ieee->swcamtable[EntryNo].key_type = KeyType; + memcpy(ieee->swcamtable[EntryNo].macaddr, MacAddr, 6); + ieee->swcamtable[EntryNo].useDK = 0; + memcpy(ieee->swcamtable[EntryNo].key_buf, (u8 *)KeyContent, 16); } void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex, diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.h b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.h index 1ebd92e27441..bd33ef105107 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.h +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.h @@ -19,8 +19,7 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, const u8 *MacAddr, u8 DefaultKey, u32 *KeyContent); void rtl92e_set_swcam(struct net_device *dev, u8 EntryNo, u8 KeyIndex, - u16 KeyType, const u8 *MacAddr, u8 DefaultKey, - u32 *KeyContent, u8 is_mesh); + u16 KeyType, const u8 *MacAddr, u32 *KeyContent); void rtl92e_cam_restore(struct net_device *dev); #endif diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 4447489a16ea..50eb8f3494ec 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -618,8 +618,6 @@ static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset) (&priv->rtllib->pwr_save_ctrl); bool init_status; - priv->bdisable_nic = false; - priv->up = 1; priv->rtllib->ieee_up = 1; @@ -760,13 +758,11 @@ static void _rtl92e_init_priv_variable(struct net_device *dev) priv->up_first_time = 1; priv->blinked_ingpio = false; priv->being_init_adapter = false; - priv->bdisable_nic = false; priv->txringcount = 64; priv->rxbuffersize = 9100; priv->rxringcount = MAX_RX_COUNT; priv->irq_enabled = 0; priv->chan = 1; - priv->reg_chnl_plan = 0xf; priv->rtllib->mode = WIRELESS_MODE_AUTO; priv->rtllib->iw_mode = IW_MODE_INFRA; priv->rtllib->net_promiscuous_md = false; @@ -778,7 +774,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev) priv->retry_data = DEFAULT_RETRY_DATA; priv->rtllib->rts = DEFAULT_RTS_THRESHOLD; priv->rtllib->rate = 110; - priv->rtllib->short_slot = 1; priv->promisc = (dev->flags & IFF_PROMISC) ? 1 : 0; priv->bcck_in_ch14 = false; priv->cck_present_attn = 0; @@ -804,15 +799,9 @@ static void _rtl92e_init_priv_variable(struct net_device *dev) priv->rtllib->iw_mode = IW_MODE_INFRA; priv->rtllib->active_scan = 1; priv->rtllib->be_scan_inprogress = false; - priv->rtllib->modulation = RTLLIB_CCK_MODULATION | - RTLLIB_OFDM_MODULATION; - priv->rtllib->host_encrypt = 1; - priv->rtllib->host_decrypt = 1; priv->rtllib->fts = DEFAULT_FRAG_THRESHOLD; - priv->card_type = PCI; - priv->fw_info = vzalloc(sizeof(struct rt_firmware)); if (!priv->fw_info) netdev_err(dev, @@ -1504,12 +1493,6 @@ static short _rtl92e_tx(struct net_device *dev, struct sk_buff *skb) int idx; u32 fwinfo_size = 0; - if (priv->bdisable_nic) { - netdev_warn(dev, "%s: Nic is disabled! Can't tx packet.\n", - __func__); - return skb->len; - } - priv->rtllib->bAwakePktSent = true; fwinfo_size = sizeof(struct tx_fwinfo_8190pci); @@ -1990,16 +1973,13 @@ static irqreturn_t _rtl92e_irq(int irq, void *netdev) struct r8192_priv *priv = rtllib_priv(dev); unsigned long flags; u32 inta; - u32 intb; - - intb = 0; if (priv->irq_enabled == 0) goto done; spin_lock_irqsave(&priv->irq_th_lock, flags); - rtl92e_ack_irq(dev, &inta, &intb); + rtl92e_ack_irq(dev, &inta); if (!inta) { spin_unlock_irqrestore(&priv->irq_th_lock, flags); @@ -2251,20 +2231,17 @@ bool rtl92e_enable_nic(struct net_device *dev) if (!priv->up) { netdev_warn(dev, "%s(): Driver is already down!\n", __func__); - priv->bdisable_nic = false; return false; } init_status = rtl92e_start_adapter(dev); if (!init_status) { netdev_warn(dev, "%s(): Initialization failed!\n", __func__); - priv->bdisable_nic = false; return false; } RT_CLEAR_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC); rtl92e_irq_enable(dev); - priv->bdisable_nic = false; return init_status; } diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h index ec9e454299a8..fa82a0667813 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h @@ -259,12 +259,6 @@ struct r8192_priv { u8 polling_timer_on; /**********************************************************/ - - enum card_type { - PCI, MINIPCI, - CARDBUS, USB - } card_type; - struct work_struct qos_activate; short promisc; @@ -322,13 +316,11 @@ struct r8192_priv { bool tx_pwr_data_read_from_eeprom; - u16 reg_chnl_plan; u16 chnl_plan; u8 hw_rf_off_action; bool rf_change_in_progress; bool set_rf_pwr_state_in_progress; - bool bdisable_nic; u8 cck_pwr_enl; u16 tssi_13dBm; diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c index 37c275cac40b..dbf765d601b3 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c @@ -277,8 +277,8 @@ static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev) struct r8192_priv *priv = rtllib_priv(dev); struct rt_hi_throughput *ht_info = priv->rtllib->ht_info; struct rate_adaptive *pra = &priv->rate_adaptive; - u32 currentRATR, targetRATR = 0; - u32 LowRSSIThreshForRA = 0, HighRSSIThreshForRA = 0; + u32 current_ratr, target_ratr = 0; + u32 low_rssi_thresh_for_ra = 0, high_rssi_thresh_for_ra = 0; bool bshort_gi_enabled = false; static u8 ping_rssi_state; @@ -319,30 +319,30 @@ static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev) ((bshort_gi_enabled) ? BIT31 : 0); if (pra->ratr_state == DM_RATR_STA_HIGH) { - HighRSSIThreshForRA = pra->high2low_rssi_thresh_for_ra; - LowRSSIThreshForRA = (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) ? + high_rssi_thresh_for_ra = pra->high2low_rssi_thresh_for_ra; + low_rssi_thresh_for_ra = (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) ? (pra->low_rssi_thresh_for_ra40M) : (pra->low_rssi_thresh_for_ra20M); } else if (pra->ratr_state == DM_RATR_STA_LOW) { - HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra; - LowRSSIThreshForRA = (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) ? + high_rssi_thresh_for_ra = pra->high_rssi_thresh_for_ra; + low_rssi_thresh_for_ra = (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) ? (pra->low2high_rssi_thresh_for_ra40M) : (pra->low2high_rssi_thresh_for_ra20M); } else { - HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra; - LowRSSIThreshForRA = (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) ? + high_rssi_thresh_for_ra = pra->high_rssi_thresh_for_ra; + low_rssi_thresh_for_ra = (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) ? (pra->low_rssi_thresh_for_ra40M) : (pra->low_rssi_thresh_for_ra20M); } if (priv->undecorated_smoothed_pwdb >= - (long)HighRSSIThreshForRA) { + (long)high_rssi_thresh_for_ra) { pra->ratr_state = DM_RATR_STA_HIGH; - targetRATR = pra->upper_rssi_threshold_ratr; + target_ratr = pra->upper_rssi_threshold_ratr; } else if (priv->undecorated_smoothed_pwdb >= - (long)LowRSSIThreshForRA) { + (long)low_rssi_thresh_for_ra) { pra->ratr_state = DM_RATR_STA_MIDDLE; - targetRATR = pra->middle_rssi_threshold_ratr; + target_ratr = pra->middle_rssi_threshold_ratr; } else { pra->ratr_state = DM_RATR_STA_LOW; - targetRATR = pra->low_rssi_threshold_ratr; + target_ratr = pra->low_rssi_threshold_ratr; } if (pra->ping_rssi_enable) { @@ -352,7 +352,7 @@ static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev) (long)pra->ping_rssi_thresh_for_ra) || ping_rssi_state) { pra->ratr_state = DM_RATR_STA_LOW; - targetRATR = pra->ping_rssi_ratr; + target_ratr = pra->ping_rssi_ratr; ping_rssi_state = 1; } } else { @@ -361,18 +361,18 @@ static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev) } if (priv->rtllib->GetHalfNmodeSupportByAPsHandler(dev)) - targetRATR &= 0xf00fffff; + target_ratr &= 0xf00fffff; - currentRATR = rtl92e_readl(dev, RATR0); - if (targetRATR != currentRATR) { + current_ratr = rtl92e_readl(dev, RATR0); + if (target_ratr != current_ratr) { u32 ratr_value; - ratr_value = targetRATR; + ratr_value = target_ratr; ratr_value &= ~(RATE_ALL_OFDM_2SS); rtl92e_writel(dev, RATR0, ratr_value); rtl92e_writeb(dev, UFWP, 1); - pra->last_ratr = targetRATR; + pra->last_ratr = target_ratr; } } else { diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index 88975dc804c6..189798852568 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -428,7 +428,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev, ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_BACKUP); - rtllib_start_scan_syncro(priv->rtllib, 0); + rtllib_start_scan_syncro(priv->rtllib); ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_RESTORE); } @@ -712,7 +712,7 @@ static int _rtl92e_wx_set_enc(struct net_device *dev, rtl92e_set_key(dev, key_idx, key_idx, KEY_TYPE_WEP104, zero_addr[key_idx], 0, hwkey); rtl92e_set_swcam(dev, key_idx, key_idx, KEY_TYPE_WEP104, - zero_addr[key_idx], 0, hwkey, 0); + zero_addr[key_idx], hwkey); } else { netdev_info(dev, "wrong type in WEP, not WEP40 and WEP104\n"); @@ -857,21 +857,19 @@ static int _rtl92e_wx_set_encode_ext(struct net_device *dev, if (ext->key_len == 13) ieee->pairwise_key_type = alg = KEY_TYPE_WEP104; rtl92e_set_key(dev, idx, idx, alg, zero, 0, key); - rtl92e_set_swcam(dev, idx, idx, alg, zero, 0, key, 0); + rtl92e_set_swcam(dev, idx, idx, alg, zero, key); } else if (group) { ieee->group_key_type = alg; rtl92e_set_key(dev, idx, idx, alg, broadcast_addr, 0, key); - rtl92e_set_swcam(dev, idx, idx, alg, broadcast_addr, 0, - key, 0); + rtl92e_set_swcam(dev, idx, idx, alg, broadcast_addr, key); } else { if ((ieee->pairwise_key_type == KEY_TYPE_CCMP) && ieee->ht_info->bCurrentHTSupport) rtl92e_writeb(dev, 0x173, 1); rtl92e_set_key(dev, 4, idx, alg, (u8 *)ieee->ap_mac_addr, 0, key); - rtl92e_set_swcam(dev, 4, idx, alg, - (u8 *)ieee->ap_mac_addr, 0, key, 0); + rtl92e_set_swcam(dev, 4, idx, alg, (u8 *)ieee->ap_mac_addr, key); } } diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c index acc19514bca6..600802c795b9 100644 --- a/drivers/staging/rtl8192e/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c @@ -10,51 +10,51 @@ #include "rtllib.h" #include "rtl819x_BA.h" -static void ActivateBAEntry(struct ba_record *pBA, u16 Time) +static void activate_ba_entry(struct ba_record *pBA, u16 Time) { pBA->b_valid = true; if (Time != 0) mod_timer(&pBA->timer, jiffies + msecs_to_jiffies(Time)); } -static void DeActivateBAEntry(struct rtllib_device *ieee, struct ba_record *pBA) +static void deactivate_ba_entry(struct rtllib_device *ieee, struct ba_record *pBA) { pBA->b_valid = false; del_timer_sync(&pBA->timer); } -static u8 TxTsDeleteBA(struct rtllib_device *ieee, struct tx_ts_record *pTxTs) +static u8 tx_ts_delete_ba(struct rtllib_device *ieee, struct tx_ts_record *pTxTs) { struct ba_record *pAdmittedBa = &pTxTs->TxAdmittedBARecord; struct ba_record *pPendingBa = &pTxTs->TxPendingBARecord; u8 bSendDELBA = false; if (pPendingBa->b_valid) { - DeActivateBAEntry(ieee, pPendingBa); + deactivate_ba_entry(ieee, pPendingBa); bSendDELBA = true; } if (pAdmittedBa->b_valid) { - DeActivateBAEntry(ieee, pAdmittedBa); + deactivate_ba_entry(ieee, pAdmittedBa); bSendDELBA = true; } return bSendDELBA; } -static u8 RxTsDeleteBA(struct rtllib_device *ieee, struct rx_ts_record *pRxTs) +static u8 rx_ts_delete_ba(struct rtllib_device *ieee, struct rx_ts_record *pRxTs) { struct ba_record *pBa = &pRxTs->rx_admitted_ba_record; u8 bSendDELBA = false; if (pBa->b_valid) { - DeActivateBAEntry(ieee, pBa); + deactivate_ba_entry(ieee, pBa); bSendDELBA = true; } return bSendDELBA; } -void ResetBaEntry(struct ba_record *pBA) +void rtllib_reset_ba_entry(struct ba_record *pBA) { pBA->b_valid = false; pBA->ba_param_set.short_data = 0; @@ -270,7 +270,7 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb) rtllib_FlushRxTsPendingPkts(ieee, pTS); - DeActivateBAEntry(ieee, pBA); + deactivate_ba_entry(ieee, pBA); pBA->dialog_token = *pDialogToken; pBA->ba_param_set = *pBaParamSet; pBA->ba_timeout_value = *pBaTimeoutVal; @@ -282,7 +282,7 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb) else pBA->ba_param_set.field.buffer_size = 32; - ActivateBAEntry(pBA, 0); + activate_ba_entry(pBA, 0); rtllib_send_ADDBARsp(ieee, dst, pBA, ADDBA_STATUS_SUCCESS); return 0; @@ -363,13 +363,13 @@ int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb) netdev_dbg(ieee->dev, "%s(): Recv ADDBA Rsp. BA is admitted! Status code:%X\n", __func__, *pStatusCode); - DeActivateBAEntry(ieee, pPendingBA); + deactivate_ba_entry(ieee, pPendingBA); } if (*pStatusCode == ADDBA_STATUS_SUCCESS) { if (pBaParamSet->field.ba_policy == BA_POLICY_DELAYED) { pTS->bAddBaReqDelayed = true; - DeActivateBAEntry(ieee, pAdmittedBA); + deactivate_ba_entry(ieee, pAdmittedBA); ReasonCode = DELBA_REASON_END_BA; goto OnADDBARsp_Reject; } @@ -378,8 +378,8 @@ int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb) pAdmittedBA->ba_timeout_value = *pBaTimeoutVal; pAdmittedBA->ba_start_seq_ctrl = pPendingBA->ba_start_seq_ctrl; pAdmittedBA->ba_param_set = *pBaParamSet; - DeActivateBAEntry(ieee, pAdmittedBA); - ActivateBAEntry(pAdmittedBA, *pBaTimeoutVal); + deactivate_ba_entry(ieee, pAdmittedBA); + activate_ba_entry(pAdmittedBA, *pBaTimeoutVal); } else { pTS->bAddBaReqDelayed = true; pTS->bDisable_AddBa = true; @@ -441,7 +441,7 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb) return -1; } - RxTsDeleteBA(ieee, pRxTs); + rx_ts_delete_ba(ieee, pRxTs); } else { struct tx_ts_record *pTxTs; @@ -456,7 +456,7 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb) pTxTs->bAddBaReqInProgress = false; pTxTs->bAddBaReqDelayed = false; del_timer_sync(&pTxTs->TsAddBaTimer); - TxTsDeleteBA(ieee, pTxTs); + tx_ts_delete_ba(ieee, pTxTs); } return 0; } @@ -469,7 +469,7 @@ void TsInitAddBA(struct rtllib_device *ieee, struct tx_ts_record *pTS, if (pBA->b_valid && !bOverwritePending) return; - DeActivateBAEntry(ieee, pBA); + deactivate_ba_entry(ieee, pBA); pBA->dialog_token++; pBA->ba_param_set.field.amsdu_support = 0; @@ -479,7 +479,7 @@ void TsInitAddBA(struct rtllib_device *ieee, struct tx_ts_record *pTS, pBA->ba_timeout_value = 0; pBA->ba_start_seq_ctrl.field.seq_num = (pTS->TxCurSeq + 3) % 4096; - ActivateBAEntry(pBA, BA_SETUP_TIMEOUT); + activate_ba_entry(pBA, BA_SETUP_TIMEOUT); rtllib_send_ADDBAReq(ieee, pTS->TsCommonInfo.Addr, pBA); } @@ -492,7 +492,7 @@ void TsInitDelBA(struct rtllib_device *ieee, struct tx_ts_record *pTxTs = (struct tx_ts_record *)pTsCommonInfo; - if (TxTsDeleteBA(ieee, pTxTs)) + if (tx_ts_delete_ba(ieee, pTxTs)) rtllib_send_DELBA(ieee, pTsCommonInfo->Addr, (pTxTs->TxAdmittedBARecord.b_valid) ? (&pTxTs->TxAdmittedBARecord) : @@ -501,7 +501,7 @@ void TsInitDelBA(struct rtllib_device *ieee, } else if (TxRxSelect == RX_DIR) { struct rx_ts_record *pRxTs = (struct rx_ts_record *)pTsCommonInfo; - if (RxTsDeleteBA(ieee, pRxTs)) + if (rx_ts_delete_ba(ieee, pRxTs)) rtllib_send_DELBA(ieee, pTsCommonInfo->Addr, &pRxTs->rx_admitted_ba_record, TxRxSelect, DELBA_REASON_END_BA); @@ -524,7 +524,7 @@ void TxBaInactTimeout(struct timer_list *t) TxAdmittedBARecord.timer); struct rtllib_device *ieee = container_of(pTxTs, struct rtllib_device, TxTsRecord[pTxTs->num]); - TxTsDeleteBA(ieee, pTxTs); + tx_ts_delete_ba(ieee, pTxTs); rtllib_send_DELBA(ieee, pTxTs->TsCommonInfo.Addr, &pTxTs->TxAdmittedBARecord, TX_DIR, DELBA_REASON_TIMEOUT); @@ -537,7 +537,7 @@ void RxBaInactTimeout(struct timer_list *t) struct rtllib_device *ieee = container_of(pRxTs, struct rtllib_device, RxTsRecord[pRxTs->num]); - RxTsDeleteBA(ieee, pRxTs); + rx_ts_delete_ba(ieee, pRxTs); rtllib_send_DELBA(ieee, pRxTs->ts_common_info.Addr, &pRxTs->rx_admitted_ba_record, RX_DIR, DELBA_REASON_TIMEOUT); diff --git a/drivers/staging/rtl8192e/rtl819x_TS.h b/drivers/staging/rtl8192e/rtl819x_TS.h index 37760d0bc35d..0e851d4221a7 100644 --- a/drivers/staging/rtl8192e/rtl819x_TS.h +++ b/drivers/staging/rtl8192e/rtl819x_TS.h @@ -19,8 +19,6 @@ enum tr_select { struct ts_common_info { struct list_head List; - struct timer_list SetupTimer; - struct timer_list InactTimer; u8 Addr[ETH_ALEN]; union tspec_body TSpec; union qos_tclas TClass[TCLAS_NUM]; diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c index c61fdf73c572..14e0c000a31a 100644 --- a/drivers/staging/rtl8192e/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c @@ -8,14 +8,6 @@ #include <linux/etherdevice.h> #include "rtl819x_TS.h" -static void TsSetupTimeOut(struct timer_list *unused) -{ -} - -static void TsInactTimeout(struct timer_list *unused) -{ -} - static void RxPktPendingTimeout(struct timer_list *t) { struct rx_ts_record *pRxTs = from_timer(pRxTs, t, @@ -117,8 +109,8 @@ static void ResetTxTsEntry(struct tx_ts_record *pTS) pTS->bAddBaReqDelayed = false; pTS->bUsingBa = false; pTS->bDisable_AddBa = false; - ResetBaEntry(&pTS->TxAdmittedBARecord); - ResetBaEntry(&pTS->TxPendingBARecord); + rtllib_reset_ba_entry(&pTS->TxAdmittedBARecord); + rtllib_reset_ba_entry(&pTS->TxPendingBARecord); } static void ResetRxTsEntry(struct rx_ts_record *pTS) @@ -126,7 +118,7 @@ static void ResetRxTsEntry(struct rx_ts_record *pTS) ResetTsCommonInfo(&pTS->ts_common_info); pTS->rx_indicate_seq = 0xffff; pTS->rx_timeout_indicate_seq = 0xffff; - ResetBaEntry(&pTS->rx_admitted_ba_record); + rtllib_reset_ba_entry(&pTS->rx_admitted_ba_record); } void TSInitialize(struct rtllib_device *ieee) @@ -142,12 +134,6 @@ void TSInitialize(struct rtllib_device *ieee) for (count = 0; count < TOTAL_TS_NUM; count++) { pTxTS->num = count; - timer_setup(&pTxTS->TsCommonInfo.SetupTimer, TsSetupTimeOut, - 0); - - timer_setup(&pTxTS->TsCommonInfo.InactTimer, TsInactTimeout, - 0); - timer_setup(&pTxTS->TsAddBaTimer, TsAddBaProcess, 0); timer_setup(&pTxTS->TxPendingBARecord.timer, BaSetupTimeOut, @@ -167,13 +153,6 @@ void TSInitialize(struct rtllib_device *ieee) for (count = 0; count < TOTAL_TS_NUM; count++) { pRxTS->num = count; INIT_LIST_HEAD(&pRxTS->rx_pending_pkt_list); - - timer_setup(&pRxTS->ts_common_info.SetupTimer, TsSetupTimeOut, - 0); - - timer_setup(&pRxTS->ts_common_info.InactTimer, TsInactTimeout, - 0); - timer_setup(&pRxTS->rx_admitted_ba_record.timer, RxBaInactTimeout, 0); @@ -194,17 +173,6 @@ void TSInitialize(struct rtllib_device *ieee) } } -static void AdmitTS(struct rtllib_device *ieee, - struct ts_common_info *pTsCommonInfo, u32 InactTime) -{ - del_timer_sync(&pTsCommonInfo->SetupTimer); - del_timer_sync(&pTsCommonInfo->InactTimer); - - if (InactTime != 0) - mod_timer(&pTsCommonInfo->InactTimer, jiffies + - msecs_to_jiffies(InactTime)); -} - static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee, u8 *Addr, u8 TID, enum tr_select TxRxSelect) @@ -379,7 +347,6 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, pTSInfo->field.ucSchedule = 0; MakeTSEntry(*ppTS, Addr, &TSpec, NULL, 0, 0); - AdmitTS(ieee, *ppTS, 0); list_add_tail(&((*ppTS)->List), pAddmitList); return true; @@ -394,8 +361,6 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, static void RemoveTsEntry(struct rtllib_device *ieee, struct ts_common_info *pTs, enum tr_select TxRxSelect) { - del_timer_sync(&pTs->SetupTimer); - del_timer_sync(&pTs->InactTimer); TsInitDelBA(ieee, pTs, TxRxSelect); if (TxRxSelect == RX_DIR) { diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index e3ce4431d460..c5a692dfcd17 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1440,10 +1440,6 @@ struct rtllib_device { * WEP key changes */ - /* If the host performs {en,de}cryption, then set to 1 */ - int host_encrypt; - int host_decrypt; - int ieee802_1x; /* is IEEE 802.1X used */ /* WPA data */ @@ -1490,9 +1486,7 @@ struct rtllib_device { enum rtl_link_state link_state; - int short_slot; int mode; /* A, B, G */ - int modulation; /* CCK, OFDM */ /* used for forcing the ibss workqueue to terminate * without wait for the syncro scan to terminate @@ -1893,7 +1887,7 @@ void rtllib_disassociate(struct rtllib_device *ieee); void rtllib_stop_scan(struct rtllib_device *ieee); bool rtllib_act_scanning(struct rtllib_device *ieee, bool sync_scan); void rtllib_stop_scan_syncro(struct rtllib_device *ieee); -void rtllib_start_scan_syncro(struct rtllib_device *ieee, u8 is_mesh); +void rtllib_start_scan_syncro(struct rtllib_device *ieee); void rtllib_sta_ps_send_null_frame(struct rtllib_device *ieee, short pwr); void rtllib_sta_ps_send_pspoll_frame(struct rtllib_device *ieee); void rtllib_start_protocol(struct rtllib_device *ieee); @@ -2016,7 +2010,7 @@ void TsInitDelBA(struct rtllib_device *ieee, void BaSetupTimeOut(struct timer_list *t); void TxBaInactTimeout(struct timer_list *t); void RxBaInactTimeout(struct timer_list *t); -void ResetBaEntry(struct ba_record *pBA); +void rtllib_reset_ba_entry(struct ba_record *pBA); bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, u8 *Addr, u8 TID, enum tr_select TxRxSelect, bool bAddNewTs); void TSInitialize(struct rtllib_device *ieee); diff --git a/drivers/staging/rtl8192e/rtllib_module.c b/drivers/staging/rtl8192e/rtllib_module.c index d6a4d6b4ec57..2416e0c60255 100644 --- a/drivers/staging/rtl8192e/rtllib_module.c +++ b/drivers/staging/rtl8192e/rtllib_module.c @@ -97,9 +97,6 @@ struct net_device *alloc_rtllib(int sizeof_priv) ieee->scan_age = DEFAULT_MAX_SCAN_AGE; ieee->open_wep = 1; - /* Default to enabling full open WEP with host based encrypt/decrypt */ - ieee->host_encrypt = 1; - ieee->host_decrypt = 1; ieee->ieee802_1x = 1; /* Default to supporting 802.1x */ ieee->rtllib_ap_sec_type = rtllib_ap_sec_type; diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 91dd3c373aef..8a4029f26835 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1035,29 +1035,27 @@ static int rtllib_rx_get_crypt(struct rtllib_device *ieee, struct sk_buff *skb, u16 fc = le16_to_cpu(hdr->frame_ctl); int idx = 0; - if (ieee->host_decrypt) { - if (skb->len >= hdrlen + 3) - idx = skb->data[hdrlen + 3] >> 6; + if (skb->len >= hdrlen + 3) + idx = skb->data[hdrlen + 3] >> 6; - *crypt = ieee->crypt_info.crypt[idx]; - /* allow NULL decrypt to indicate an station specific override - * for default encryption + *crypt = ieee->crypt_info.crypt[idx]; + /* allow NULL decrypt to indicate an station specific override + * for default encryption + */ + if (*crypt && ((*crypt)->ops == NULL || + (*crypt)->ops->decrypt_mpdu == NULL)) + *crypt = NULL; + + if (!*crypt && (fc & RTLLIB_FCTL_WEP)) { + /* This seems to be triggered by some (multicast?) + * frames from other than current BSS, so just drop the + * frames silently instead of filling system log with + * these reports. */ - if (*crypt && ((*crypt)->ops == NULL || - (*crypt)->ops->decrypt_mpdu == NULL)) - *crypt = NULL; - - if (!*crypt && (fc & RTLLIB_FCTL_WEP)) { - /* This seems to be triggered by some (multicast?) - * frames from other than current BSS, so just drop the - * frames silently instead of filling system log with - * these reports. - */ - netdev_dbg(ieee->dev, - "Decryption failed (not set) (SA= %pM)\n", - hdr->addr2); - return -1; - } + netdev_dbg(ieee->dev, + "Decryption failed (not set) (SA= %pM)\n", + hdr->addr2); + return -1; } return 0; @@ -1083,7 +1081,7 @@ static int rtllib_rx_decrypt(struct rtllib_device *ieee, struct sk_buff *skb, ieee->need_sw_enc = 0; keyidx = rtllib_rx_frame_decrypt(ieee, skb, crypt); - if (ieee->host_decrypt && (fc & RTLLIB_FCTL_WEP) && (keyidx < 0)) { + if ((fc & RTLLIB_FCTL_WEP) && (keyidx < 0)) { netdev_info(ieee->dev, "%s: decrypt frame error\n", __func__); return -1; } @@ -1147,7 +1145,7 @@ static int rtllib_rx_decrypt(struct rtllib_device *ieee, struct sk_buff *skb, /* skb: hdr + (possible reassembled) full MSDU payload; possibly still * encrypted/authenticated */ - if (ieee->host_decrypt && (fc & RTLLIB_FCTL_WEP) && + if ((fc & RTLLIB_FCTL_WEP) && rtllib_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt)) { netdev_info(ieee->dev, "%s: ==>decrypt msdu error\n", __func__); return -1; @@ -1447,12 +1445,6 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb, return 0; } -static int rtllib_rx_Master(struct rtllib_device *ieee, struct sk_buff *skb, - struct rtllib_rx_stats *rx_stats) -{ - return 0; -} - static int rtllib_rx_Monitor(struct rtllib_device *ieee, struct sk_buff *skb, struct rtllib_rx_stats *rx_stats) { @@ -1481,12 +1473,6 @@ static int rtllib_rx_Monitor(struct rtllib_device *ieee, struct sk_buff *skb, return 1; } -static int rtllib_rx_Mesh(struct rtllib_device *ieee, struct sk_buff *skb, - struct rtllib_rx_stats *rx_stats) -{ - return 0; -} - /* All received frames are sent to this function. @skb contains the frame in * IEEE 802.11 format, i.e., in the format it was sent over air. * This function is called only as a tasklet (software IRQ). @@ -1512,13 +1498,11 @@ int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb, break; case IW_MODE_MASTER: case IW_MODE_REPEAT: - ret = rtllib_rx_Master(ieee, skb, rx_stats); break; case IW_MODE_MONITOR: ret = rtllib_rx_Monitor(ieee, skb, rx_stats); break; case IW_MODE_MESH: - ret = rtllib_rx_Mesh(ieee, skb, rx_stats); break; default: netdev_info(ieee->dev, "%s: ERR iw mode!!!\n", __func__); diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 425d4acbcdf0..0e52b207942d 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -35,12 +35,8 @@ static unsigned int rtllib_MFIE_rate_len(struct rtllib_device *ieee) { unsigned int rate_len = 0; - if (ieee->modulation & RTLLIB_CCK_MODULATION) - rate_len = RTLLIB_CCK_RATE_LEN + 2; - - if (ieee->modulation & RTLLIB_OFDM_MODULATION) - - rate_len += RTLLIB_OFDM_RATE_LEN + 2; + rate_len = RTLLIB_CCK_RATE_LEN + 2; + rate_len += RTLLIB_OFDM_RATE_LEN + 2; return rate_len; } @@ -53,14 +49,12 @@ static void rtllib_MFIE_Brate(struct rtllib_device *ieee, u8 **tag_p) { u8 *tag = *tag_p; - if (ieee->modulation & RTLLIB_CCK_MODULATION) { - *tag++ = MFIE_TYPE_RATES; - *tag++ = 4; - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_1MB; - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_2MB; - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_5MB; - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_11MB; - } + *tag++ = MFIE_TYPE_RATES; + *tag++ = 4; + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_1MB; + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_2MB; + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_5MB; + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_11MB; /* We may add an option for custom rates that specific HW * might support @@ -72,18 +66,17 @@ static void rtllib_MFIE_Grate(struct rtllib_device *ieee, u8 **tag_p) { u8 *tag = *tag_p; - if (ieee->modulation & RTLLIB_OFDM_MODULATION) { - *tag++ = MFIE_TYPE_RATES_EX; - *tag++ = 8; - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_6MB; - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_9MB; - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_12MB; - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_18MB; - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_24MB; - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_36MB; - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_48MB; - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_54MB; - } + *tag++ = MFIE_TYPE_RATES_EX; + *tag++ = 8; + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_6MB; + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_9MB; + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_12MB; + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_18MB; + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_24MB; + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_36MB; + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_48MB; + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_54MB; + /* We may add an option for custom rates that specific HW might * support */ @@ -456,7 +449,7 @@ void rtllib_DisableIntelPromiscuousMode(struct net_device *dev, } EXPORT_SYMBOL(rtllib_DisableIntelPromiscuousMode); -static void rtllib_send_probe(struct rtllib_device *ieee, u8 is_mesh) +static void rtllib_send_probe(struct rtllib_device *ieee) { struct sk_buff *skb; @@ -467,12 +460,12 @@ static void rtllib_send_probe(struct rtllib_device *ieee, u8 is_mesh) } } -static void rtllib_send_probe_requests(struct rtllib_device *ieee, u8 is_mesh) +static void rtllib_send_probe_requests(struct rtllib_device *ieee) { if (ieee->active_scan && (ieee->softmac_features & IEEE_SOFTMAC_PROBERQ)) { - rtllib_send_probe(ieee, 0); - rtllib_send_probe(ieee, 0); + rtllib_send_probe(ieee); + rtllib_send_probe(ieee); } } @@ -485,7 +478,7 @@ static void rtllib_update_active_chan_map(struct rtllib_device *ieee) /* this performs syncro scan blocking the caller until all channels * in the allowed channel map has been checked. */ -static void rtllib_softmac_scan_syncro(struct rtllib_device *ieee, u8 is_mesh) +static void rtllib_softmac_scan_syncro(struct rtllib_device *ieee) { union iwreq_data wrqu; short ch = 0; @@ -532,7 +525,7 @@ static void rtllib_softmac_scan_syncro(struct rtllib_device *ieee, u8 is_mesh) ieee->set_chan(ieee->dev, ch); if (ieee->active_channel_map[ch] == 1) - rtllib_send_probe_requests(ieee, 0); + rtllib_send_probe_requests(ieee); /* this prevent excessive time wait when we * need to wait for a syncro scan to end.. @@ -594,7 +587,7 @@ static void rtllib_softmac_scan_wq(void *data) ieee->set_chan(ieee->dev, ieee->current_network.channel); if (ieee->active_channel_map[ieee->current_network.channel] == 1) - rtllib_send_probe_requests(ieee, 0); + rtllib_send_probe_requests(ieee); schedule_delayed_work(&ieee->softmac_scan_wq, msecs_to_jiffies(RTLLIB_SOFTMAC_SCAN_TIME)); @@ -714,7 +707,7 @@ static void rtllib_start_scan(struct rtllib_device *ieee) } /* called with wx_mutex held */ -void rtllib_start_scan_syncro(struct rtllib_device *ieee, u8 is_mesh) +void rtllib_start_scan_syncro(struct rtllib_device *ieee) { if (IS_DOT11D_ENABLE(ieee)) { if (IS_COUNTRY_IE_VALID(ieee)) @@ -722,7 +715,7 @@ void rtllib_start_scan_syncro(struct rtllib_device *ieee, u8 is_mesh) } ieee->sync_scan_hurryup = 0; if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) - rtllib_softmac_scan_syncro(ieee, is_mesh); + rtllib_softmac_scan_syncro(ieee); } EXPORT_SYMBOL(rtllib_start_scan_syncro); @@ -814,7 +807,7 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, } crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; - encrypt = ieee->host_encrypt && crypt && crypt->ops && + encrypt = crypt && crypt->ops && ((strcmp(crypt->ops->name, "R-WEP") == 0 || wpa_ie_len)); if (ieee->ht_info->bCurrentHTSupport) { tmp_ht_cap_buf = (u8 *)&(ieee->ht_info->SelfHTCap); @@ -859,8 +852,7 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, cpu_to_le16(ieee->current_network.capability & WLAN_CAPABILITY_SHORT_PREAMBLE); - if (ieee->short_slot && (ieee->current_network.capability & - WLAN_CAPABILITY_SHORT_SLOT_TIME)) + if (ieee->current_network.capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) beacon_buf->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME); @@ -946,14 +938,9 @@ static struct sk_buff *rtllib_assoc_resp(struct rtllib_device *ieee, u8 *dest) assoc->capability = cpu_to_le16(ieee->iw_mode == IW_MODE_MASTER ? WLAN_CAPABILITY_ESS : WLAN_CAPABILITY_IBSS); - if (ieee->short_slot) - assoc->capability |= - cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME); + assoc->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME); - if (ieee->host_encrypt) - crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; - else - crypt = NULL; + crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; encrypt = (crypt && crypt->ops); @@ -1122,7 +1109,7 @@ rtllib_association_req(struct rtllib_network *beacon, crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; if (crypt != NULL) - encrypt = ieee->host_encrypt && crypt && crypt->ops && + encrypt = crypt && crypt->ops && ((strcmp(crypt->ops->name, "R-WEP") == 0 || wpa_ie_len)); else @@ -1200,8 +1187,7 @@ rtllib_association_req(struct rtllib_network *beacon, if (beacon->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_PREAMBLE); - if (ieee->short_slot && - (beacon->capability & WLAN_CAPABILITY_SHORT_SLOT_TIME)) + if (beacon->capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME); hdr->listen_interval = cpu_to_le16(beacon->listen_interval); @@ -1465,8 +1451,7 @@ static void rtllib_associate_complete_wq(void *data) netif_carrier_on(ieee->dev); ieee->is_roaming = false; - if (rtllib_is_54g(&ieee->current_network) && - (ieee->modulation & RTLLIB_OFDM_MODULATION)) { + if (rtllib_is_54g(&ieee->current_network)) { ieee->rate = 108; netdev_info(ieee->dev, "Using G rates:%d\n", ieee->rate); } else { @@ -1652,9 +1637,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, schedule_delayed_work( &ieee->associate_procedure_wq, 0); } else { - if (rtllib_is_54g(&ieee->current_network) && - (ieee->modulation & - RTLLIB_OFDM_MODULATION)) { + if (rtllib_is_54g(&ieee->current_network)) { ieee->rate = 108; ieee->set_wireless_mode(ieee->dev, WIRELESS_MODE_G); netdev_info(ieee->dev, @@ -2517,7 +2500,7 @@ static void rtllib_start_ibss_wq(void *data) * associated. */ if (ieee->link_state == MAC80211_NOLINK) - rtllib_start_scan_syncro(ieee, 0); + rtllib_start_scan_syncro(ieee); /* the network definitively is not here.. create a new cell */ if (ieee->link_state == MAC80211_NOLINK) { @@ -2526,47 +2509,34 @@ static void rtllib_start_ibss_wq(void *data) if (!ieee->wap_set) eth_random_addr(ieee->current_network.bssid); - if (ieee->modulation & RTLLIB_CCK_MODULATION) { - ieee->current_network.rates_len = 4; - - ieee->current_network.rates[0] = - RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_1MB; - ieee->current_network.rates[1] = - RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_2MB; - ieee->current_network.rates[2] = - RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_5MB; - ieee->current_network.rates[3] = - RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_11MB; - - } else { - ieee->current_network.rates_len = 0; - } - - if (ieee->modulation & RTLLIB_OFDM_MODULATION) { - ieee->current_network.rates_ex_len = 8; - - ieee->current_network.rates_ex[0] = - RTLLIB_OFDM_RATE_6MB; - ieee->current_network.rates_ex[1] = - RTLLIB_OFDM_RATE_9MB; - ieee->current_network.rates_ex[2] = - RTLLIB_OFDM_RATE_12MB; - ieee->current_network.rates_ex[3] = - RTLLIB_OFDM_RATE_18MB; - ieee->current_network.rates_ex[4] = - RTLLIB_OFDM_RATE_24MB; - ieee->current_network.rates_ex[5] = - RTLLIB_OFDM_RATE_36MB; - ieee->current_network.rates_ex[6] = - RTLLIB_OFDM_RATE_48MB; - ieee->current_network.rates_ex[7] = - RTLLIB_OFDM_RATE_54MB; - - ieee->rate = 108; - } else { - ieee->current_network.rates_ex_len = 0; - ieee->rate = 22; - } + ieee->current_network.rates_len = 4; + ieee->current_network.rates[0] = + RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_1MB; + ieee->current_network.rates[1] = + RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_2MB; + ieee->current_network.rates[2] = + RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_5MB; + ieee->current_network.rates[3] = + RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_11MB; + + ieee->current_network.rates_ex_len = 8; + ieee->current_network.rates_ex[0] = + RTLLIB_OFDM_RATE_6MB; + ieee->current_network.rates_ex[1] = + RTLLIB_OFDM_RATE_9MB; + ieee->current_network.rates_ex[2] = + RTLLIB_OFDM_RATE_12MB; + ieee->current_network.rates_ex[3] = + RTLLIB_OFDM_RATE_18MB; + ieee->current_network.rates_ex[4] = + RTLLIB_OFDM_RATE_24MB; + ieee->current_network.rates_ex[5] = + RTLLIB_OFDM_RATE_36MB; + ieee->current_network.rates_ex[6] = + RTLLIB_OFDM_RATE_48MB; + ieee->current_network.rates_ex[7] = + RTLLIB_OFDM_RATE_54MB; + ieee->rate = 108; ieee->current_network.qos_data.supported = 0; ieee->set_wireless_mode(ieee->dev, WIRELESS_MODE_G); @@ -3018,8 +2988,7 @@ u8 rtllib_ap_sec_type(struct rtllib_device *ieee) crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; encrypt = (ieee->current_network.capability & WLAN_CAPABILITY_PRIVACY) - || (ieee->host_encrypt && crypt && crypt->ops && - (strcmp(crypt->ops->name, "R-WEP") == 0)); + || (crypt && crypt->ops && (strcmp(crypt->ops->name, "R-WEP") == 0)); /* simply judge */ if (encrypt && (wpa_ie_len == 0)) { diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index 2de63d1f2009..aad91dad134c 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -310,7 +310,7 @@ void rtllib_wx_sync_scan_wq(void *data) mutex_lock(&ieee->wx_mutex); if (!(ieee->softmac_features & IEEE_SOFTMAC_SCAN)) { - rtllib_start_scan_syncro(ieee, 0); + rtllib_start_scan_syncro(ieee); goto out; } @@ -339,7 +339,7 @@ void rtllib_wx_sync_scan_wq(void *data) HT_EXTCHNL_OFFSET_NO_EXT); } - rtllib_start_scan_syncro(ieee, 0); + rtllib_start_scan_syncro(ieee); if (b40M) { if (chan_offset == HT_EXTCHNL_OFFSET_UPPER) @@ -487,11 +487,9 @@ EXPORT_SYMBOL(rtllib_wx_set_rawtx); int rtllib_wx_get_name(struct rtllib_device *ieee, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - const char *b = ieee->modulation & RTLLIB_CCK_MODULATION ? "b" : ""; - const char *g = ieee->modulation & RTLLIB_OFDM_MODULATION ? "g" : ""; const char *n = ieee->mode & (WIRELESS_MODE_N_24G) ? "n" : ""; - scnprintf(wrqu->name, sizeof(wrqu->name), "802.11%s%s%s", b, g, n); + scnprintf(wrqu->name, sizeof(wrqu->name), "802.11bg%s", n); return 0; } EXPORT_SYMBOL(rtllib_wx_get_name); diff --git a/drivers/staging/rtl8192e/rtllib_tx.c b/drivers/staging/rtl8192e/rtllib_tx.c index ec038ef806c3..24fd40284420 100644 --- a/drivers/staging/rtl8192e/rtllib_tx.c +++ b/drivers/staging/rtl8192e/rtllib_tx.c @@ -635,8 +635,7 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) skb->priority = rtllib_classify(skb, IsAmsdu); crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; - encrypt = !(ether_type == ETH_P_PAE && ieee->ieee802_1x) && - ieee->host_encrypt && crypt && crypt->ops; + encrypt = !(ether_type == ETH_P_PAE && ieee->ieee802_1x) && crypt && crypt->ops; if (!encrypt && ieee->ieee802_1x && ieee->drop_unencrypted && ether_type != ETH_P_PAE) { stats->tx_dropped++; diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c index ca09367005e1..5da8ac401df0 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c @@ -1121,10 +1121,12 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, /* skb: hdr + (possibly fragmented, possibly encrypted) payload */ - if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) && - (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0) { - netdev_dbg(ieee->dev, "decrypt frame error\n"); - goto rx_dropped; + if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP)) { + keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt); + if (keyidx < 0) { + netdev_dbg(ieee->dev, "decrypt frame error\n"); + goto rx_dropped; + } } diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index 2ae7843abdf7..292cba045023 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -95,14 +95,14 @@ static struct ieee80211_channel rtw_2ghz_channels[] = { static void rtw_2g_channels_init(struct ieee80211_channel *channels) { memcpy((void *)channels, (void *)rtw_2ghz_channels, - sizeof(struct ieee80211_channel)*RTW_2G_CHANNELS_NUM + sizeof(struct ieee80211_channel) * RTW_2G_CHANNELS_NUM ); } static void rtw_2g_rates_init(struct ieee80211_rate *rates) { memcpy(rates, rtw_g_rates, - sizeof(struct ieee80211_rate)*RTW_G_RATES_NUM + sizeof(struct ieee80211_rate) * RTW_G_RATES_NUM ); } @@ -126,8 +126,8 @@ static struct ieee80211_supported_band *rtw_spt_band_alloc( if (!spt_band) goto exit; - spt_band->channels = (struct ieee80211_channel *)(((u8 *)spt_band)+sizeof(struct ieee80211_supported_band)); - spt_band->bitrates = (struct ieee80211_rate *)(((u8 *)spt_band->channels)+sizeof(struct ieee80211_channel)*n_channels); + spt_band->channels = (struct ieee80211_channel *)(((u8 *)spt_band) + sizeof(struct ieee80211_supported_band)); + spt_band->bitrates = (struct ieee80211_rate *)(((u8 *)spt_band->channels) + sizeof(struct ieee80211_channel) * n_channels); spt_band->band = band; spt_band->n_channels = n_channels; spt_band->n_bitrates = n_bitrates; @@ -247,10 +247,10 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wl u32 wpsielen = 0; u8 *wpsie = NULL; - wpsie = rtw_get_wps_ie(pnetwork->network.ies+_FIXED_IE_LENGTH_, pnetwork->network.ie_length-_FIXED_IE_LENGTH_, NULL, &wpsielen); + wpsie = rtw_get_wps_ie(pnetwork->network.ies + _FIXED_IE_LENGTH_, pnetwork->network.ie_length - _FIXED_IE_LENGTH_, NULL, &wpsielen); if (wpsie && wpsielen > 0) - psr = rtw_get_wps_attr_content(wpsie, wpsielen, WPS_ATTR_SELECTED_REGISTRAR, (u8 *)(&sr), NULL); + psr = rtw_get_wps_attr_content(wpsie, wpsielen, WPS_ATTR_SELECTED_REGISTRAR, (u8 *)(&sr), NULL); if (sr != 0) { /* it means under processing WPS */ @@ -266,7 +266,6 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wl } /* spin_unlock_bh(&pwdev_priv->scan_req_lock); */ - channel = pnetwork->network.configuration.ds_config; freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_2GHZ); @@ -276,10 +275,10 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wl /* We've set wiphy's signal_type as CFG80211_SIGNAL_TYPE_MBM: signal strength in mBm (100*dBm) */ if (check_fwstate(pmlmepriv, _FW_LINKED) == true && - is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network, 0)) { - notify_signal = 100*translate_percentage_to_dbm(padapter->recvpriv.signal_strength);/* dbm */ + is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network, 0)) { + notify_signal = 100 * translate_percentage_to_dbm(padapter->recvpriv.signal_strength);/* dbm */ } else { - notify_signal = 100*translate_percentage_to_dbm(pnetwork->network.phy_info.signal_strength);/* dbm */ + notify_signal = 100 * translate_percentage_to_dbm(pnetwork->network.phy_info.signal_strength);/* dbm */ } buf = kzalloc(MAX_BSSINFO_LEN, GFP_ATOMIC); @@ -314,7 +313,7 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wl *((__le64 *)pbuf) = cpu_to_le64(notify_timestamp); bss = cfg80211_inform_bss_frame(wiphy, notify_channel, (struct ieee80211_mgmt *)buf, - len, notify_signal, GFP_ATOMIC); + len, notify_signal, GFP_ATOMIC); if (unlikely(!bss)) goto exit; @@ -346,9 +345,9 @@ int rtw_cfg80211_check_bss(struct adapter *padapter) notify_channel = ieee80211_get_channel(padapter->rtw_wdev->wiphy, freq); bss = cfg80211_get_bss(padapter->rtw_wdev->wiphy, notify_channel, - pnetwork->mac_address, pnetwork->ssid.ssid, - pnetwork->ssid.ssid_length, - IEEE80211_BSS_TYPE_ANY, IEEE80211_PRIVACY_ANY); + pnetwork->mac_address, pnetwork->ssid.ssid, + pnetwork->ssid.ssid_length, + IEEE80211_BSS_TYPE_ANY, IEEE80211_PRIVACY_ANY); cfg80211_put_bss(padapter->rtw_wdev->wiphy, bss); @@ -449,20 +448,20 @@ check_bss: roam_info.links[0].channel = notify_channel; roam_info.links[0].bssid = cur_network->network.mac_address; roam_info.req_ie = - pmlmepriv->assoc_req+sizeof(struct ieee80211_hdr_3addr)+2; + pmlmepriv->assoc_req + sizeof(struct ieee80211_hdr_3addr) + 2; roam_info.req_ie_len = - pmlmepriv->assoc_req_len-sizeof(struct ieee80211_hdr_3addr)-2; + pmlmepriv->assoc_req_len - sizeof(struct ieee80211_hdr_3addr) - 2; roam_info.resp_ie = - pmlmepriv->assoc_rsp+sizeof(struct ieee80211_hdr_3addr)+6; + pmlmepriv->assoc_rsp + sizeof(struct ieee80211_hdr_3addr) + 6; roam_info.resp_ie_len = - pmlmepriv->assoc_rsp_len-sizeof(struct ieee80211_hdr_3addr)-6; + pmlmepriv->assoc_rsp_len - sizeof(struct ieee80211_hdr_3addr) - 6; cfg80211_roamed(padapter->pnetdev, &roam_info, GFP_ATOMIC); } else { cfg80211_connect_result(padapter->pnetdev, cur_network->network.mac_address - , pmlmepriv->assoc_req+sizeof(struct ieee80211_hdr_3addr)+2 - , pmlmepriv->assoc_req_len-sizeof(struct ieee80211_hdr_3addr)-2 - , pmlmepriv->assoc_rsp+sizeof(struct ieee80211_hdr_3addr)+6 - , pmlmepriv->assoc_rsp_len-sizeof(struct ieee80211_hdr_3addr)-6 + , pmlmepriv->assoc_req + sizeof(struct ieee80211_hdr_3addr) + 2 + , pmlmepriv->assoc_req_len - sizeof(struct ieee80211_hdr_3addr) - 2 + , pmlmepriv->assoc_rsp + sizeof(struct ieee80211_hdr_3addr) + 6 + , pmlmepriv->assoc_rsp_len - sizeof(struct ieee80211_hdr_3addr) - 6 , WLAN_STATUS_SUCCESS, GFP_ATOMIC); } } @@ -487,7 +486,7 @@ void rtw_cfg80211_indicate_disconnect(struct adapter *padapter) NULL, 0, true, GFP_ATOMIC); } else { cfg80211_connect_result(padapter->pnetdev, NULL, NULL, 0, NULL, 0, - WLAN_STATUS_UNSPECIFIED_FAILURE, GFP_ATOMIC/*GFP_KERNEL*/); + WLAN_STATUS_UNSPECIFIED_FAILURE, GFP_ATOMIC/*GFP_KERNEL*/); } } } @@ -708,7 +707,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param param->u.crypt.err = 0; param->u.crypt.alg[IEEE_CRYPT_ALG_NAME_LEN - 1] = '\0'; - if (param_len < (u32) ((u8 *) param->u.crypt.key - (u8 *) param) + param->u.crypt.key_len) { + if (param_len < (u32)((u8 *)param->u.crypt.key - (u8 *)param) + param->u.crypt.key_len) { ret = -EINVAL; goto exit; } @@ -778,7 +777,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param psta->ieee8021x_blocked = false; if ((padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption2Enabled) || - (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { + (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm; } @@ -827,7 +826,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param pbcmc_sta->ieee8021x_blocked = false; if ((padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption2Enabled) || - (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { + (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { pbcmc_sta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm; } } @@ -945,9 +944,9 @@ static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev, } static int cfg80211_rtw_set_default_key(struct wiphy *wiphy, - struct net_device *ndev, int link_id, u8 key_index - , bool unicast, bool multicast - ) + struct net_device *ndev, int link_id, + u8 key_index, bool unicast, + bool multicast) { struct adapter *padapter = rtw_netdev_priv(ndev); struct security_priv *psecuritypriv = &padapter->securitypriv; @@ -1019,10 +1018,10 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy, } /* for Ad-Hoc/AP mode */ - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) - || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) - || check_fwstate(pmlmepriv, WIFI_AP_STATE)) - && check_fwstate(pmlmepriv, _FW_LINKED)) { + if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) || + check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) || + check_fwstate(pmlmepriv, WIFI_AP_STATE)) && + check_fwstate(pmlmepriv, _FW_LINKED)) { /* TODO: should acquire station info... */ } @@ -1122,9 +1121,10 @@ void rtw_cfg80211_unlink_bss(struct adapter *padapter, struct wlan_network *pnet struct wlan_bssid_ex *select_network = &pnetwork->network; bss = cfg80211_get_bss(wiphy, NULL/*notify_channel*/, - select_network->mac_address, select_network->ssid.ssid, - select_network->ssid.ssid_length, IEEE80211_BSS_TYPE_ANY, - IEEE80211_PRIVACY_ANY); + select_network->mac_address, + select_network->ssid.ssid, + select_network->ssid.ssid_length, + IEEE80211_BSS_TYPE_ANY, IEEE80211_PRIVACY_ANY); if (bss) { cfg80211_unlink_bss(wiphy, bss); @@ -1219,7 +1219,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy spin_unlock_bh(&pwdev_priv->scan_req_lock); if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { - if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS|_FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true) { + if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS | _FW_UNDER_SURVEY | _FW_UNDER_LINKING) == true) { need_indicate_scan_done = true; goto check_need_indicate_scan_done; } @@ -1273,7 +1273,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy } /* parsing channels, n_channels */ - memset(ch, 0, sizeof(struct rtw_ieee80211_channel)*RTW_CHANNEL_SCAN_AMOUNT); + memset(ch, 0, sizeof(struct rtw_ieee80211_channel) * RTW_CHANNEL_SCAN_AMOUNT); for (i = 0; i < request->n_channels && i < RTW_CHANNEL_SCAN_AMOUNT; i++) { ch[i].hw_value = request->channels[i]->hw_value; ch[i].flags = request->channels[i]->flags; @@ -1287,7 +1287,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy } else if (request->n_channels <= 4) { for (j = request->n_channels - 1; j >= 0; j--) for (i = 0; i < survey_times; i++) - memcpy(&ch[j*survey_times+i], &ch[j], sizeof(struct rtw_ieee80211_channel)); + memcpy(&ch[j * survey_times + i], &ch[j], sizeof(struct rtw_ieee80211_channel)); _status = rtw_sitesurvey_cmd(padapter, ssid, RTW_SSID_SCAN_AMOUNT, ch, survey_times * request->n_channels); } else { _status = rtw_sitesurvey_cmd(padapter, ssid, RTW_SSID_SCAN_AMOUNT, NULL, 0); @@ -1329,7 +1329,7 @@ static int rtw_cfg80211_set_wpa_version(struct security_priv *psecuritypriv, u32 } static int rtw_cfg80211_set_auth_type(struct security_priv *psecuritypriv, - enum nl80211_auth_type sme_auth_type) + enum nl80211_auth_type sme_auth_type) { switch (sme_auth_type) { case NL80211_AUTHTYPE_AUTOMATIC: @@ -1436,7 +1436,7 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel goto exit; } - if (ielen > MAX_WPA_IE_LEN+MAX_WPS_IE_LEN+MAX_P2P_IE_LEN) { + if (ielen > MAX_WPA_IE_LEN + MAX_WPS_IE_LEN + MAX_P2P_IE_LEN) { ret = -EINVAL; goto exit; } @@ -1456,19 +1456,19 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel pwpa = rtw_get_wpa_ie(buf, &wpa_ielen, ielen); if (pwpa && wpa_ielen > 0) { - if (rtw_parse_wpa_ie(pwpa, wpa_ielen+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) { + if (rtw_parse_wpa_ie(pwpa, wpa_ielen + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) { padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_8021X; padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPAPSK; - memcpy(padapter->securitypriv.supplicant_ie, &pwpa[0], wpa_ielen+2); + memcpy(padapter->securitypriv.supplicant_ie, &pwpa[0], wpa_ielen + 2); } } pwpa2 = rtw_get_wpa2_ie(buf, &wpa2_ielen, ielen); if (pwpa2 && wpa2_ielen > 0) { - if (rtw_parse_wpa2_ie(pwpa2, wpa2_ielen+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) { + if (rtw_parse_wpa2_ie(pwpa2, wpa2_ielen + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) { padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_8021X; padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPA2PSK; - memcpy(padapter->securitypriv.supplicant_ie, &pwpa2[0], wpa2_ielen+2); + memcpy(padapter->securitypriv.supplicant_ie, &pwpa2[0], wpa2_ielen + 2); } } @@ -1634,7 +1634,7 @@ leave_ibss: } static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, - struct cfg80211_connect_params *sme) + struct cfg80211_connect_params *sme) { int ret = 0; enum ndis_802_11_authentication_mode authmode; @@ -1709,7 +1709,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, /* For WEP Shared auth */ if ((psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_Shared || - psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_Auto) && sme->key) { + psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_Auto) && sme->key) { u32 wep_key_idx, wep_key_len, wep_total_len; struct ndis_802_11_wep *pwep = NULL; @@ -1807,15 +1807,14 @@ static int cfg80211_rtw_disconnect(struct wiphy *wiphy, struct net_device *ndev, } static int cfg80211_rtw_set_txpower(struct wiphy *wiphy, - struct wireless_dev *wdev, - enum nl80211_tx_power_setting type, int mbm) + struct wireless_dev *wdev, + enum nl80211_tx_power_setting type, int mbm) { return 0; } static int cfg80211_rtw_get_txpower(struct wiphy *wiphy, - struct wireless_dev *wdev, - int *dbm) + struct wireless_dev *wdev, int *dbm) { *dbm = (12); @@ -1863,7 +1862,7 @@ static int cfg80211_rtw_set_pmksa(struct wiphy *wiphy, if (!memcmp(psecuritypriv->PMKIDList[index].Bssid, (u8 *)pmksa->bssid, ETH_ALEN)) { memcpy(psecuritypriv->PMKIDList[index].PMKID, (u8 *)pmksa->pmkid, WLAN_PMKID_LEN); psecuritypriv->PMKIDList[index].bUsed = true; - psecuritypriv->PMKIDIndex = index+1; + psecuritypriv->PMKIDIndex = index + 1; blInserted = true; break; } @@ -2064,8 +2063,8 @@ static netdev_tx_t rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struc _rtw_xmit_entry(skb, padapter->pnetdev); return NETDEV_TX_OK; - } else if ((frame_control & (IEEE80211_FCTL_FTYPE|IEEE80211_FCTL_STYPE)) == - (IEEE80211_FTYPE_MGMT|IEEE80211_STYPE_ACTION)) { + } else if ((frame_control & (IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == + (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION)) { /* only for action frames */ struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; @@ -2174,7 +2173,7 @@ static int rtw_cfg80211_add_monitor_if(struct adapter *padapter, char *name, str goto out; *ndev = pwdev_priv->pmon_ndev = mon_ndev; - memcpy(pwdev_priv->ifname_mon, name, IFNAMSIZ+1); + memcpy(pwdev_priv->ifname_mon, name, IFNAMSIZ + 1); out: if (ret && mon_wdev) { @@ -2228,7 +2227,7 @@ static struct wireless_dev * } static int cfg80211_rtw_del_virtual_intf(struct wiphy *wiphy, - struct wireless_dev *wdev + struct wireless_dev *wdev ) { struct net_device *ndev = wdev_to_ndev(wdev); @@ -2268,14 +2267,14 @@ static int rtw_add_beacon(struct adapter *adapter, const u8 *head, size_t head_l if (head_len < 24) return -EINVAL; - pbuf = rtw_zmalloc(head_len+tail_len); + pbuf = rtw_zmalloc(head_len + tail_len); if (!pbuf) return -ENOMEM; - memcpy(pbuf, (void *)head+24, head_len-24);/* 24 =beacon header len. */ - memcpy(pbuf+head_len-24, (void *)tail, tail_len); + memcpy(pbuf, (void *)head + 24, head_len - 24);/* 24 =beacon header len. */ + memcpy(pbuf + head_len - 24, (void *)tail, tail_len); - len = head_len+tail_len-24; + len = head_len + tail_len - 24; /* check wps ie if inclued */ rtw_get_wps_ie(pbuf + _FIXED_IE_LENGTH_, len - _FIXED_IE_LENGTH_, NULL, &wps_ielen); @@ -2295,13 +2294,14 @@ static int rtw_add_beacon(struct adapter *adapter, const u8 *head, size_t head_l } static int cfg80211_rtw_start_ap(struct wiphy *wiphy, struct net_device *ndev, - struct cfg80211_ap_settings *settings) + struct cfg80211_ap_settings *settings) { int ret = 0; struct adapter *adapter = rtw_netdev_priv(ndev); - ret = rtw_add_beacon(adapter, settings->beacon.head, settings->beacon.head_len, - settings->beacon.tail, settings->beacon.tail_len); + ret = rtw_add_beacon(adapter, settings->beacon.head, + settings->beacon.head_len, settings->beacon.tail, + settings->beacon.tail_len); adapter->mlmeextpriv.mlmext_info.hidden_ssid_mode = settings->hidden_ssid; @@ -2318,8 +2318,9 @@ static int cfg80211_rtw_start_ap(struct wiphy *wiphy, struct net_device *ndev, return ret; } -static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *ndev, - struct cfg80211_beacon_data *info) +static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, + struct net_device *ndev, + struct cfg80211_beacon_data *info) { struct adapter *adapter = rtw_netdev_priv(ndev); @@ -2332,9 +2333,10 @@ static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, return 0; } -static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev, - const u8 *mac, - struct station_parameters *params) +static int cfg80211_rtw_add_station(struct wiphy *wiphy, + struct net_device *ndev, + const u8 *mac, + struct station_parameters *params) { return 0; } @@ -2396,8 +2398,10 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev return ret; } -static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *ndev, - const u8 *mac, struct station_parameters *params) +static int cfg80211_rtw_change_station(struct wiphy *wiphy, + struct net_device *ndev, + const u8 *mac, + struct station_parameters *params) { return 0; } @@ -2422,8 +2426,10 @@ static struct sta_info *rtw_sta_info_get_by_idx(const int idx, struct sta_priv * return psta; } -static int cfg80211_rtw_dump_station(struct wiphy *wiphy, struct net_device *ndev, - int idx, u8 *mac, struct station_info *sinfo) +static int cfg80211_rtw_dump_station(struct wiphy *wiphy, + struct net_device *ndev, + int idx, u8 *mac, + struct station_info *sinfo) { int ret = 0; struct adapter *padapter = rtw_netdev_priv(ndev); @@ -2445,8 +2451,9 @@ exit: return ret; } -static int cfg80211_rtw_change_bss(struct wiphy *wiphy, struct net_device *ndev, - struct bss_parameters *params) +static int cfg80211_rtw_change_bss(struct wiphy *wiphy, + struct net_device *ndev, + struct bss_parameters *params) { return 0; } @@ -2529,10 +2536,9 @@ exit: return ret; } -static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, - struct wireless_dev *wdev, - struct cfg80211_mgmt_tx_params *params, - u64 *cookie) +static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, + struct cfg80211_mgmt_tx_params *params, + u64 *cookie) { struct net_device *ndev = wdev_to_ndev(wdev); struct ieee80211_channel *chan = params->chan; @@ -2558,7 +2564,7 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, pwdev_priv = adapter_wdev_data(padapter); /* cookie generation */ - *cookie = (unsigned long) buf; + *cookie = (unsigned long)buf; /* indicate ack before issue frame to avoid racing with rsp frame */ rtw_cfg80211_mgmt_tx_status(padapter, *cookie, buf, len, ack, GFP_KERNEL); diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c index 40a3157fb735..c81b30f1f1b0 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c @@ -13,7 +13,7 @@ #include <linux/jiffies.h> #include <linux/kernel.h> -#define RTL_IOCTL_WPA_SUPPLICANT (SIOCIWFIRSTPRIV+30) +#define RTL_IOCTL_WPA_SUPPLICANT (SIOCIWFIRSTPRIV + 30) static int wpa_set_auth_algs(struct net_device *dev, u32 value) { @@ -40,7 +40,6 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value) } return ret; - } static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, u32 param_len) @@ -80,7 +79,6 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, } if (strcmp(param->u.crypt.alg, "WEP") == 0) { - padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; padapter->securitypriv.dot11PrivacyAlgrthm = _WEP40_; padapter->securitypriv.dot118021XGrpPrivacy = _WEP40_; @@ -127,7 +125,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, goto exit; } - memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->key_material, pwep->key_length); + memcpy(&psecuritypriv->dot11DefKey[wep_key_idx].skey[0], pwep->key_material, pwep->key_length); psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->key_length; rtw_set_key(padapter, psecuritypriv, wep_key_idx, 0, true); } @@ -149,7 +147,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, psta->ieee8021x_blocked = false; if ((padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption2Enabled) || - (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { + (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm; } @@ -158,8 +156,8 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, if (strcmp(param->u.crypt.alg, "TKIP") == 0) { /* set mic key */ /* DEBUG_ERR(("\nset key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len)); */ - memcpy(psta->dot11tkiptxmickey.skey, &(param->u.crypt.key[16]), 8); - memcpy(psta->dot11tkiprxmickey.skey, &(param->u.crypt.key[24]), 8); + memcpy(psta->dot11tkiptxmickey.skey, ¶m->u.crypt.key[16], 8); + memcpy(psta->dot11tkiprxmickey.skey, ¶m->u.crypt.key[24], 8); padapter->securitypriv.busetkipkey = false; /* _set_timer(&padapter->securitypriv.tkip_timer, 50); */ @@ -171,8 +169,8 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, memcpy(padapter->securitypriv.dot118021XGrpKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); /* only TKIP group key need to install this */ if (param->u.crypt.key_len > 16) { - memcpy(padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[16]), 8); - memcpy(padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[24]), 8); + memcpy(padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey, ¶m->u.crypt.key[16], 8); + memcpy(padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey, ¶m->u.crypt.key[24], 8); } padapter->securitypriv.binstallGrpkey = true; @@ -202,7 +200,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, pbcmc_sta->ieee8021x_blocked = false; if ((padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption2Enabled) || - (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { + (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { pbcmc_sta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm; } } @@ -317,18 +315,18 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie while (cnt < ielen) { eid = buf[cnt]; - if ((eid == WLAN_EID_VENDOR_SPECIFIC) && (!memcmp(&buf[cnt+2], wps_oui, 4))) { - padapter->securitypriv.wps_ie_len = ((buf[cnt+1]+2) < MAX_WPS_IE_LEN) ? (buf[cnt+1]+2):MAX_WPS_IE_LEN; + if ((eid == WLAN_EID_VENDOR_SPECIFIC) && (!memcmp(&buf[cnt + 2], wps_oui, 4))) { + padapter->securitypriv.wps_ie_len = ((buf[cnt + 1] + 2) < MAX_WPS_IE_LEN) ? (buf[cnt + 1] + 2) : MAX_WPS_IE_LEN; memcpy(padapter->securitypriv.wps_ie, &buf[cnt], padapter->securitypriv.wps_ie_len); set_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS); - cnt += buf[cnt+1]+2; + cnt += buf[cnt + 1] + 2; break; } else { - cnt += buf[cnt+1]+2; /* goto next */ + cnt += buf[cnt + 1] + 2; /* goto next */ } } } @@ -336,8 +334,8 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie /* TKIP and AES disallow multicast packets until installing group key */ if (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_ || - padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_ || - padapter->securitypriv.dot11PrivacyAlgrthm == _AES_) + padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_ || + padapter->securitypriv.dot11PrivacyAlgrthm == _AES_) /* WPS open need to enable multicast */ /* check_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS) == true) */ rtw_hal_set_hwreg(padapter, HW_VAR_OFF_RCR_AM, null_addr); @@ -361,7 +359,7 @@ static int wpa_set_param(struct net_device *dev, u8 name, u32 value) /* ret = ieee80211_wpa_enable(ieee, value); */ - switch ((value)&0xff) { + switch ((value) & 0xff) { case 1: /* WPA */ padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPAPSK; /* WPA_PSK */ padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption2Enabled; @@ -392,7 +390,6 @@ static int wpa_set_param(struct net_device *dev, u8 name, u32 value) * be set. */ break; - } case IEEE_PARAM_PRIVACY_INVOKED: @@ -426,17 +423,12 @@ static int wpa_set_param(struct net_device *dev, u8 name, u32 value) default: - - ret = -EOPNOTSUPP; - break; - } return ret; - } static int wpa_mlme(struct net_device *dev, u32 command, u32 reason) @@ -465,7 +457,6 @@ static int wpa_mlme(struct net_device *dev, u32 command, u32 reason) } return ret; - } static int wpa_supplicant_ioctl(struct net_device *dev, struct iw_point *p) @@ -488,7 +479,6 @@ static int wpa_supplicant_ioctl(struct net_device *dev, struct iw_point *p) } switch (param->cmd) { - case IEEE_CMD_SET_WPA_PARAM: ret = wpa_set_param(dev, param->u.wpa_param.name, param->u.wpa_param.value); break; @@ -509,7 +499,6 @@ static int wpa_supplicant_ioctl(struct net_device *dev, struct iw_point *p) default: ret = -EOPNOTSUPP; break; - } if (ret == 0 && copy_to_user(p->pointer, param, p->length)) @@ -529,7 +518,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, struct sta_info *psta = NULL, *pbcmc_sta = NULL; struct adapter *padapter = rtw_netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct security_priv *psecuritypriv = &(padapter->securitypriv); + struct security_priv *psecuritypriv = &padapter->securitypriv; struct sta_priv *pstapriv = &padapter->stapriv; char *txkey = padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey; char *rxkey = padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey; @@ -570,7 +559,6 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, goto exit; } - if (strcmp(param->u.crypt.alg, "WEP") == 0 && !psta) { wep_key_idx = param->u.crypt.idx; wep_key_len = param->u.crypt.key_len; @@ -580,7 +568,6 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, goto exit; } - if (wep_key_len > 0) { wep_key_len = wep_key_len <= 5 ? 5 : 13; wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, key_material); @@ -591,7 +578,6 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, pwep->key_length = wep_key_len; pwep->length = wep_total_len; - } pwep->key_index = wep_key_idx; @@ -609,10 +595,9 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, psecuritypriv->dot118021XGrpPrivacy = _WEP104_; } - psecuritypriv->dot11PrivacyKeyIndex = wep_key_idx; - memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->key_material, pwep->key_length); + memcpy(&psecuritypriv->dot11DefKey[wep_key_idx].skey[0], pwep->key_material, pwep->key_length); psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->key_length; @@ -621,7 +606,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, /* don't update "psecuritypriv->dot11PrivacyAlgrthm" and */ /* psecuritypriv->dot11PrivacyKeyIndex =keyid", but can rtw_set_key to cam */ - memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->key_material, pwep->key_length); + memcpy(&psecuritypriv->dot11DefKey[wep_key_idx].skey[0], pwep->key_material, pwep->key_length); psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->key_length; @@ -629,10 +614,8 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, } goto exit; - } - if (!psta && check_fwstate(pmlmepriv, WIFI_AP_STATE)) { /* group key */ if (param->u.crypt.set_tx == 1) { if (strcmp(param->u.crypt.alg, "WEP") == 0) { @@ -640,7 +623,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, psecuritypriv->dot118021XGrpPrivacy = _WEP40_; if (param->u.crypt.key_len == 13) - psecuritypriv->dot118021XGrpPrivacy = _WEP104_; + psecuritypriv->dot118021XGrpPrivacy = _WEP104_; } else if (strcmp(param->u.crypt.alg, "TKIP") == 0) { psecuritypriv->dot118021XGrpPrivacy = _TKIP_; @@ -649,13 +632,12 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ /* set mic key */ - memcpy(txkey, &(param->u.crypt.key[16]), 8); - memcpy(psecuritypriv->dot118021XGrprxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[24]), 8); + memcpy(txkey, ¶m->u.crypt.key[16], 8); + memcpy(psecuritypriv->dot118021XGrprxmickey[param->u.crypt.idx].skey, ¶m->u.crypt.key[24], 8); psecuritypriv->busetkipkey = true; - } - else if (strcmp(param->u.crypt.alg, "CCMP") == 0) { + } else if (strcmp(param->u.crypt.alg, "CCMP") == 0) { psecuritypriv->dot118021XGrpPrivacy = _AES_; memcpy(grpkey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); @@ -679,7 +661,6 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, } goto exit; - } if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X && psta) { /* psk/802_1x */ @@ -696,13 +677,12 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ /* set mic key */ - memcpy(psta->dot11tkiptxmickey.skey, &(param->u.crypt.key[16]), 8); - memcpy(psta->dot11tkiprxmickey.skey, &(param->u.crypt.key[24]), 8); + memcpy(psta->dot11tkiptxmickey.skey, ¶m->u.crypt.key[16], 8); + memcpy(psta->dot11tkiprxmickey.skey, ¶m->u.crypt.key[24], 8); psecuritypriv->busetkipkey = true; } else if (strcmp(param->u.crypt.alg, "CCMP") == 0) { - psta->dot118021XPrivacy = _AES_; } else { psta->dot118021XPrivacy = _NO_PRIVACY_; @@ -726,8 +706,8 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ /* set mic key */ - memcpy(txkey, &(param->u.crypt.key[16]), 8); - memcpy(rxkey, &(param->u.crypt.key[24]), 8); + memcpy(txkey, ¶m->u.crypt.key[16], 8); + memcpy(rxkey, ¶m->u.crypt.key[24], 8); psecuritypriv->busetkipkey = true; @@ -760,14 +740,13 @@ exit: kfree(pwep); return ret; - } static int rtw_set_beacon(struct net_device *dev, struct ieee_param *param, int len) { int ret = 0; struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct sta_priv *pstapriv = &padapter->stapriv; unsigned char *pbuf = param->u.bcn_ie.buf; @@ -779,15 +758,12 @@ static int rtw_set_beacon(struct net_device *dev, struct ieee_param *param, int if ((pstapriv->max_num_sta > NUM_STA) || (pstapriv->max_num_sta <= 0)) pstapriv->max_num_sta = NUM_STA; - - if (rtw_check_beacon_data(padapter, pbuf, (len-12-2)) == _SUCCESS)/* 12 = param header, 2:no packed */ + if (rtw_check_beacon_data(padapter, pbuf, (len - 12 - 2)) == _SUCCESS)/* 12 = param header, 2:no packed */ ret = 0; else ret = -EINVAL; - return ret; - } static void rtw_hostapd_sta_flush(struct net_device *dev) @@ -808,10 +784,10 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param) int ret = 0; struct sta_info *psta = NULL; struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct sta_priv *pstapriv = &padapter->stapriv; - if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true) + if (check_fwstate(pmlmepriv, (_FW_LINKED | WIFI_AP_STATE)) != true) return -EINVAL; if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff && @@ -838,9 +814,8 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param) memcpy(psta->bssrateset, param->u.add_sta.tx_supp_rates, 16); - /* check wmm cap. */ - if (WLAN_STA_WME&flags) + if (WLAN_STA_WME & flags) psta->qos_option = 1; else psta->qos_option = 0; @@ -849,7 +824,7 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param) psta->qos_option = 0; /* chec 802.11n ht cap. */ - if (WLAN_STA_HT&flags) { + if (WLAN_STA_HT & flags) { psta->htpriv.ht_option = true; psta->qos_option = 1; memcpy((void *)&psta->htpriv.ht_cap, (void *)¶m->u.add_sta.ht_cap, sizeof(struct ieee80211_ht_cap)); @@ -857,18 +832,16 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param) psta->htpriv.ht_option = false; } - if (pmlmepriv->htpriv.ht_option == false) + if (!pmlmepriv->htpriv.ht_option) psta->htpriv.ht_option = false; update_sta_info_apmode(padapter, psta); - } else { ret = -ENOMEM; } return ret; - } static int rtw_del_sta(struct net_device *dev, struct ieee_param *param) @@ -876,10 +849,10 @@ static int rtw_del_sta(struct net_device *dev, struct ieee_param *param) int ret = 0; struct sta_info *psta = NULL; struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct sta_priv *pstapriv = &padapter->stapriv; - if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true) + if (check_fwstate(pmlmepriv, (_FW_LINKED | WIFI_AP_STATE)) != true) return -EINVAL; if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff && @@ -897,18 +870,15 @@ static int rtw_del_sta(struct net_device *dev, struct ieee_param *param) list_del_init(&psta->asoc_list); pstapriv->asoc_list_cnt--; updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING); - } spin_unlock_bh(&pstapriv->asoc_list_lock); associated_clients_update(padapter, updated); psta = NULL; - } return ret; - } static int rtw_ioctl_get_sta_data(struct net_device *dev, struct ieee_param *param, int len) @@ -916,12 +886,12 @@ static int rtw_ioctl_get_sta_data(struct net_device *dev, struct ieee_param *par int ret = 0; struct sta_info *psta = NULL; struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct sta_priv *pstapriv = &padapter->stapriv; struct ieee_param_ex *param_ex = (struct ieee_param_ex *)param; struct sta_data *psta_data = (struct sta_data *)param_ex->data; - if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true) + if (check_fwstate(pmlmepriv, (_FW_LINKED | WIFI_AP_STATE)) != true) return -EINVAL; if (param_ex->sta_addr[0] == 0xff && param_ex->sta_addr[1] == 0xff && @@ -963,13 +933,11 @@ static int rtw_ioctl_get_sta_data(struct net_device *dev, struct ieee_param *par psta_data->tx_bytes = psta->sta_stats.tx_bytes; psta_data->tx_drops = psta->sta_stats.tx_drops; - } else { ret = -1; } return ret; - } static int rtw_get_sta_wpaie(struct net_device *dev, struct ieee_param *param) @@ -977,10 +945,10 @@ static int rtw_get_sta_wpaie(struct net_device *dev, struct ieee_param *param) int ret = 0; struct sta_info *psta = NULL; struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct sta_priv *pstapriv = &padapter->stapriv; - if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true) + if (check_fwstate(pmlmepriv, (_FW_LINKED | WIFI_AP_STATE)) != true) return -EINVAL; if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff && @@ -997,7 +965,7 @@ static int rtw_get_sta_wpaie(struct net_device *dev, struct ieee_param *param) wpa_ie_len = psta->wpa_ie[1]; - copy_len = ((wpa_ie_len+2) > sizeof(psta->wpa_ie)) ? (sizeof(psta->wpa_ie)):(wpa_ie_len+2); + copy_len = ((wpa_ie_len + 2) > sizeof(psta->wpa_ie)) ? (sizeof(psta->wpa_ie)) : (wpa_ie_len + 2); param->u.wpa_ie.len = copy_len; @@ -1008,7 +976,6 @@ static int rtw_get_sta_wpaie(struct net_device *dev, struct ieee_param *param) } return ret; - } static int rtw_set_wps_beacon(struct net_device *dev, struct ieee_param *param, int len) @@ -1016,15 +983,14 @@ static int rtw_set_wps_beacon(struct net_device *dev, struct ieee_param *param, int ret = 0; unsigned char wps_oui[4] = {0x0, 0x50, 0xf2, 0x04}; struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; int ie_len; if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) return -EINVAL; - ie_len = len-12-2;/* 12 = param header, 2:no packed */ - + ie_len = len - 12 - 2;/* 12 = param header, 2:no packed */ kfree(pmlmepriv->wps_beacon_ie); pmlmepriv->wps_beacon_ie = NULL; @@ -1042,23 +1008,20 @@ static int rtw_set_wps_beacon(struct net_device *dev, struct ieee_param *param, pmlmeext->bstart_bss = true; } - return ret; - } static int rtw_set_wps_probe_resp(struct net_device *dev, struct ieee_param *param, int len) { int ret = 0; struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; int ie_len; if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) return -EINVAL; - ie_len = len-12-2;/* 12 = param header, 2:no packed */ - + ie_len = len - 12 - 2;/* 12 = param header, 2:no packed */ kfree(pmlmepriv->wps_probe_resp_ie); pmlmepriv->wps_probe_resp_ie = NULL; @@ -1072,23 +1035,20 @@ static int rtw_set_wps_probe_resp(struct net_device *dev, struct ieee_param *par memcpy(pmlmepriv->wps_probe_resp_ie, param->u.bcn_ie.buf, ie_len); } - return ret; - } static int rtw_set_wps_assoc_resp(struct net_device *dev, struct ieee_param *param, int len) { int ret = 0; struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; int ie_len; if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) return -EINVAL; - ie_len = len-12-2;/* 12 = param header, 2:no packed */ - + ie_len = len - 12 - 2;/* 12 = param header, 2:no packed */ kfree(pmlmepriv->wps_assoc_resp_ie); pmlmepriv->wps_assoc_resp_ie = NULL; @@ -1102,18 +1062,16 @@ static int rtw_set_wps_assoc_resp(struct net_device *dev, struct ieee_param *par memcpy(pmlmepriv->wps_assoc_resp_ie, param->u.bcn_ie.buf, ie_len); } - return ret; - } static int rtw_set_hidden_ssid(struct net_device *dev, struct ieee_param *param, int len) { int ret = 0; struct adapter *adapter = rtw_netdev_priv(dev); - struct mlme_priv *mlmepriv = &(adapter->mlmepriv); - struct mlme_ext_priv *mlmeext = &(adapter->mlmeextpriv); - struct mlme_ext_info *mlmeinfo = &(mlmeext->mlmext_info); + struct mlme_priv *mlmepriv = &adapter->mlmepriv; + struct mlme_ext_priv *mlmeext = &adapter->mlmeextpriv; + struct mlme_ext_info *mlmeinfo = &mlmeext->mlmext_info; int ie_len; u8 *ssid_ie; char ssid[NDIS_802_11_LENGTH_SSID + 1]; @@ -1128,14 +1086,14 @@ static int rtw_set_hidden_ssid(struct net_device *dev, struct ieee_param *param, mlmeinfo->hidden_ssid_mode = ignore_broadcast_ssid = param->u.bcn_ie.reserved[1]; - ie_len = len-12-2;/* 12 = param header, 2:no packed */ + ie_len = len - 12 - 2;/* 12 = param header, 2:no packed */ ssid_ie = rtw_get_ie(param->u.bcn_ie.buf, WLAN_EID_SSID, &ssid_len, ie_len); if (ssid_ie && ssid_len > 0 && ssid_len <= NDIS_802_11_LENGTH_SSID) { struct wlan_bssid_ex *pbss_network = &mlmepriv->cur_network.network; struct wlan_bssid_ex *pbss_network_ext = &mlmeinfo->network; - memcpy(ssid, ssid_ie+2, ssid_len); + memcpy(ssid, ssid_ie + 2, ssid_len); ssid[ssid_len] = 0x0; memcpy(pbss_network->ssid.ssid, (void *)ssid, ssid_len); @@ -1150,7 +1108,7 @@ static int rtw_set_hidden_ssid(struct net_device *dev, struct ieee_param *param, static int rtw_ioctl_acl_remove_sta(struct net_device *dev, struct ieee_param *param, int len) { struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) return -EINVAL; @@ -1163,13 +1121,12 @@ static int rtw_ioctl_acl_remove_sta(struct net_device *dev, struct ieee_param *p rtw_acl_remove_sta(padapter, param->sta_addr); return 0; - } static int rtw_ioctl_acl_add_sta(struct net_device *dev, struct ieee_param *param, int len) { struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) return -EINVAL; @@ -1181,14 +1138,13 @@ static int rtw_ioctl_acl_add_sta(struct net_device *dev, struct ieee_param *para } return rtw_acl_add_sta(padapter, param->sta_addr); - } static int rtw_ioctl_set_macaddr_acl(struct net_device *dev, struct ieee_param *param, int len) { int ret = 0; struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) return -EINVAL; @@ -1205,9 +1161,9 @@ static int rtw_hostapd_ioctl(struct net_device *dev, struct iw_point *p) struct adapter *padapter = rtw_netdev_priv(dev); /* - * this function is expect to call in master mode, which allows no power saving - * so, we just check hw_init_completed - */ + * this function is expect to call in master mode, which allows no power saving + * so, we just check hw_init_completed + */ if (!padapter->hw_init_completed) return -EPERM; @@ -1312,7 +1268,6 @@ static int rtw_hostapd_ioctl(struct net_device *dev, struct iw_point *p) default: ret = -EOPNOTSUPP; break; - } if (ret == 0 && copy_to_user(p->pointer, param, p->length)) diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c index 4b7122add51a..74c4f476b3a4 100644 --- a/drivers/staging/rts5208/sd.c +++ b/drivers/staging/rts5208/sd.c @@ -4501,8 +4501,7 @@ int sd_execute_write_data(struct scsi_cmnd *srb, struct rtsx_chip *chip) sd_card->sd_lock_notify = 1; if (sd_lock_state && (sd_card->sd_lock_status & SD_LOCK_1BIT_MODE)) { - sd_card->sd_lock_status |= ( - SD_UNLOCK_POW_ON | SD_SDR_RST); + sd_card->sd_lock_status |= (SD_UNLOCK_POW_ON | SD_SDR_RST); if (CHK_SD(sd_card)) { retval = reset_sd(chip); if (retval != STATUS_SUCCESS) { |