Loading drivers/net/Kconfig +13 −0 Original line number Diff line number Diff line Loading @@ -2284,6 +2284,19 @@ config GELIC_WIRELESS the driver automatically distinguishes the models, you can safely enable this option even if you have a wireless-less model. config GELIC_WIRELESS_OLD_PSK_INTERFACE bool "PS3 Wireless private PSK interface (OBSOLETE)" depends on GELIC_WIRELESS help This option retains the obsolete private interface to pass the PSK from user space programs to the driver. The PSK stands for 'Pre Shared Key' and is used for WPA[2]-PSK (WPA-Personal) environment. If WPA[2]-PSK is used and you need to use old programs that support only this old interface, say Y. Otherwise N. If unsure, say N. config GIANFAR tristate "Gianfar Ethernet" depends on FSL_SOC Loading drivers/net/ps3_gelic_wireless.c +109 −57 Original line number Diff line number Diff line Loading @@ -45,7 +45,8 @@ #include "ps3_gelic_wireless.h" static int gelic_wl_start_scan(struct gelic_wl_info *wl, int always_scan); static int gelic_wl_start_scan(struct gelic_wl_info *wl, int always_scan, u8 *essid, size_t essid_len); static int gelic_wl_try_associate(struct net_device *netdev); /* Loading Loading @@ -105,6 +106,7 @@ static const struct eurus_cmd_arg_info cmd_info[GELIC_EURUS_CMD_MAX_INDEX] = { [GELIC_EURUS_CMD_GET_WEP_CFG] = { .post_arg = 1}, [GELIC_EURUS_CMD_GET_WPA_CFG] = { .post_arg = 1}, [GELIC_EURUS_CMD_GET_RSSI_CFG] = { .post_arg = 1}, [GELIC_EURUS_CMD_START_SCAN] = { .pre_arg = 1}, [GELIC_EURUS_CMD_GET_SCAN] = { .post_arg = 1}, }; Loading Loading @@ -163,7 +165,9 @@ static void gelic_eurus_sync_cmd_worker(struct work_struct *work) card = port_to_card(wl_port(wl)); if (cmd_info[cmd->cmd].pre_arg) { arg1 = ps3_mm_phys_to_lpar(__pa(cmd->buffer)); arg1 = (cmd->buffer) ? ps3_mm_phys_to_lpar(__pa(cmd->buffer)) : 0; arg2 = cmd->buf_size; } else { arg1 = 0; Loading Loading @@ -350,7 +354,8 @@ static int gelic_wl_get_range(struct net_device *netdev, /* encryption capability */ range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP; IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP | IW_ENC_CAPA_4WAY_HANDSHAKE; if (wpa2_capable()) range->enc_capa |= IW_ENC_CAPA_WPA2; range->encoding_size[0] = 5; /* 40bit WEP */ Loading @@ -359,6 +364,9 @@ static int gelic_wl_get_range(struct net_device *netdev, range->num_encoding_sizes = 3; range->max_encoding_tokens = GELIC_WEP_KEYS; /* scan capability */ range->scan_capa = IW_SCAN_CAPA_ESSID; pr_debug("%s: ->\n", __func__); return 0; Loading @@ -370,8 +378,18 @@ static int gelic_wl_set_scan(struct net_device *netdev, union iwreq_data *wrqu, char *extra) { struct gelic_wl_info *wl = port_wl(netdev_priv(netdev)); struct iw_scan_req *req; u8 *essid = NULL; size_t essid_len = 0; return gelic_wl_start_scan(wl, 1); if (wrqu->data.length == sizeof(struct iw_scan_req) && wrqu->data.flags & IW_SCAN_THIS_ESSID) { req = (struct iw_scan_req*)extra; essid = req->essid; essid_len = req->essid_len; pr_debug("%s: ESSID scan =%s\n", __func__, essid); } return gelic_wl_start_scan(wl, 1, essid, essid_len); } #define OUI_LEN 3 Loading Loading @@ -1256,42 +1274,19 @@ static int gelic_wl_set_encodeext(struct net_device *netdev, set_bit(key_index, &wl->key_enabled); /* remember wep info changed */ set_bit(GELIC_WL_STAT_CONFIGURED, &wl->stat); } else if ((alg == IW_ENCODE_ALG_TKIP) || (alg == IW_ENCODE_ALG_CCMP)) { pr_debug("%s: TKIP/CCMP requested alg=%d\n", __func__, alg); /* check key length */ if (IW_ENCODING_TOKEN_MAX < ext->key_len) { pr_info("%s: key is too long %d\n", __func__, } else if (alg == IW_ENCODE_ALG_PMK) { if (ext->key_len != WPA_PSK_LEN) { pr_err("%s: PSK length wrong %d\n", __func__, ext->key_len); ret = -EINVAL; goto done; } if (alg == IW_ENCODE_ALG_CCMP) { pr_debug("%s: AES selected\n", __func__); wl->group_cipher_method = GELIC_WL_CIPHER_AES; wl->pairwise_cipher_method = GELIC_WL_CIPHER_AES; wl->wpa_level = GELIC_WL_WPA_LEVEL_WPA2; } else { pr_debug("%s: TKIP selected, WPA forced\n", __func__); wl->group_cipher_method = GELIC_WL_CIPHER_TKIP; wl->pairwise_cipher_method = GELIC_WL_CIPHER_TKIP; /* FIXME: how do we do if WPA2 + TKIP? */ wl->wpa_level = GELIC_WL_WPA_LEVEL_WPA; } if (flags & IW_ENCODE_RESTRICTED) BUG(); wl->auth_method = GELIC_EURUS_AUTH_OPEN; /* We should use same key for both and unicast */ if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) pr_debug("%s: group key \n", __func__); else pr_debug("%s: unicast key \n", __func__); /* OK, update the key */ wl->key_len[key_index] = ext->key_len; memset(wl->key[key_index], 0, IW_ENCODING_TOKEN_MAX); memcpy(wl->key[key_index], ext->key, ext->key_len); set_bit(key_index, &wl->key_enabled); /* remember info changed */ set_bit(GELIC_WL_STAT_CONFIGURED, &wl->stat); memset(wl->psk, 0, sizeof(wl->psk)); memcpy(wl->psk, ext->key, ext->key_len); wl->psk_len = ext->key_len; wl->psk_type = GELIC_EURUS_WPA_PSK_BIN; /* remember PSK configured */ set_bit(GELIC_WL_STAT_WPA_PSK_SET, &wl->stat); } done: spin_unlock_irqrestore(&wl->lock, irqflag); Loading Loading @@ -1397,6 +1392,7 @@ static int gelic_wl_get_mode(struct net_device *netdev, return 0; } #ifdef CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE /* SIOCIWFIRSTPRIV */ static int hex2bin(u8 *str, u8 *bin, unsigned int len) { Loading Loading @@ -1501,6 +1497,7 @@ static int gelic_wl_priv_get_psk(struct net_device *net_dev, pr_debug("%s:-> %d\n", __func__, data->data.length); return 0; } #endif /* SIOCGIWNICKN */ static int gelic_wl_get_nick(struct net_device *net_dev, Loading @@ -1524,15 +1521,20 @@ static struct iw_statistics *gelic_wl_get_wireless_stats( struct gelic_eurus_cmd *cmd; struct iw_statistics *is; struct gelic_eurus_rssi_info *rssi; void *buf; pr_debug("%s: <-\n", __func__); buf = (void *)__get_free_page(GFP_KERNEL); if (!buf) return NULL; is = &wl->iwstat; memset(is, 0, sizeof(*is)); cmd = gelic_eurus_sync_cmd(wl, GELIC_EURUS_CMD_GET_RSSI_CFG, wl->buf, sizeof(*rssi)); buf, sizeof(*rssi)); if (cmd && !cmd->status && !cmd->cmd_status) { rssi = wl->buf; rssi = buf; is->qual.level = be16_to_cpu(rssi->rssi); is->qual.updated = IW_QUAL_LEVEL_UPDATED | IW_QUAL_QUAL_INVALID | IW_QUAL_NOISE_INVALID; Loading @@ -1541,6 +1543,7 @@ static struct iw_statistics *gelic_wl_get_wireless_stats( is->qual.updated = IW_QUAL_ALL_INVALID; kfree(cmd); free_page((unsigned long)buf); pr_debug("%s: ->\n", __func__); return is; } Loading @@ -1548,10 +1551,13 @@ static struct iw_statistics *gelic_wl_get_wireless_stats( /* * scanning helpers */ static int gelic_wl_start_scan(struct gelic_wl_info *wl, int always_scan) static int gelic_wl_start_scan(struct gelic_wl_info *wl, int always_scan, u8 *essid, size_t essid_len) { struct gelic_eurus_cmd *cmd; int ret = 0; void *buf = NULL; size_t len; pr_debug("%s: <- always=%d\n", __func__, always_scan); if (mutex_lock_interruptible(&wl->scan_lock)) Loading @@ -1574,12 +1580,27 @@ static int gelic_wl_start_scan(struct gelic_wl_info *wl, int always_scan) complete(&wl->scan_done); goto out; } /* ESSID scan ? */ if (essid_len && essid) { buf = (void *)__get_free_page(GFP_KERNEL); if (!buf) { ret = -ENOMEM; goto out; } len = IW_ESSID_MAX_SIZE; /* hypervisor always requires 32 */ memset(buf, 0, len); memcpy(buf, essid, essid_len); pr_debug("%s: essid scan='%s'\n", __func__, (char *)buf); } else len = 0; /* * issue start scan request */ wl->scan_stat = GELIC_WL_SCAN_STAT_SCANNING; cmd = gelic_eurus_sync_cmd(wl, GELIC_EURUS_CMD_START_SCAN, NULL, 0); buf, len); if (!cmd || cmd->status || cmd->cmd_status) { wl->scan_stat = GELIC_WL_SCAN_STAT_INIT; complete(&wl->scan_done); Loading @@ -1588,6 +1609,7 @@ static int gelic_wl_start_scan(struct gelic_wl_info *wl, int always_scan) } kfree(cmd); out: free_page((unsigned long)buf); mutex_unlock(&wl->scan_lock); pr_debug("%s: ->\n", __func__); return ret; Loading @@ -1607,11 +1629,18 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl) union iwreq_data data; unsigned long this_time = jiffies; unsigned int data_len, i, found, r; void *buf; DECLARE_MAC_BUF(mac); pr_debug("%s:start\n", __func__); mutex_lock(&wl->scan_lock); buf = (void *)__get_free_page(GFP_KERNEL); if (!buf) { pr_info("%s: scan buffer alloc failed\n", __func__); goto out; } if (wl->scan_stat != GELIC_WL_SCAN_STAT_SCANNING) { /* * stop() may be called while scanning, ignore result Loading @@ -1622,7 +1651,7 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl) } cmd = gelic_eurus_sync_cmd(wl, GELIC_EURUS_CMD_GET_SCAN, wl->buf, PAGE_SIZE); buf, PAGE_SIZE); if (!cmd || cmd->status || cmd->cmd_status) { wl->scan_stat = GELIC_WL_SCAN_STAT_INIT; pr_info("%s:cmd failed\n", __func__); Loading @@ -1649,7 +1678,7 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl) } /* put them in the newtork_list */ for (i = 0, scan_info_size = 0, scan_info = wl->buf; for (i = 0, scan_info_size = 0, scan_info = buf; scan_info_size < data_len; i++, scan_info_size += be16_to_cpu(scan_info->size), scan_info = (void *)scan_info + be16_to_cpu(scan_info->size)) { Loading Loading @@ -1726,6 +1755,7 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl) wireless_send_event(port_to_netdev(wl_port(wl)), SIOCGIWSCAN, &data, NULL); out: free_page((unsigned long)buf); complete(&wl->scan_done); mutex_unlock(&wl->scan_lock); pr_debug("%s:end\n", __func__); Loading Loading @@ -1848,7 +1878,10 @@ static int gelic_wl_do_wep_setup(struct gelic_wl_info *wl) pr_debug("%s: <-\n", __func__); /* we can assume no one should uses the buffer */ wep = wl->buf; wep = (struct gelic_eurus_wep_cfg *)__get_free_page(GFP_KERNEL); if (!wep) return -ENOMEM; memset(wep, 0, sizeof(*wep)); if (wl->group_cipher_method == GELIC_WL_CIPHER_WEP) { Loading Loading @@ -1898,6 +1931,7 @@ static int gelic_wl_do_wep_setup(struct gelic_wl_info *wl) kfree(cmd); out: free_page((unsigned long)wep); pr_debug("%s: ->\n", __func__); return ret; } Loading Loading @@ -1941,7 +1975,10 @@ static int gelic_wl_do_wpa_setup(struct gelic_wl_info *wl) pr_debug("%s: <-\n", __func__); /* we can assume no one should uses the buffer */ wpa = wl->buf; wpa = (struct gelic_eurus_wpa_cfg *)__get_free_page(GFP_KERNEL); if (!wpa) return -ENOMEM; memset(wpa, 0, sizeof(*wpa)); if (!test_bit(GELIC_WL_STAT_WPA_PSK_SET, &wl->stat)) Loading Loading @@ -2000,6 +2037,7 @@ static int gelic_wl_do_wpa_setup(struct gelic_wl_info *wl) else if (cmd->status || cmd->cmd_status) ret = -ENXIO; kfree(cmd); free_page((unsigned long)wpa); pr_debug("%s: --> %d\n", __func__, ret); return ret; } Loading @@ -2018,7 +2056,10 @@ static int gelic_wl_associate_bss(struct gelic_wl_info *wl, pr_debug("%s: <-\n", __func__); /* do common config */ common = wl->buf; common = (struct gelic_eurus_common_cfg *)__get_free_page(GFP_KERNEL); if (!common) return -ENOMEM; memset(common, 0, sizeof(*common)); common->bss_type = cpu_to_be16(GELIC_EURUS_BSS_INFRA); common->op_mode = cpu_to_be16(GELIC_EURUS_OPMODE_11BG); Loading Loading @@ -2104,6 +2145,7 @@ static int gelic_wl_associate_bss(struct gelic_wl_info *wl, pr_info("%s: connected\n", __func__); } out: free_page((unsigned long)common); pr_debug("%s: ->\n", __func__); return ret; } Loading Loading @@ -2255,6 +2297,9 @@ static void gelic_wl_assoc_worker(struct work_struct *work) struct gelic_wl_scan_info *best_bss; int ret; unsigned long irqflag; u8 *essid; size_t essid_len; wl = container_of(work, struct gelic_wl_info, assoc_work.work); Loading @@ -2263,7 +2308,19 @@ static void gelic_wl_assoc_worker(struct work_struct *work) if (wl->assoc_stat != GELIC_WL_ASSOC_STAT_DISCONN) goto out; ret = gelic_wl_start_scan(wl, 0); spin_lock_irqsave(&wl->lock, irqflag); if (test_bit(GELIC_WL_STAT_ESSID_SET, &wl->stat)) { pr_debug("%s: assoc ESSID configured %s\n", __func__, wl->essid); essid = wl->essid; essid_len = wl->essid_len; } else { essid = NULL; essid_len = 0; } spin_unlock_irqrestore(&wl->lock, irqflag); ret = gelic_wl_start_scan(wl, 0, essid, essid_len); if (ret == -ERESTARTSYS) { pr_debug("%s: scan start failed association\n", __func__); schedule_delayed_work(&wl->assoc_work, HZ/10); /*FIXME*/ Loading Loading @@ -2351,6 +2408,7 @@ static const iw_handler gelic_wl_wext_handler[] = IW_IOCTL(SIOCGIWNICKN) = gelic_wl_get_nick, }; #ifdef CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE static struct iw_priv_args gelic_wl_private_args[] = { { Loading @@ -2372,15 +2430,18 @@ static const iw_handler gelic_wl_private_handler[] = gelic_wl_priv_set_psk, gelic_wl_priv_get_psk, }; #endif static const struct iw_handler_def gelic_wl_wext_handler_def = { .num_standard = ARRAY_SIZE(gelic_wl_wext_handler), .standard = gelic_wl_wext_handler, .get_wireless_stats = gelic_wl_get_wireless_stats, #ifdef CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE .num_private = ARRAY_SIZE(gelic_wl_private_handler), .num_private_args = ARRAY_SIZE(gelic_wl_private_args), .private = gelic_wl_private_handler, .private_args = gelic_wl_private_args, #endif }; static struct net_device *gelic_wl_alloc(struct gelic_card *card) Loading Loading @@ -2446,16 +2507,9 @@ static struct net_device *gelic_wl_alloc(struct gelic_card *card) BUILD_BUG_ON(PAGE_SIZE < sizeof(struct gelic_eurus_scan_info) * GELIC_EURUS_MAX_SCAN); wl->buf = (void *)get_zeroed_page(GFP_KERNEL); if (!wl->buf) { pr_info("%s:buffer allocation failed\n", __func__); goto fail_getpage; } pr_debug("%s:end\n", __func__); return netdev; fail_getpage: destroy_workqueue(wl->event_queue); fail_event_workqueue: destroy_workqueue(wl->eurus_cmd_queue); fail_cmd_workqueue: Loading @@ -2474,8 +2528,6 @@ static void gelic_wl_free(struct gelic_wl_info *wl) pr_debug("%s: <-\n", __func__); free_page((unsigned long)wl->buf); pr_debug("%s: destroy queues\n", __func__); destroy_workqueue(wl->eurus_cmd_queue); destroy_workqueue(wl->event_queue); Loading drivers/net/ps3_gelic_wireless.h +0 −3 Original line number Diff line number Diff line Loading @@ -288,9 +288,6 @@ struct gelic_wl_info { u8 active_bssid[ETH_ALEN]; /* associated bssid */ unsigned int essid_len; /* buffer for hypervisor IO */ void *buf; struct iw_public_data wireless_data; struct iw_statistics iwstat; }; Loading drivers/net/wireless/adm8211.c +16 −19 Original line number Diff line number Diff line Loading @@ -324,7 +324,7 @@ static void adm8211_interrupt_tci(struct ieee80211_hw *dev) for (dirty_tx = priv->dirty_tx; priv->cur_tx - dirty_tx; dirty_tx++) { unsigned int entry = dirty_tx % priv->tx_ring_size; u32 status = le32_to_cpu(priv->tx_ring[entry].status); struct ieee80211_tx_status tx_status; struct ieee80211_tx_info *txi; struct adm8211_tx_ring_info *info; struct sk_buff *skb; Loading @@ -334,24 +334,23 @@ static void adm8211_interrupt_tci(struct ieee80211_hw *dev) info = &priv->tx_buffers[entry]; skb = info->skb; txi = IEEE80211_SKB_CB(skb); /* TODO: check TDES0_STATUS_TUF and TDES0_STATUS_TRO */ pci_unmap_single(priv->pdev, info->mapping, info->skb->len, PCI_DMA_TODEVICE); memset(&tx_status, 0, sizeof(tx_status)); memset(&txi->status, 0, sizeof(txi->status)); skb_pull(skb, sizeof(struct adm8211_tx_hdr)); memcpy(skb_push(skb, info->hdrlen), skb->cb, info->hdrlen); memcpy(&tx_status.control, &info->tx_control, sizeof(tx_status.control)); if (!(tx_status.control.flags & IEEE80211_TXCTL_NO_ACK)) { if (!(txi->flags & IEEE80211_TX_CTL_NO_ACK)) { if (status & TDES0_STATUS_ES) tx_status.excessive_retries = 1; txi->status.excessive_retries = 1; else tx_status.flags |= IEEE80211_TX_STATUS_ACK; txi->flags |= IEEE80211_TX_STAT_ACK; } ieee80211_tx_status_irqsafe(dev, skb, &tx_status); ieee80211_tx_status_irqsafe(dev, skb); info->skb = NULL; } Loading Loading @@ -1638,7 +1637,6 @@ static void adm8211_calc_durations(int *dur, int *plcp, size_t payload_len, int /* Transmit skb w/adm8211_tx_hdr (802.11 header created by hardware) */ static void adm8211_tx_raw(struct ieee80211_hw *dev, struct sk_buff *skb, u16 plcp_signal, struct ieee80211_tx_control *control, size_t hdrlen) { struct adm8211_priv *priv = dev->priv; Loading @@ -1664,7 +1662,6 @@ static void adm8211_tx_raw(struct ieee80211_hw *dev, struct sk_buff *skb, priv->tx_buffers[entry].skb = skb; priv->tx_buffers[entry].mapping = mapping; memcpy(&priv->tx_buffers[entry].tx_control, control, sizeof(*control)); priv->tx_buffers[entry].hdrlen = hdrlen; priv->tx_ring[entry].buffer1 = cpu_to_le32(mapping); Loading @@ -1685,18 +1682,18 @@ static void adm8211_tx_raw(struct ieee80211_hw *dev, struct sk_buff *skb, } /* Put adm8211_tx_hdr on skb and transmit */ static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb, struct ieee80211_tx_control *control) static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb) { struct adm8211_tx_hdr *txhdr; u16 fc; size_t payload_len, hdrlen; int plcp, dur, len, plcp_signal, short_preamble; struct ieee80211_hdr *hdr; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_rate *txrate = ieee80211_get_tx_rate(dev, info); short_preamble = !!(control->tx_rate->flags & IEEE80211_TXCTL_SHORT_PREAMBLE); plcp_signal = control->tx_rate->bitrate; short_preamble = !!(txrate->flags & IEEE80211_TX_CTL_SHORT_PREAMBLE); plcp_signal = txrate->bitrate; hdr = (struct ieee80211_hdr *)skb->data; fc = le16_to_cpu(hdr->frame_control) & ~IEEE80211_FCTL_PROTECTED; Loading Loading @@ -1730,15 +1727,15 @@ static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb, if (short_preamble) txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_SHORT_PREAMBLE); if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_ENABLE_RTS); if (fc & IEEE80211_FCTL_PROTECTED) txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_ENABLE_WEP_ENGINE); txhdr->retry_limit = control->retry_limit; txhdr->retry_limit = info->control.retry_limit; adm8211_tx_raw(dev, skb, plcp_signal, control, hdrlen); adm8211_tx_raw(dev, skb, plcp_signal, hdrlen); return NETDEV_TX_OK; } Loading Loading @@ -2015,7 +2012,7 @@ static int adm8211_resume(struct pci_dev *pdev) if (priv->mode != IEEE80211_IF_TYPE_INVALID) { adm8211_start(dev); ieee80211_start_queues(dev); ieee80211_wake_queues(dev); } return 0; Loading drivers/net/wireless/adm8211.h +0 −1 Original line number Diff line number Diff line Loading @@ -443,7 +443,6 @@ struct adm8211_rx_ring_info { struct adm8211_tx_ring_info { struct sk_buff *skb; dma_addr_t mapping; struct ieee80211_tx_control tx_control; size_t hdrlen; }; Loading Loading
drivers/net/Kconfig +13 −0 Original line number Diff line number Diff line Loading @@ -2284,6 +2284,19 @@ config GELIC_WIRELESS the driver automatically distinguishes the models, you can safely enable this option even if you have a wireless-less model. config GELIC_WIRELESS_OLD_PSK_INTERFACE bool "PS3 Wireless private PSK interface (OBSOLETE)" depends on GELIC_WIRELESS help This option retains the obsolete private interface to pass the PSK from user space programs to the driver. The PSK stands for 'Pre Shared Key' and is used for WPA[2]-PSK (WPA-Personal) environment. If WPA[2]-PSK is used and you need to use old programs that support only this old interface, say Y. Otherwise N. If unsure, say N. config GIANFAR tristate "Gianfar Ethernet" depends on FSL_SOC Loading
drivers/net/ps3_gelic_wireless.c +109 −57 Original line number Diff line number Diff line Loading @@ -45,7 +45,8 @@ #include "ps3_gelic_wireless.h" static int gelic_wl_start_scan(struct gelic_wl_info *wl, int always_scan); static int gelic_wl_start_scan(struct gelic_wl_info *wl, int always_scan, u8 *essid, size_t essid_len); static int gelic_wl_try_associate(struct net_device *netdev); /* Loading Loading @@ -105,6 +106,7 @@ static const struct eurus_cmd_arg_info cmd_info[GELIC_EURUS_CMD_MAX_INDEX] = { [GELIC_EURUS_CMD_GET_WEP_CFG] = { .post_arg = 1}, [GELIC_EURUS_CMD_GET_WPA_CFG] = { .post_arg = 1}, [GELIC_EURUS_CMD_GET_RSSI_CFG] = { .post_arg = 1}, [GELIC_EURUS_CMD_START_SCAN] = { .pre_arg = 1}, [GELIC_EURUS_CMD_GET_SCAN] = { .post_arg = 1}, }; Loading Loading @@ -163,7 +165,9 @@ static void gelic_eurus_sync_cmd_worker(struct work_struct *work) card = port_to_card(wl_port(wl)); if (cmd_info[cmd->cmd].pre_arg) { arg1 = ps3_mm_phys_to_lpar(__pa(cmd->buffer)); arg1 = (cmd->buffer) ? ps3_mm_phys_to_lpar(__pa(cmd->buffer)) : 0; arg2 = cmd->buf_size; } else { arg1 = 0; Loading Loading @@ -350,7 +354,8 @@ static int gelic_wl_get_range(struct net_device *netdev, /* encryption capability */ range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP; IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP | IW_ENC_CAPA_4WAY_HANDSHAKE; if (wpa2_capable()) range->enc_capa |= IW_ENC_CAPA_WPA2; range->encoding_size[0] = 5; /* 40bit WEP */ Loading @@ -359,6 +364,9 @@ static int gelic_wl_get_range(struct net_device *netdev, range->num_encoding_sizes = 3; range->max_encoding_tokens = GELIC_WEP_KEYS; /* scan capability */ range->scan_capa = IW_SCAN_CAPA_ESSID; pr_debug("%s: ->\n", __func__); return 0; Loading @@ -370,8 +378,18 @@ static int gelic_wl_set_scan(struct net_device *netdev, union iwreq_data *wrqu, char *extra) { struct gelic_wl_info *wl = port_wl(netdev_priv(netdev)); struct iw_scan_req *req; u8 *essid = NULL; size_t essid_len = 0; return gelic_wl_start_scan(wl, 1); if (wrqu->data.length == sizeof(struct iw_scan_req) && wrqu->data.flags & IW_SCAN_THIS_ESSID) { req = (struct iw_scan_req*)extra; essid = req->essid; essid_len = req->essid_len; pr_debug("%s: ESSID scan =%s\n", __func__, essid); } return gelic_wl_start_scan(wl, 1, essid, essid_len); } #define OUI_LEN 3 Loading Loading @@ -1256,42 +1274,19 @@ static int gelic_wl_set_encodeext(struct net_device *netdev, set_bit(key_index, &wl->key_enabled); /* remember wep info changed */ set_bit(GELIC_WL_STAT_CONFIGURED, &wl->stat); } else if ((alg == IW_ENCODE_ALG_TKIP) || (alg == IW_ENCODE_ALG_CCMP)) { pr_debug("%s: TKIP/CCMP requested alg=%d\n", __func__, alg); /* check key length */ if (IW_ENCODING_TOKEN_MAX < ext->key_len) { pr_info("%s: key is too long %d\n", __func__, } else if (alg == IW_ENCODE_ALG_PMK) { if (ext->key_len != WPA_PSK_LEN) { pr_err("%s: PSK length wrong %d\n", __func__, ext->key_len); ret = -EINVAL; goto done; } if (alg == IW_ENCODE_ALG_CCMP) { pr_debug("%s: AES selected\n", __func__); wl->group_cipher_method = GELIC_WL_CIPHER_AES; wl->pairwise_cipher_method = GELIC_WL_CIPHER_AES; wl->wpa_level = GELIC_WL_WPA_LEVEL_WPA2; } else { pr_debug("%s: TKIP selected, WPA forced\n", __func__); wl->group_cipher_method = GELIC_WL_CIPHER_TKIP; wl->pairwise_cipher_method = GELIC_WL_CIPHER_TKIP; /* FIXME: how do we do if WPA2 + TKIP? */ wl->wpa_level = GELIC_WL_WPA_LEVEL_WPA; } if (flags & IW_ENCODE_RESTRICTED) BUG(); wl->auth_method = GELIC_EURUS_AUTH_OPEN; /* We should use same key for both and unicast */ if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) pr_debug("%s: group key \n", __func__); else pr_debug("%s: unicast key \n", __func__); /* OK, update the key */ wl->key_len[key_index] = ext->key_len; memset(wl->key[key_index], 0, IW_ENCODING_TOKEN_MAX); memcpy(wl->key[key_index], ext->key, ext->key_len); set_bit(key_index, &wl->key_enabled); /* remember info changed */ set_bit(GELIC_WL_STAT_CONFIGURED, &wl->stat); memset(wl->psk, 0, sizeof(wl->psk)); memcpy(wl->psk, ext->key, ext->key_len); wl->psk_len = ext->key_len; wl->psk_type = GELIC_EURUS_WPA_PSK_BIN; /* remember PSK configured */ set_bit(GELIC_WL_STAT_WPA_PSK_SET, &wl->stat); } done: spin_unlock_irqrestore(&wl->lock, irqflag); Loading Loading @@ -1397,6 +1392,7 @@ static int gelic_wl_get_mode(struct net_device *netdev, return 0; } #ifdef CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE /* SIOCIWFIRSTPRIV */ static int hex2bin(u8 *str, u8 *bin, unsigned int len) { Loading Loading @@ -1501,6 +1497,7 @@ static int gelic_wl_priv_get_psk(struct net_device *net_dev, pr_debug("%s:-> %d\n", __func__, data->data.length); return 0; } #endif /* SIOCGIWNICKN */ static int gelic_wl_get_nick(struct net_device *net_dev, Loading @@ -1524,15 +1521,20 @@ static struct iw_statistics *gelic_wl_get_wireless_stats( struct gelic_eurus_cmd *cmd; struct iw_statistics *is; struct gelic_eurus_rssi_info *rssi; void *buf; pr_debug("%s: <-\n", __func__); buf = (void *)__get_free_page(GFP_KERNEL); if (!buf) return NULL; is = &wl->iwstat; memset(is, 0, sizeof(*is)); cmd = gelic_eurus_sync_cmd(wl, GELIC_EURUS_CMD_GET_RSSI_CFG, wl->buf, sizeof(*rssi)); buf, sizeof(*rssi)); if (cmd && !cmd->status && !cmd->cmd_status) { rssi = wl->buf; rssi = buf; is->qual.level = be16_to_cpu(rssi->rssi); is->qual.updated = IW_QUAL_LEVEL_UPDATED | IW_QUAL_QUAL_INVALID | IW_QUAL_NOISE_INVALID; Loading @@ -1541,6 +1543,7 @@ static struct iw_statistics *gelic_wl_get_wireless_stats( is->qual.updated = IW_QUAL_ALL_INVALID; kfree(cmd); free_page((unsigned long)buf); pr_debug("%s: ->\n", __func__); return is; } Loading @@ -1548,10 +1551,13 @@ static struct iw_statistics *gelic_wl_get_wireless_stats( /* * scanning helpers */ static int gelic_wl_start_scan(struct gelic_wl_info *wl, int always_scan) static int gelic_wl_start_scan(struct gelic_wl_info *wl, int always_scan, u8 *essid, size_t essid_len) { struct gelic_eurus_cmd *cmd; int ret = 0; void *buf = NULL; size_t len; pr_debug("%s: <- always=%d\n", __func__, always_scan); if (mutex_lock_interruptible(&wl->scan_lock)) Loading @@ -1574,12 +1580,27 @@ static int gelic_wl_start_scan(struct gelic_wl_info *wl, int always_scan) complete(&wl->scan_done); goto out; } /* ESSID scan ? */ if (essid_len && essid) { buf = (void *)__get_free_page(GFP_KERNEL); if (!buf) { ret = -ENOMEM; goto out; } len = IW_ESSID_MAX_SIZE; /* hypervisor always requires 32 */ memset(buf, 0, len); memcpy(buf, essid, essid_len); pr_debug("%s: essid scan='%s'\n", __func__, (char *)buf); } else len = 0; /* * issue start scan request */ wl->scan_stat = GELIC_WL_SCAN_STAT_SCANNING; cmd = gelic_eurus_sync_cmd(wl, GELIC_EURUS_CMD_START_SCAN, NULL, 0); buf, len); if (!cmd || cmd->status || cmd->cmd_status) { wl->scan_stat = GELIC_WL_SCAN_STAT_INIT; complete(&wl->scan_done); Loading @@ -1588,6 +1609,7 @@ static int gelic_wl_start_scan(struct gelic_wl_info *wl, int always_scan) } kfree(cmd); out: free_page((unsigned long)buf); mutex_unlock(&wl->scan_lock); pr_debug("%s: ->\n", __func__); return ret; Loading @@ -1607,11 +1629,18 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl) union iwreq_data data; unsigned long this_time = jiffies; unsigned int data_len, i, found, r; void *buf; DECLARE_MAC_BUF(mac); pr_debug("%s:start\n", __func__); mutex_lock(&wl->scan_lock); buf = (void *)__get_free_page(GFP_KERNEL); if (!buf) { pr_info("%s: scan buffer alloc failed\n", __func__); goto out; } if (wl->scan_stat != GELIC_WL_SCAN_STAT_SCANNING) { /* * stop() may be called while scanning, ignore result Loading @@ -1622,7 +1651,7 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl) } cmd = gelic_eurus_sync_cmd(wl, GELIC_EURUS_CMD_GET_SCAN, wl->buf, PAGE_SIZE); buf, PAGE_SIZE); if (!cmd || cmd->status || cmd->cmd_status) { wl->scan_stat = GELIC_WL_SCAN_STAT_INIT; pr_info("%s:cmd failed\n", __func__); Loading @@ -1649,7 +1678,7 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl) } /* put them in the newtork_list */ for (i = 0, scan_info_size = 0, scan_info = wl->buf; for (i = 0, scan_info_size = 0, scan_info = buf; scan_info_size < data_len; i++, scan_info_size += be16_to_cpu(scan_info->size), scan_info = (void *)scan_info + be16_to_cpu(scan_info->size)) { Loading Loading @@ -1726,6 +1755,7 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl) wireless_send_event(port_to_netdev(wl_port(wl)), SIOCGIWSCAN, &data, NULL); out: free_page((unsigned long)buf); complete(&wl->scan_done); mutex_unlock(&wl->scan_lock); pr_debug("%s:end\n", __func__); Loading Loading @@ -1848,7 +1878,10 @@ static int gelic_wl_do_wep_setup(struct gelic_wl_info *wl) pr_debug("%s: <-\n", __func__); /* we can assume no one should uses the buffer */ wep = wl->buf; wep = (struct gelic_eurus_wep_cfg *)__get_free_page(GFP_KERNEL); if (!wep) return -ENOMEM; memset(wep, 0, sizeof(*wep)); if (wl->group_cipher_method == GELIC_WL_CIPHER_WEP) { Loading Loading @@ -1898,6 +1931,7 @@ static int gelic_wl_do_wep_setup(struct gelic_wl_info *wl) kfree(cmd); out: free_page((unsigned long)wep); pr_debug("%s: ->\n", __func__); return ret; } Loading Loading @@ -1941,7 +1975,10 @@ static int gelic_wl_do_wpa_setup(struct gelic_wl_info *wl) pr_debug("%s: <-\n", __func__); /* we can assume no one should uses the buffer */ wpa = wl->buf; wpa = (struct gelic_eurus_wpa_cfg *)__get_free_page(GFP_KERNEL); if (!wpa) return -ENOMEM; memset(wpa, 0, sizeof(*wpa)); if (!test_bit(GELIC_WL_STAT_WPA_PSK_SET, &wl->stat)) Loading Loading @@ -2000,6 +2037,7 @@ static int gelic_wl_do_wpa_setup(struct gelic_wl_info *wl) else if (cmd->status || cmd->cmd_status) ret = -ENXIO; kfree(cmd); free_page((unsigned long)wpa); pr_debug("%s: --> %d\n", __func__, ret); return ret; } Loading @@ -2018,7 +2056,10 @@ static int gelic_wl_associate_bss(struct gelic_wl_info *wl, pr_debug("%s: <-\n", __func__); /* do common config */ common = wl->buf; common = (struct gelic_eurus_common_cfg *)__get_free_page(GFP_KERNEL); if (!common) return -ENOMEM; memset(common, 0, sizeof(*common)); common->bss_type = cpu_to_be16(GELIC_EURUS_BSS_INFRA); common->op_mode = cpu_to_be16(GELIC_EURUS_OPMODE_11BG); Loading Loading @@ -2104,6 +2145,7 @@ static int gelic_wl_associate_bss(struct gelic_wl_info *wl, pr_info("%s: connected\n", __func__); } out: free_page((unsigned long)common); pr_debug("%s: ->\n", __func__); return ret; } Loading Loading @@ -2255,6 +2297,9 @@ static void gelic_wl_assoc_worker(struct work_struct *work) struct gelic_wl_scan_info *best_bss; int ret; unsigned long irqflag; u8 *essid; size_t essid_len; wl = container_of(work, struct gelic_wl_info, assoc_work.work); Loading @@ -2263,7 +2308,19 @@ static void gelic_wl_assoc_worker(struct work_struct *work) if (wl->assoc_stat != GELIC_WL_ASSOC_STAT_DISCONN) goto out; ret = gelic_wl_start_scan(wl, 0); spin_lock_irqsave(&wl->lock, irqflag); if (test_bit(GELIC_WL_STAT_ESSID_SET, &wl->stat)) { pr_debug("%s: assoc ESSID configured %s\n", __func__, wl->essid); essid = wl->essid; essid_len = wl->essid_len; } else { essid = NULL; essid_len = 0; } spin_unlock_irqrestore(&wl->lock, irqflag); ret = gelic_wl_start_scan(wl, 0, essid, essid_len); if (ret == -ERESTARTSYS) { pr_debug("%s: scan start failed association\n", __func__); schedule_delayed_work(&wl->assoc_work, HZ/10); /*FIXME*/ Loading Loading @@ -2351,6 +2408,7 @@ static const iw_handler gelic_wl_wext_handler[] = IW_IOCTL(SIOCGIWNICKN) = gelic_wl_get_nick, }; #ifdef CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE static struct iw_priv_args gelic_wl_private_args[] = { { Loading @@ -2372,15 +2430,18 @@ static const iw_handler gelic_wl_private_handler[] = gelic_wl_priv_set_psk, gelic_wl_priv_get_psk, }; #endif static const struct iw_handler_def gelic_wl_wext_handler_def = { .num_standard = ARRAY_SIZE(gelic_wl_wext_handler), .standard = gelic_wl_wext_handler, .get_wireless_stats = gelic_wl_get_wireless_stats, #ifdef CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE .num_private = ARRAY_SIZE(gelic_wl_private_handler), .num_private_args = ARRAY_SIZE(gelic_wl_private_args), .private = gelic_wl_private_handler, .private_args = gelic_wl_private_args, #endif }; static struct net_device *gelic_wl_alloc(struct gelic_card *card) Loading Loading @@ -2446,16 +2507,9 @@ static struct net_device *gelic_wl_alloc(struct gelic_card *card) BUILD_BUG_ON(PAGE_SIZE < sizeof(struct gelic_eurus_scan_info) * GELIC_EURUS_MAX_SCAN); wl->buf = (void *)get_zeroed_page(GFP_KERNEL); if (!wl->buf) { pr_info("%s:buffer allocation failed\n", __func__); goto fail_getpage; } pr_debug("%s:end\n", __func__); return netdev; fail_getpage: destroy_workqueue(wl->event_queue); fail_event_workqueue: destroy_workqueue(wl->eurus_cmd_queue); fail_cmd_workqueue: Loading @@ -2474,8 +2528,6 @@ static void gelic_wl_free(struct gelic_wl_info *wl) pr_debug("%s: <-\n", __func__); free_page((unsigned long)wl->buf); pr_debug("%s: destroy queues\n", __func__); destroy_workqueue(wl->eurus_cmd_queue); destroy_workqueue(wl->event_queue); Loading
drivers/net/ps3_gelic_wireless.h +0 −3 Original line number Diff line number Diff line Loading @@ -288,9 +288,6 @@ struct gelic_wl_info { u8 active_bssid[ETH_ALEN]; /* associated bssid */ unsigned int essid_len; /* buffer for hypervisor IO */ void *buf; struct iw_public_data wireless_data; struct iw_statistics iwstat; }; Loading
drivers/net/wireless/adm8211.c +16 −19 Original line number Diff line number Diff line Loading @@ -324,7 +324,7 @@ static void adm8211_interrupt_tci(struct ieee80211_hw *dev) for (dirty_tx = priv->dirty_tx; priv->cur_tx - dirty_tx; dirty_tx++) { unsigned int entry = dirty_tx % priv->tx_ring_size; u32 status = le32_to_cpu(priv->tx_ring[entry].status); struct ieee80211_tx_status tx_status; struct ieee80211_tx_info *txi; struct adm8211_tx_ring_info *info; struct sk_buff *skb; Loading @@ -334,24 +334,23 @@ static void adm8211_interrupt_tci(struct ieee80211_hw *dev) info = &priv->tx_buffers[entry]; skb = info->skb; txi = IEEE80211_SKB_CB(skb); /* TODO: check TDES0_STATUS_TUF and TDES0_STATUS_TRO */ pci_unmap_single(priv->pdev, info->mapping, info->skb->len, PCI_DMA_TODEVICE); memset(&tx_status, 0, sizeof(tx_status)); memset(&txi->status, 0, sizeof(txi->status)); skb_pull(skb, sizeof(struct adm8211_tx_hdr)); memcpy(skb_push(skb, info->hdrlen), skb->cb, info->hdrlen); memcpy(&tx_status.control, &info->tx_control, sizeof(tx_status.control)); if (!(tx_status.control.flags & IEEE80211_TXCTL_NO_ACK)) { if (!(txi->flags & IEEE80211_TX_CTL_NO_ACK)) { if (status & TDES0_STATUS_ES) tx_status.excessive_retries = 1; txi->status.excessive_retries = 1; else tx_status.flags |= IEEE80211_TX_STATUS_ACK; txi->flags |= IEEE80211_TX_STAT_ACK; } ieee80211_tx_status_irqsafe(dev, skb, &tx_status); ieee80211_tx_status_irqsafe(dev, skb); info->skb = NULL; } Loading Loading @@ -1638,7 +1637,6 @@ static void adm8211_calc_durations(int *dur, int *plcp, size_t payload_len, int /* Transmit skb w/adm8211_tx_hdr (802.11 header created by hardware) */ static void adm8211_tx_raw(struct ieee80211_hw *dev, struct sk_buff *skb, u16 plcp_signal, struct ieee80211_tx_control *control, size_t hdrlen) { struct adm8211_priv *priv = dev->priv; Loading @@ -1664,7 +1662,6 @@ static void adm8211_tx_raw(struct ieee80211_hw *dev, struct sk_buff *skb, priv->tx_buffers[entry].skb = skb; priv->tx_buffers[entry].mapping = mapping; memcpy(&priv->tx_buffers[entry].tx_control, control, sizeof(*control)); priv->tx_buffers[entry].hdrlen = hdrlen; priv->tx_ring[entry].buffer1 = cpu_to_le32(mapping); Loading @@ -1685,18 +1682,18 @@ static void adm8211_tx_raw(struct ieee80211_hw *dev, struct sk_buff *skb, } /* Put adm8211_tx_hdr on skb and transmit */ static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb, struct ieee80211_tx_control *control) static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb) { struct adm8211_tx_hdr *txhdr; u16 fc; size_t payload_len, hdrlen; int plcp, dur, len, plcp_signal, short_preamble; struct ieee80211_hdr *hdr; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_rate *txrate = ieee80211_get_tx_rate(dev, info); short_preamble = !!(control->tx_rate->flags & IEEE80211_TXCTL_SHORT_PREAMBLE); plcp_signal = control->tx_rate->bitrate; short_preamble = !!(txrate->flags & IEEE80211_TX_CTL_SHORT_PREAMBLE); plcp_signal = txrate->bitrate; hdr = (struct ieee80211_hdr *)skb->data; fc = le16_to_cpu(hdr->frame_control) & ~IEEE80211_FCTL_PROTECTED; Loading Loading @@ -1730,15 +1727,15 @@ static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb, if (short_preamble) txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_SHORT_PREAMBLE); if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_ENABLE_RTS); if (fc & IEEE80211_FCTL_PROTECTED) txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_ENABLE_WEP_ENGINE); txhdr->retry_limit = control->retry_limit; txhdr->retry_limit = info->control.retry_limit; adm8211_tx_raw(dev, skb, plcp_signal, control, hdrlen); adm8211_tx_raw(dev, skb, plcp_signal, hdrlen); return NETDEV_TX_OK; } Loading Loading @@ -2015,7 +2012,7 @@ static int adm8211_resume(struct pci_dev *pdev) if (priv->mode != IEEE80211_IF_TYPE_INVALID) { adm8211_start(dev); ieee80211_start_queues(dev); ieee80211_wake_queues(dev); } return 0; Loading
drivers/net/wireless/adm8211.h +0 −1 Original line number Diff line number Diff line Loading @@ -443,7 +443,6 @@ struct adm8211_rx_ring_info { struct adm8211_tx_ring_info { struct sk_buff *skb; dma_addr_t mapping; struct ieee80211_tx_control tx_control; size_t hdrlen; }; Loading