diff options
Diffstat (limited to 'drivers/staging/wilc1000')
-rw-r--r-- | drivers/staging/wilc1000/coreconfigurator.c | 4 | ||||
-rw-r--r-- | drivers/staging/wilc1000/host_interface.c | 12 | ||||
-rw-r--r-- | drivers/staging/wilc1000/host_interface.h | 1 | ||||
-rw-r--r-- | drivers/staging/wilc1000/linux_mon.c | 4 | ||||
-rw-r--r-- | drivers/staging/wilc1000/linux_wlan.c | 51 | ||||
-rw-r--r-- | drivers/staging/wilc1000/wilc_debugfs.c | 6 | ||||
-rw-r--r-- | drivers/staging/wilc1000/wilc_sdio.c | 3 | ||||
-rw-r--r-- | drivers/staging/wilc1000/wilc_spi.c | 6 | ||||
-rw-r--r-- | drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 24 | ||||
-rw-r--r-- | drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 | ||||
-rw-r--r-- | drivers/staging/wilc1000/wilc_wlan.h | 6 |
11 files changed, 35 insertions, 83 deletions
diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 4b51c0ac27ac..622994795222 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -224,9 +224,7 @@ static inline u16 get_asoc_status(u8 *data) u16 asoc_status; asoc_status = data[3]; - asoc_status = (asoc_status << 8) | data[2]; - - return asoc_status; + return (asoc_status << 8) | data[2]; } static inline u16 get_asoc_id(u8 *data) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 6ab7443eabde..b00ea75524e4 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1722,10 +1722,8 @@ _WPAPtk_end_case_: case PMKSA: pu8keybuf = kmalloc((pstrHostIFkeyAttr->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1, GFP_KERNEL); - if (!pu8keybuf) { - netdev_err(vif->ndev, "No buffer to send PMKSA Key\n"); + if (!pu8keybuf) return -ENOMEM; - } pu8keybuf[0] = pstrHostIFkeyAttr->attr.pmkid.numpmkid; @@ -1932,7 +1930,7 @@ static s32 Handle_Get_InActiveTime(struct wilc_vif *vif, wid.val = kmalloc(wid.size, GFP_KERNEL); stamac = wid.val; - memcpy(stamac, strHostIfStaInactiveT->mac, ETH_ALEN); + ether_addr_copy(stamac, strHostIfStaInactiveT->mac); result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); @@ -2168,7 +2166,7 @@ static void Handle_DelStation(struct wilc_vif *vif, pu8CurrByte = wid.val; - memcpy(pu8CurrByte, pstrDelStaParam->mac_addr, ETH_ALEN); + ether_addr_copy(pu8CurrByte, pstrDelStaParam->mac_addr); result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, wilc_get_vif_idx(vif)); @@ -2322,10 +2320,8 @@ static u32 Handle_ListenStateExpired(struct wilc_vif *vif, wid.size = 2; wid.val = kmalloc(wid.size, GFP_KERNEL); - if (!wid.val) { - netdev_err(vif->ndev, "Failed to allocate memory\n"); + if (!wid.val) return -ENOMEM; - } wid.val[0] = u8remain_on_chan_flag; wid.val[1] = FALSE_FRMWR_CHANNEL; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index ddfea29df2a7..f36d3b5a0370 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -367,7 +367,6 @@ extern u8 wilc_connected_ssid[6]; extern u8 wilc_multicast_mac_addr_list[WILC_MULTICAST_TABLE_SIZE][ETH_ALEN]; extern int wilc_connecting; -extern u8 wilc_initialized; extern struct timer_list wilc_during_ip_timer; #endif diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index 242f82f4d24f..f328d75de0d1 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -111,7 +111,7 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size) } skb->dev = wilc_wfi_mon; - skb_set_mac_header(skb, 0); + skb_reset_mac_header(skb); skb->ip_summed = CHECKSUM_UNNECESSARY; skb->pkt_type = PACKET_OTHERHOST; skb->protocol = htons(ETH_P_802_2); @@ -215,7 +215,7 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb, cb_hdr->tx_flags = 0x0004; skb2->dev = wilc_wfi_mon; - skb_set_mac_header(skb2, 0); + skb_reset_mac_header(skb2); skb2->ip_summed = CHECKSUM_UNNECESSARY; skb2->pkt_type = PACKET_OTHERHOST; skb2->protocol = htons(ETH_P_802_2); diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 6370a5efe343..3775706578b2 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -37,6 +37,8 @@ static void linux_wlan_tx_complete(void *priv, int status); static int mac_init_fn(struct net_device *ndev); static struct net_device_stats *mac_stats(struct net_device *dev); static int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd); +static int wilc_mac_open(struct net_device *ndev); +static int wilc_mac_close(struct net_device *ndev); static void wilc_set_multicast_list(struct net_device *dev); bool wilc_enable_ps = true; @@ -218,17 +220,6 @@ static void deinit_irq(struct net_device *dev) } } -int wilc_lock_timeout(struct wilc *nic, void *vp, u32 timeout) -{ - /* FIXME: replace with mutex_lock or wait_for_completion */ - int error = -1; - - if (vp) - error = down_timeout(vp, - msecs_to_jiffies(timeout)); - return error; -} - void wilc_mac_indicate(struct wilc *wilc, int flag) { int status; @@ -269,23 +260,12 @@ static struct net_device *get_if_handler(struct wilc *wilc, u8 *mac_header) int wilc_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid, u8 mode) { - int i = 0; - int ret = -1; - struct wilc_vif *vif; - struct wilc *wilc; - - vif = netdev_priv(wilc_netdev); - wilc = vif->wilc; + struct wilc_vif *vif = netdev_priv(wilc_netdev); - for (i = 0; i < wilc->vif_num; i++) - if (wilc->vif[i]->ndev == wilc_netdev) { - memcpy(wilc->vif[i]->bssid, bssid, 6); - wilc->vif[i]->mode = mode; - ret = 0; - break; - } + memcpy(vif->bssid, bssid, 6); + vif->mode = mode; - return ret; + return 0; } int wilc_wlan_get_num_conn_ifcs(struct wilc *wilc) @@ -847,7 +827,7 @@ static int mac_init_fn(struct net_device *ndev) return 0; } -int wilc_mac_open(struct net_device *ndev) +static int wilc_mac_open(struct net_device *ndev) { struct wilc_vif *vif; @@ -1038,7 +1018,7 @@ int wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev) return 0; } -int wilc_mac_close(struct net_device *ndev) +static int wilc_mac_close(struct net_device *ndev) { struct wilc_priv *priv; struct wilc_vif *vif; @@ -1212,16 +1192,11 @@ void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size) void wilc_netdev_cleanup(struct wilc *wilc) { - int i = 0; - struct wilc_vif *vif[NUM_CONCURRENT_IFC]; + int i; - if (wilc && (wilc->vif[0]->ndev || wilc->vif[1]->ndev)) { + if (wilc && (wilc->vif[0]->ndev || wilc->vif[1]->ndev)) unregister_inetaddr_notifier(&g_dev_notifier); - for (i = 0; i < NUM_CONCURRENT_IFC; i++) - vif[i] = netdev_priv(wilc->vif[i]->ndev); - } - if (wilc && wilc->firmware) { release_firmware(wilc->firmware); wilc->firmware = NULL; @@ -1230,7 +1205,7 @@ void wilc_netdev_cleanup(struct wilc *wilc) if (wilc && (wilc->vif[0]->ndev || wilc->vif[1]->ndev)) { for (i = 0; i < NUM_CONCURRENT_IFC; i++) if (wilc->vif[i]->ndev) - if (vif[i]->mac_opened) + if (wilc->vif[i]->mac_opened) wilc_mac_close(wilc->vif[i]->ndev); for (i = 0; i < NUM_CONCURRENT_IFC; i++) { @@ -1278,9 +1253,9 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, vif->idx = wl->vif_num; vif->wilc = *wilc; + vif->ndev = ndev; wl->vif[i] = vif; - wl->vif[wl->vif_num]->ndev = ndev; - wl->vif_num++; + wl->vif_num = i; ndev->netdev_ops = &wilc_netdev_ops; { diff --git a/drivers/staging/wilc1000/wilc_debugfs.c b/drivers/staging/wilc1000/wilc_debugfs.c index 802bb1d5e207..07260c497db4 100644 --- a/drivers/staging/wilc1000/wilc_debugfs.c +++ b/drivers/staging/wilc1000/wilc_debugfs.c @@ -62,16 +62,16 @@ static ssize_t wilc_debug_level_write(struct file *filp, const char __user *buf, return ret; if (flag > DBG_LEVEL_ALL) { - printk("%s, value (0x%08x) is out of range, stay previous flag (0x%08x)\n", __func__, flag, atomic_read(&WILC_DEBUG_LEVEL)); + pr_info("%s, value (0x%08x) is out of range, stay previous flag (0x%08x)\n", __func__, flag, atomic_read(&WILC_DEBUG_LEVEL)); return -EINVAL; } atomic_set(&WILC_DEBUG_LEVEL, (int)flag); if (flag == 0) - printk(KERN_INFO "Debug-level disabled\n"); + pr_info("Debug-level disabled\n"); else - printk(KERN_INFO "Debug-level enabled\n"); + pr_info("Debug-level enabled\n"); return count; } diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index 39b73fb27398..3ad7cec4662d 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -39,6 +39,7 @@ struct wilc_sdio { }; static struct wilc_sdio g_sdio; +static const struct wilc_hif_func wilc_hif_sdio; static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 data); static int sdio_read_reg(struct wilc *wilc, u32 addr, u32 *data); @@ -1100,7 +1101,7 @@ static int sdio_sync_ext(struct wilc *wilc, int nint) * ********************************************/ -const struct wilc_hif_func wilc_hif_sdio = { +static const struct wilc_hif_func wilc_hif_sdio = { .hif_init = sdio_init, .hif_deinit = sdio_deinit, .hif_read_reg = sdio_read_reg, diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c index f08cf6d9e1af..55d53c3a95df 100644 --- a/drivers/staging/wilc1000/wilc_spi.c +++ b/drivers/staging/wilc1000/wilc_spi.c @@ -30,6 +30,7 @@ struct wilc_spi { }; static struct wilc_spi g_spi; +static const struct wilc_hif_func wilc_hif_spi; static int wilc_spi_read(struct wilc *wilc, u32, u8 *, u32); static int wilc_spi_write(struct wilc *wilc, u32, u8 *, u32); @@ -858,7 +859,8 @@ static int wilc_spi_init(struct wilc *wilc, bool resume) /* the SPI to it's initial value. */ if (!spi_internal_read(wilc, WILC_SPI_PROTOCOL_OFFSET, ®)) { /* Read failed. Try with CRC off. This might happen when module - * is removed but chip isn't reset*/ + * is removed but chip isn't reset + */ g_spi.crc_off = 1; dev_err(&spi->dev, "Failed internal read protocol with CRC on, retrying with CRC off...\n"); if (!spi_internal_read(wilc, WILC_SPI_PROTOCOL_OFFSET, ®)) { @@ -1133,7 +1135,7 @@ static int wilc_spi_sync_ext(struct wilc *wilc, int nint) * Global spi HIF function table * ********************************************/ -const struct wilc_hif_func wilc_hif_spi = { +static const struct wilc_hif_func wilc_hif_spi = { .hif_init = wilc_spi_init, .hif_deinit = _wilc_spi_deinit, .hif_read_reg = wilc_spi_read_reg, diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 60d8b055bb2f..c1a24f7bc85f 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -90,17 +90,12 @@ static const struct wiphy_wowlan_support wowlan_support = { #define IS_MGMT_STATUS_SUCCES 0x040 #define GET_PKT_OFFSET(a) (((a) >> 22) & 0x1ff) -extern int wilc_mac_open(struct net_device *ndev); -extern int wilc_mac_close(struct net_device *ndev); - static struct network_info last_scanned_shadow[MAX_NUM_SCANNED_NETWORKS_SHADOW]; static u32 last_scanned_cnt; struct timer_list wilc_during_ip_timer; static struct timer_list hAgingTimer; static u8 op_ifcs; -u8 wilc_initialized = 1; - #define CHAN2G(_channel, _freq, _flags) { \ .band = NL80211_BAND_2GHZ, \ .center_freq = (_freq), \ @@ -1193,6 +1188,7 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev, u32 i = 0; u32 associatedsta = ~0; u32 inactive_time = 0; + priv = wiphy_priv(wiphy); vif = netdev_priv(dev); @@ -1590,28 +1586,25 @@ static int remain_on_channel(struct wiphy *wiphy, priv->strRemainOnChanParams.u32ListenDuration = duration; priv->strRemainOnChanParams.u32ListenSessionID++; - s32Error = wilc_remain_on_channel(vif, + return wilc_remain_on_channel(vif, priv->strRemainOnChanParams.u32ListenSessionID, duration, chan->hw_value, WILC_WFI_RemainOnChannelExpired, WILC_WFI_RemainOnChannelReady, (void *)priv); - - return s32Error; } static int cancel_remain_on_channel(struct wiphy *wiphy, struct wireless_dev *wdev, u64 cookie) { - s32 s32Error = 0; struct wilc_priv *priv; struct wilc_vif *vif; priv = wiphy_priv(wiphy); vif = netdev_priv(priv->dev); - s32Error = wilc_listen_state_expired(vif, priv->strRemainOnChanParams.u32ListenSessionID); - return s32Error; + return wilc_listen_state_expired(vif, + priv->strRemainOnChanParams.u32ListenSessionID); } static int mgmt_tx(struct wiphy *wiphy, @@ -1935,12 +1928,10 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev, wilc_wlan_set_bssid(dev, wl->vif[vif->idx]->src_addr, AP_MODE); wilc_set_power_mgmt(vif, 0, 0); - s32Error = wilc_add_beacon(vif, settings->beacon_interval, + return wilc_add_beacon(vif, settings->beacon_interval, settings->dtim_period, beacon->head_len, (u8 *)beacon->head, beacon->tail_len, (u8 *)beacon->tail); - - return s32Error; } static int change_beacon(struct wiphy *wiphy, struct net_device *dev, @@ -1948,16 +1939,13 @@ static int change_beacon(struct wiphy *wiphy, struct net_device *dev, { struct wilc_priv *priv; struct wilc_vif *vif; - s32 s32Error = 0; priv = wiphy_priv(wiphy); vif = netdev_priv(priv->dev); - s32Error = wilc_add_beacon(vif, 0, 0, beacon->head_len, + return wilc_add_beacon(vif, 0, 0, beacon->head_len, (u8 *)beacon->head, beacon->tail_len, (u8 *)beacon->tail); - - return s32Error; } static int stop_ap(struct wiphy *wiphy, struct net_device *dev) diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index ec6b1674cf38..d431673bc46c 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -225,7 +225,6 @@ int wilc1000_wlan_init(struct net_device *dev, struct wilc_vif *vif); void wilc_frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset); void wilc_mac_indicate(struct wilc *wilc, int flag); -int wilc_lock_timeout(struct wilc *wilc, void *, u32 timeout); void wilc_netdev_cleanup(struct wilc *wilc); int wilc_netdev_init(struct wilc **wilc, struct device *, int io_type, int gpio, const struct wilc_hif_func *ops); diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h index de6c4ddbf45a..11365efcc5d0 100644 --- a/drivers/staging/wilc1000/wilc_wlan.h +++ b/drivers/staging/wilc1000/wilc_wlan.h @@ -248,9 +248,6 @@ struct wilc_hif_func { void (*disable_interrupt)(struct wilc *nic); }; -extern const struct wilc_hif_func wilc_hif_spi; -extern const struct wilc_hif_func wilc_hif_sdio; - /******************************************** * * Configuration Structure @@ -297,9 +294,6 @@ void wilc_enable_tcp_ack_filter(bool value); int wilc_wlan_get_num_conn_ifcs(struct wilc *); int wilc_mac_xmit(struct sk_buff *skb, struct net_device *dev); -int wilc_mac_open(struct net_device *ndev); -int wilc_mac_close(struct net_device *ndev); - void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, u32 size); void host_wakeup_notify(struct wilc *wilc); void host_sleep_notify(struct wilc *wilc); |