From 6a986ce45d45b099ddf676c340267765e76db91e Mon Sep 17 00:00:00 2001 From: Eric Sesterhenn Date: Fri, 20 Jan 2006 23:30:01 +0300 Subject: [PATCH] bonding: fix ->get_settings error checking Since get_settings() returns a signed int and it gets checked for < 0 to catch an error, res should be a signed int too. Signed-off-by: Eric Sesterhenn Signed-off-by: Alexey Dobriyan Signed-off-by: Jeff Garzik diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 2582d98..4ff006c 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -576,7 +576,7 @@ static int bond_update_speed_duplex(struct slave *slave) slave->duplex = DUPLEX_FULL; if (slave_dev->ethtool_ops) { - u32 res; + int res; if (!slave_dev->ethtool_ops->get_settings) { return -1; -- cgit v0.10.2 From 6f9d47220eb2d1b17a0a3ecaf1b564ff95b8393d Mon Sep 17 00:00:00 2001 From: Eric Sesterhenn Date: Fri, 20 Jan 2006 23:32:56 +0300 Subject: [PATCH] acenic: fix checking of read_eeprom_byte() return values tmp in ace_init is u32 thus rendering read_eeprom_byte() return values checks useless. Signed-off-by: Eric Sesterhenn Signed-off-by: Alexey Dobriyan Signed-off-by: Jeff Garzik diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c index b8953de..b508812 100644 --- a/drivers/net/acenic.c +++ b/drivers/net/acenic.c @@ -1002,6 +1002,8 @@ static int __devinit ace_init(struct net_device *dev) mac1 = 0; for(i = 0; i < 4; i++) { + int tmp; + mac1 = mac1 << 8; tmp = read_eeprom_byte(dev, 0x8c+i); if (tmp < 0) { @@ -1012,6 +1014,8 @@ static int __devinit ace_init(struct net_device *dev) } mac2 = 0; for(i = 4; i < 8; i++) { + int tmp; + mac2 = mac2 << 8; tmp = read_eeprom_byte(dev, 0x8c+i); if (tmp < 0) { -- cgit v0.10.2 From c35ca399e09828f3f6b40c0007a95a6582d90347 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 20 Jan 2006 21:13:17 -0800 Subject: [PATCH] b44: fix laptop carrier detect On my laptop, the b44 device is created and the carrier state defaults to ON when created by alloc_etherdev. This means tools like NetworkManager see the carrier as On and try and bring the device up. The correct thing to do is mark the carrier as Off when device is created. Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik diff --git a/drivers/net/b44.c b/drivers/net/b44.c index df9d6e8..c3267e4 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c @@ -1399,7 +1399,6 @@ static int b44_open(struct net_device *dev) b44_init_rings(bp); b44_init_hw(bp); - netif_carrier_off(dev); b44_check_phy(bp); err = request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev); @@ -1464,7 +1463,7 @@ static int b44_close(struct net_device *dev) #endif b44_halt(bp); b44_free_rings(bp); - netif_carrier_off(bp->dev); + netif_carrier_off(dev); spin_unlock_irq(&bp->lock); @@ -2000,6 +1999,8 @@ static int __devinit b44_init_one(struct pci_dev *pdev, dev->irq = pdev->irq; SET_ETHTOOL_OPS(dev, &b44_ethtool_ops); + netif_carrier_off(dev); + err = b44_get_invariants(bp); if (err) { printk(KERN_ERR PFX "Problem fetching invariants of chip, " -- cgit v0.10.2 From efd51b5c6798d103e3aa683464aebb2019b62119 Mon Sep 17 00:00:00 2001 From: Ananda Raju Date: Thu, 19 Jan 2006 14:11:54 -0500 Subject: [PATCH] s2io: scatter-gather fix There is a problem with fragmented skb in s2io driver version 2.0.9.4 available in 2.6.16-rc1 kernel. The adapter will fail to transmit if any scatter-gather skb arrives. This patch provides fix for the above described problem. Signed-off-by: Ananda Raju Signed-off-by: Jeff Garzik diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 89c4678..49b597c 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c @@ -3586,7 +3586,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) txdp->Buffer_Pointer = (u64) pci_map_page (sp->pdev, frag->page, frag->page_offset, frag->size, PCI_DMA_TODEVICE); - txdp->Control_1 |= TXD_BUFFER0_SIZE(frag->size); + txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size); if (skb_shinfo(skb)->ufo_size) txdp->Control_1 |= TXD_UFO_EN; } -- cgit v0.10.2 From c7cd9014e6ea620bf9e1b52a22fadd7618b53276 Mon Sep 17 00:00:00 2001 From: Dale Farnsworth Date: Fri, 27 Jan 2006 01:02:05 -0700 Subject: [PATCH] mv643xx_eth: Fix spinlock recursion bug This patch eliminates a spinlock recursion bug introduced recently. Since eth_port_send() is always called with the lock held, we simply remove the locking inside the function itself. Signed-off-by: Dale Farnsworth Signed-off-by: Jeff Garzik diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 40ae36b..9eeb8db 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c @@ -2617,7 +2617,6 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp, struct eth_tx_desc *current_descriptor; struct eth_tx_desc *first_descriptor; u32 command; - unsigned long flags; /* Do not process Tx ring in case of Tx ring resource error */ if (mp->tx_resource_err) @@ -2634,8 +2633,6 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp, return ETH_ERROR; } - spin_lock_irqsave(&mp->lock, flags); - mp->tx_ring_skbs++; BUG_ON(mp->tx_ring_skbs > mp->tx_ring_size); @@ -2685,15 +2682,11 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp, mp->tx_resource_err = 1; mp->tx_curr_desc_q = tx_first_desc; - spin_unlock_irqrestore(&mp->lock, flags); - return ETH_QUEUE_LAST_RESOURCE; } mp->tx_curr_desc_q = tx_next_desc; - spin_unlock_irqrestore(&mp->lock, flags); - return ETH_OK; } #else @@ -2704,14 +2697,11 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp, int tx_desc_used; struct eth_tx_desc *current_descriptor; unsigned int command_status; - unsigned long flags; /* Do not process Tx ring in case of Tx ring resource error */ if (mp->tx_resource_err) return ETH_QUEUE_FULL; - spin_lock_irqsave(&mp->lock, flags); - mp->tx_ring_skbs++; BUG_ON(mp->tx_ring_skbs > mp->tx_ring_size); @@ -2742,12 +2732,9 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp, /* Check for ring index overlap in the Tx desc ring */ if (tx_desc_curr == tx_desc_used) { mp->tx_resource_err = 1; - - spin_unlock_irqrestore(&mp->lock, flags); return ETH_QUEUE_LAST_RESOURCE; } - spin_unlock_irqrestore(&mp->lock, flags); return ETH_OK; } #endif -- cgit v0.10.2 From 12ad74f88f6a2276901d416f7533f0a115ba6a15 Mon Sep 17 00:00:00 2001 From: Paolo Galtieri Date: Fri, 27 Jan 2006 01:03:38 -0700 Subject: [PATCH] mv643xx_eth: Update dev->last_rx on packet receive Update dev->last_rx on packet receive This fix corrects errors seen during configuration of the bonding driver. Signed-off-by: Paolo Galtieri Signed-off-by: Dale Farnsworth Signed-off-by: Jeff Garzik diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 9eeb8db..f1e708a 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c @@ -444,6 +444,7 @@ static int mv643xx_eth_receive_queue(struct net_device *dev) netif_rx(skb); #endif } + dev->last_rx = jiffies; } return received_packets; -- cgit v0.10.2 From b4de9051a98543f121d8dfbf32dd9d5999fb3896 Mon Sep 17 00:00:00 2001 From: Dale Farnsworth Date: Fri, 27 Jan 2006 01:04:43 -0700 Subject: [PATCH] mv643xx_eth: Whitespace cleanup Signed-off-by: Dale Farnsworth Signed-off-by: Jeff Garzik diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index f1e708a..7ef4b04 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c @@ -462,7 +462,7 @@ static int mv643xx_eth_receive_queue(struct net_device *dev) */ static irqreturn_t mv643xx_eth_int_handler(int irq, void *dev_id, - struct pt_regs *regs) + struct pt_regs *regs) { struct net_device *dev = (struct net_device *)dev_id; struct mv643xx_private *mp = netdev_priv(dev); @@ -1048,16 +1048,15 @@ static int mv643xx_poll(struct net_device *dev, int *budget) static inline unsigned int has_tiny_unaligned_frags(struct sk_buff *skb) { - unsigned int frag; - skb_frag_t *fragp; + unsigned int frag; + skb_frag_t *fragp; - for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) { - fragp = &skb_shinfo(skb)->frags[frag]; - if (fragp->size <= 8 && fragp->page_offset & 0x7) - return 1; - - } - return 0; + for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) { + fragp = &skb_shinfo(skb)->frags[frag]; + if (fragp->size <= 8 && fragp->page_offset & 0x7) + return 1; + } + return 0; } @@ -2138,26 +2137,26 @@ static void eth_port_set_multicast_list(struct net_device *dev) */ if ((dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI)) { for (table_index = 0; table_index <= 0xFC; table_index += 4) { - /* Set all entries in DA filter special multicast - * table (Ex_dFSMT) - * Set for ETH_Q0 for now - * Bits - * 0 Accept=1, Drop=0 - * 3-1 Queue ETH_Q0=0 - * 7-4 Reserved = 0; - */ - mv_write(MV643XX_ETH_DA_FILTER_SPECIAL_MULTICAST_TABLE_BASE(eth_port_num) + table_index, 0x01010101); - - /* Set all entries in DA filter other multicast - * table (Ex_dFOMT) - * Set for ETH_Q0 for now - * Bits - * 0 Accept=1, Drop=0 - * 3-1 Queue ETH_Q0=0 - * 7-4 Reserved = 0; - */ - mv_write(MV643XX_ETH_DA_FILTER_OTHER_MULTICAST_TABLE_BASE(eth_port_num) + table_index, 0x01010101); - } + /* Set all entries in DA filter special multicast + * table (Ex_dFSMT) + * Set for ETH_Q0 for now + * Bits + * 0 Accept=1, Drop=0 + * 3-1 Queue ETH_Q0=0 + * 7-4 Reserved = 0; + */ + mv_write(MV643XX_ETH_DA_FILTER_SPECIAL_MULTICAST_TABLE_BASE(eth_port_num) + table_index, 0x01010101); + + /* Set all entries in DA filter other multicast + * table (Ex_dFOMT) + * Set for ETH_Q0 for now + * Bits + * 0 Accept=1, Drop=0 + * 3-1 Queue ETH_Q0=0 + * 7-4 Reserved = 0; + */ + mv_write(MV643XX_ETH_DA_FILTER_OTHER_MULTICAST_TABLE_BASE(eth_port_num) + table_index, 0x01010101); + } return; } @@ -2886,8 +2885,10 @@ static ETH_FUNC_RET_STATUS eth_port_receive(struct mv643xx_private *mp, p_pkt_info->return_info = mp->rx_skb[rx_curr_desc]; p_pkt_info->l4i_chk = p_rx_desc->buf_size; - /* Clean the return info field to indicate that the packet has been */ - /* moved to the upper layers */ + /* + * Clean the return info field to indicate that the + * packet has been moved to the upper layers + */ mp->rx_skb[rx_curr_desc] = NULL; /* Update current index in data structure */ @@ -2968,7 +2969,7 @@ struct mv643xx_stats { }; #define MV643XX_STAT(m) sizeof(((struct mv643xx_private *)0)->m), \ - offsetof(struct mv643xx_private, m) + offsetof(struct mv643xx_private, m) static const struct mv643xx_stats mv643xx_gstrings_stats[] = { { "rx_packets", MV643XX_STAT(stats.rx_packets) }, @@ -3119,9 +3120,8 @@ mv643xx_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) return 0; } -static void -mv643xx_get_drvinfo(struct net_device *netdev, - struct ethtool_drvinfo *drvinfo) +static void mv643xx_get_drvinfo(struct net_device *netdev, + struct ethtool_drvinfo *drvinfo) { strncpy(drvinfo->driver, mv643xx_driver_name, 32); strncpy(drvinfo->version, mv643xx_driver_version, 32); @@ -3130,39 +3130,37 @@ mv643xx_get_drvinfo(struct net_device *netdev, drvinfo->n_stats = MV643XX_STATS_LEN; } -static int -mv643xx_get_stats_count(struct net_device *netdev) +static int mv643xx_get_stats_count(struct net_device *netdev) { return MV643XX_STATS_LEN; } -static void -mv643xx_get_ethtool_stats(struct net_device *netdev, - struct ethtool_stats *stats, uint64_t *data) +static void mv643xx_get_ethtool_stats(struct net_device *netdev, + struct ethtool_stats *stats, uint64_t *data) { struct mv643xx_private *mp = netdev->priv; int i; eth_update_mib_counters(mp); - for(i = 0; i < MV643XX_STATS_LEN; i++) { + for (i = 0; i < MV643XX_STATS_LEN; i++) { char *p = (char *)mp+mv643xx_gstrings_stats[i].stat_offset; - data[i] = (mv643xx_gstrings_stats[i].sizeof_stat == + data[i] = (mv643xx_gstrings_stats[i].sizeof_stat == sizeof(uint64_t)) ? *(uint64_t *)p : *(uint32_t *)p; } } -static void -mv643xx_get_strings(struct net_device *netdev, uint32_t stringset, uint8_t *data) +static void mv643xx_get_strings(struct net_device *netdev, uint32_t stringset, + uint8_t *data) { int i; switch(stringset) { case ETH_SS_STATS: for (i=0; i < MV643XX_STATS_LEN; i++) { - memcpy(data + i * ETH_GSTRING_LEN, - mv643xx_gstrings_stats[i].stat_string, - ETH_GSTRING_LEN); + memcpy(data + i * ETH_GSTRING_LEN, + mv643xx_gstrings_stats[i].stat_string, + ETH_GSTRING_LEN); } break; } -- cgit v0.10.2 From 6651a5c3839517685c601e44979f19de8b6249c3 Mon Sep 17 00:00:00 2001 From: Dale Farnsworth Date: Fri, 27 Jan 2006 01:05:51 -0700 Subject: [PATCH] mv643xx_eth: Fix for building as a module Enable mv643xx_eth driver to work when built as a module on mv64x60-based embedded systems. Signed-off-by: Dale Farnsworth Signed-off-by: Jeff Garzik diff --git a/arch/ppc/syslib/mv64x60.c b/arch/ppc/syslib/mv64x60.c index 94ea346..1f01b7e 100644 --- a/arch/ppc/syslib/mv64x60.c +++ b/arch/ppc/syslib/mv64x60.c @@ -313,7 +313,7 @@ static struct platform_device mpsc1_device = { }; #endif -#ifdef CONFIG_MV643XX_ETH +#if defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE) static struct resource mv64x60_eth_shared_resources[] = { [0] = { .name = "ethernet shared base", @@ -456,7 +456,7 @@ static struct platform_device *mv64x60_pd_devs[] __initdata = { &mpsc0_device, &mpsc1_device, #endif -#ifdef CONFIG_MV643XX_ETH +#if defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE) &mv64x60_eth_shared_device, #endif #ifdef CONFIG_MV643XX_ETH_0 -- cgit v0.10.2 From 4f95af5bb546a9e7f46ed10f5e0dbe1e42a77884 Mon Sep 17 00:00:00 2001 From: "Valdis.Kletnieks@vt.edu" Date: Thu, 19 Jan 2006 02:07:47 -0500 Subject: [PATCH] orinoco_cs: tweak Vcc debugging messages The current orinoco_cs.c can issue the exact same error message for 2 different tests that can fail. Alter them so we can tell which one of the two failed. Signed-off-by: Valdis Kletnieks Signed-off-by: John W. Linville diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c index b664708..3c128b6 100644 --- a/drivers/net/wireless/orinoco_cs.c +++ b/drivers/net/wireless/orinoco_cs.c @@ -261,13 +261,13 @@ orinoco_cs_config(dev_link_t *link) /* Note that the CIS values need to be rescaled */ if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { if (conf.Vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) { - DEBUG(2, "orinoco_cs_config: Vcc mismatch (conf.Vcc = %d, CIS = %d)\n", conf.Vcc, cfg->vcc.param[CISTPL_POWER_VNOM] / 10000); + DEBUG(2, "orinoco_cs_config: Vcc mismatch (conf.Vcc = %d, cfg CIS = %d)\n", conf.Vcc, cfg->vcc.param[CISTPL_POWER_VNOM] / 10000); if (!ignore_cis_vcc) goto next_entry; } } else if (dflt.vcc.present & (1 << CISTPL_POWER_VNOM)) { if (conf.Vcc != dflt.vcc.param[CISTPL_POWER_VNOM] / 10000) { - DEBUG(2, "orinoco_cs_config: Vcc mismatch (conf.Vcc = %d, CIS = %d)\n", conf.Vcc, dflt.vcc.param[CISTPL_POWER_VNOM] / 10000); + DEBUG(2, "orinoco_cs_config: Vcc mismatch (conf.Vcc = %d, dflt CIS = %d)\n", conf.Vcc, dflt.vcc.param[CISTPL_POWER_VNOM] / 10000); if(!ignore_cis_vcc) goto next_entry; } -- cgit v0.10.2 From b6daa25d653f23252b340cbd7d2153d0b338e44c Mon Sep 17 00:00:00 2001 From: Zhu Yi Date: Thu, 19 Jan 2006 16:20:42 +0800 Subject: [PATCH] ieee80211: Fix problem with not decrypting broadcast packets The code for pulling the key to use for decrypt was correctly using the host_mc_decrypt flag. The code that actually decrypted, however, was based on host_decrypt. This patch changes this behavior. Signed-off-by: Etay Bogner Signed-off-by: James Ketrenos Signed-off-by: Zhu Yi Signed-off-by: John W. Linville diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c index 7a12180..695d047 100644 --- a/net/ieee80211/ieee80211_rx.c +++ b/net/ieee80211/ieee80211_rx.c @@ -350,6 +350,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, u8 src[ETH_ALEN]; struct ieee80211_crypt_data *crypt = NULL; int keyidx = 0; + int can_be_decrypted = 0; hdr = (struct ieee80211_hdr_4addr *)skb->data; stats = &ieee->stats; @@ -410,12 +411,23 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, return 1; } - if (is_multicast_ether_addr(hdr->addr1) - ? ieee->host_mc_decrypt : ieee->host_decrypt) { + can_be_decrypted = (is_multicast_ether_addr(hdr->addr1) || + is_broadcast_ether_addr(hdr->addr2)) ? + ieee->host_mc_decrypt : ieee->host_decrypt; + + if (can_be_decrypted) { int idx = 0; - if (skb->len >= hdrlen + 3) + if (skb->len >= hdrlen + 3) { + /* Top two-bits of byte 3 are the key index */ idx = skb->data[hdrlen + 3] >> 6; + } + + /* ieee->crypt[] is WEP_KEY (4) in length. Given that idx + * is only allowed 2-bits of storage, no value of idx can + * be provided via above code that would result in idx + * being out of range */ crypt = ieee->crypt[idx]; + #ifdef NOT_YET sta = NULL; @@ -553,7 +565,7 @@ 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_PROTECTED) && + if ((fc & IEEE80211_FCTL_PROTECTED) && can_be_decrypted && (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0) goto rx_dropped; @@ -617,7 +629,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, /* skb: hdr + (possible reassembled) full MSDU payload; possibly still * encrypted/authenticated */ - if (ieee->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) && + if ((fc & IEEE80211_FCTL_PROTECTED) && can_be_decrypted && ieee80211_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt)) goto rx_dropped; -- cgit v0.10.2 From 55cd94aa1df8e575ab3236641d29d63ecdde5012 Mon Sep 17 00:00:00 2001 From: Zhu Yi Date: Thu, 19 Jan 2006 16:20:59 +0800 Subject: [PATCH] ieee80211: Fix iwlist scan can only show about 20 APs Limit the amount of output given to iwlist scan. Signed-off-by: Hong Liu Signed-off-by: Zhu Yi Signed-off-by: John W. Linville diff --git a/net/ieee80211/ieee80211_wx.c b/net/ieee80211/ieee80211_wx.c index 23e1630..f87c6b8 100644 --- a/net/ieee80211/ieee80211_wx.c +++ b/net/ieee80211/ieee80211_wx.c @@ -232,15 +232,18 @@ static char *ipw2100_translate_scan(struct ieee80211_device *ieee, return start; } +#define SCAN_ITEM_SIZE 128 + int ieee80211_wx_get_scan(struct ieee80211_device *ieee, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { struct ieee80211_network *network; unsigned long flags; + int err = 0; char *ev = extra; - char *stop = ev + IW_SCAN_MAX_DATA; + char *stop = ev + wrqu->data.length; int i = 0; IEEE80211_DEBUG_WX("Getting scan\n"); @@ -249,6 +252,11 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee, list_for_each_entry(network, &ieee->network_list, list) { i++; + if (stop - ev < SCAN_ITEM_SIZE) { + err = -E2BIG; + break; + } + if (ieee->scan_age == 0 || time_after(network->last_scanned + ieee->scan_age, jiffies)) ev = ipw2100_translate_scan(ieee, ev, stop, network); @@ -270,7 +278,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee, IEEE80211_DEBUG_WX("exit: %d networks returned.\n", i); - return 0; + return err; } int ieee80211_wx_set_encode(struct ieee80211_device *ieee, -- cgit v0.10.2 From 4a99ac3a9ee7e1b90ebc3ddbb44db75eef5c41e6 Mon Sep 17 00:00:00 2001 From: Zhu Yi Date: Thu, 19 Jan 2006 16:21:19 +0800 Subject: [PATCH] ieee80211: Fix A band min and max channel definitions Signed-off-by: Hong Liu Signed-off-by: Zhu Yi Signed-off-by: John W. Linville diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index df05f46..9a92aef 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h @@ -803,9 +803,9 @@ enum ieee80211_state { #define IEEE80211_24GHZ_MAX_CHANNEL 14 #define IEEE80211_24GHZ_CHANNELS 14 -#define IEEE80211_52GHZ_MIN_CHANNEL 36 +#define IEEE80211_52GHZ_MIN_CHANNEL 34 #define IEEE80211_52GHZ_MAX_CHANNEL 165 -#define IEEE80211_52GHZ_CHANNELS 32 +#define IEEE80211_52GHZ_CHANNELS 131 enum { IEEE80211_CH_PASSIVE_ONLY = (1 << 0), -- cgit v0.10.2 From 3c5eca542d19cd50e9a028dc32897cd698dcc33e Mon Sep 17 00:00:00 2001 From: Zhu Yi Date: Tue, 24 Jan 2006 13:49:26 +0800 Subject: [PATCH] ipw2100: Fix a gcc compile warning drivers/net/wireless/ipw2100.c:2236: warning: `ipw2100_match_buf' defined but not used Cc: Yi Zhu Cc: James Ketrenos Cc: Jeff Garzik Signed-off-by: Andrew Morton Signed-off-by: Zhu Yi Signed-off-by: John W. Linville diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 8bf0276..027352a 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c @@ -2201,6 +2201,17 @@ static int ipw2100_alloc_skb(struct ipw2100_priv *priv, #define SEARCH_SNAPSHOT 1 #define SNAPSHOT_ADDR(ofs) (priv->snapshot[((ofs) >> 12) & 0xff] + ((ofs) & 0xfff)) +static void ipw2100_snapshot_free(struct ipw2100_priv *priv) +{ + int i; + if (!priv->snapshot[0]) + return; + for (i = 0; i < 0x30; i++) + kfree(priv->snapshot[i]); + priv->snapshot[0] = NULL; +} + +#ifdef CONFIG_IPW2100_DEBUG_C3 static int ipw2100_snapshot_alloc(struct ipw2100_priv *priv) { int i; @@ -2221,16 +2232,6 @@ static int ipw2100_snapshot_alloc(struct ipw2100_priv *priv) return 1; } -static void ipw2100_snapshot_free(struct ipw2100_priv *priv) -{ - int i; - if (!priv->snapshot[0]) - return; - for (i = 0; i < 0x30; i++) - kfree(priv->snapshot[i]); - priv->snapshot[0] = NULL; -} - static u32 ipw2100_match_buf(struct ipw2100_priv *priv, u8 * in_buf, size_t len, int mode) { @@ -2269,6 +2270,7 @@ static u32 ipw2100_match_buf(struct ipw2100_priv *priv, u8 * in_buf, return ret; } +#endif /* * -- cgit v0.10.2 From b6e4da72342cb075a2742c79e693c8edc1d55389 Mon Sep 17 00:00:00 2001 From: Zhu Yi Date: Tue, 24 Jan 2006 13:49:32 +0800 Subject: [PATCH] ipw2100: Fix setting txpower failed problem The ipw2100 driver misunderstood the parameter of txpower. Tx Power off means turn off the radio, but the driver interpret it as "can't set txpower". So when getting the txpower, it sets disabled=1 to the iwconifg tool in managed mode. And the tool will display "Tx Power off" when disabled=1. Now, in managed mode, iwconfig will not show "TX Power" if the radio is not switched off. It will only display "Tx Power off" only if the radio is killed. Signed-off-by: Hong Liu Signed-off-by: Zhu Yi Signed-off-by: John W. Linville diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 027352a..6290c9f 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c @@ -7114,11 +7114,17 @@ static int ipw2100_wx_set_txpow(struct net_device *dev, { struct ipw2100_priv *priv = ieee80211_priv(dev); int err = 0, value; + + if (ipw_radio_kill_sw(priv, wrqu->txpower.disabled)) + return -EINPROGRESS; if (priv->ieee->iw_mode != IW_MODE_ADHOC) + return 0; + + if ((wrqu->txpower.flags & IW_TXPOW_TYPE) != IW_TXPOW_DBM) return -EINVAL; - if (wrqu->txpower.disabled == 1 || wrqu->txpower.fixed == 0) + if (wrqu->txpower.fixed == 0) value = IPW_TX_POWER_DEFAULT; else { if (wrqu->txpower.value < IPW_TX_POWER_MIN_DBM || @@ -7153,24 +7159,19 @@ static int ipw2100_wx_get_txpow(struct net_device *dev, struct ipw2100_priv *priv = ieee80211_priv(dev); - if (priv->ieee->iw_mode != IW_MODE_ADHOC) { - wrqu->power.disabled = 1; - return 0; - } + wrqu->txpower.disabled = (priv->status & STATUS_RF_KILL_MASK) ? 1 : 0; if (priv->tx_power == IPW_TX_POWER_DEFAULT) { - wrqu->power.fixed = 0; - wrqu->power.value = IPW_TX_POWER_MAX_DBM; - wrqu->power.disabled = 1; + wrqu->txpower.fixed = 0; + wrqu->txpower.value = IPW_TX_POWER_MAX_DBM; } else { - wrqu->power.disabled = 0; - wrqu->power.fixed = 1; - wrqu->power.value = priv->tx_power; + wrqu->txpower.fixed = 1; + wrqu->txpower.value = priv->tx_power; } - wrqu->power.flags = IW_TXPOW_DBM; + wrqu->txpower.flags = IW_TXPOW_DBM; - IPW_DEBUG_WX("GET TX Power -> %d \n", wrqu->power.value); + IPW_DEBUG_WX("GET TX Power -> %d \n", wrqu->txpower.value); return 0; } -- cgit v0.10.2 From f73cb83f1ace1a4bd3c57ae33f5c6c8bac9c0946 Mon Sep 17 00:00:00 2001 From: Zhu Yi Date: Tue, 24 Jan 2006 16:36:22 +0800 Subject: [PATCH] ipw2200: Fix "iwspy ethx off" causes kernel panic Signed-off-by: Hong Liu Signed-off-by: Zhu Yi Signed-off-by: John W. Linville diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index 4c28e33..877fdaf 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c @@ -11035,7 +11035,6 @@ static int ipw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) net_dev->set_multicast_list = ipw_net_set_multicast_list; net_dev->set_mac_address = ipw_net_set_mac_address; priv->wireless_data.spy_data = &priv->ieee->spy_data; - priv->wireless_data.ieee80211 = priv->ieee; net_dev->wireless_data = &priv->wireless_data; net_dev->wireless_handlers = &ipw_wx_handler_def; net_dev->ethtool_ops = &ipw_ethtool_ops; -- cgit v0.10.2 From 17ed081deed479702ee4896f6de40aa32ecd6644 Mon Sep 17 00:00:00 2001 From: Zhu Yi Date: Tue, 24 Jan 2006 16:36:31 +0800 Subject: [PATCH] ipw2200: Fix sw_reset doesn't clear the static essid problem Signed-off-by: Zhu Yi Signed-off-by: John W. Linville diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index 877fdaf..bc18bcb 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c @@ -8012,6 +8012,10 @@ static int ipw_sw_reset(struct ipw_priv *priv, int init) else IPW_DEBUG_INFO("Auto adhoc creation disabled.\n"); + priv->config &= ~CFG_STATIC_ESSID; + priv->essid_len = 0; + memset(priv->essid, 0, IW_ESSID_MAX_SIZE); + if (disable) { priv->status |= STATUS_RF_KILL_SW; IPW_DEBUG_INFO("Radio disabled.\n"); -- cgit v0.10.2 From 489f4458cd98592d0bc527d4a5ac1c1393aaf254 Mon Sep 17 00:00:00 2001 From: Zhu Yi Date: Tue, 24 Jan 2006 16:37:41 +0800 Subject: [PATCH] ipw2200: Fix a variable referenced after kfree() bug Signed-off-by: Zhu Yi Signed-off-by: John W. Linville diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index bc18bcb..916b24c 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c @@ -11124,8 +11124,8 @@ static void ipw_pci_remove(struct pci_dev *pdev) /* Free MAC hash list for ADHOC */ for (i = 0; i < IPW_IBSS_MAC_HASH_SIZE; i++) { list_for_each_safe(p, q, &priv->ibss_mac_hash[i]) { - kfree(list_entry(p, struct ipw_ibss_seq, list)); list_del(p); + kfree(list_entry(p, struct ipw_ibss_seq, list)); } } -- cgit v0.10.2 From 1a1fedf4d3e27c920b8de92a429011fb11c89028 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Mon, 30 Jan 2006 09:42:24 -0600 Subject: [PATCH] Typo corrections for ieee80211 This patch, generated against 2.6.16-rc1-git4, corrects two typographical errors in ieee80211_rx.c and adds the facility name to a bare printk. Signed-Off-By: Larry Finger Signed-off-by: John W. Linville diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c index 695d047..960aa78 100644 --- a/net/ieee80211/ieee80211_rx.c +++ b/net/ieee80211/ieee80211_rx.c @@ -1451,7 +1451,7 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee, break; case IEEE80211_STYPE_PROBE_REQ: - IEEE80211_DEBUG_MGMT("recieved auth (%d)\n", + IEEE80211_DEBUG_MGMT("received auth (%d)\n", WLAN_FC_GET_STYPE(le16_to_cpu (header->frame_ctl))); @@ -1485,7 +1485,7 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee, break; case IEEE80211_STYPE_AUTH: - IEEE80211_DEBUG_MGMT("recieved auth (%d)\n", + IEEE80211_DEBUG_MGMT("received auth (%d)\n", WLAN_FC_GET_STYPE(le16_to_cpu (header->frame_ctl))); -- cgit v0.10.2 From ae7ec20582de0867abda66ad06d468ce12b231f2 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 30 Jan 2006 19:23:17 +0100 Subject: [PATCH] PCMCIA=m, HOSTAP_CS=y is not a legal configuration CONFIG_PCMCIA=m, CONFIG_HOSTAP_CS=y doesn't compile. Reported by "Gabriel C." . Signed-off-by: Adrian Bunk Signed-off-by: John W. Linville diff --git a/drivers/net/wireless/hostap/Kconfig b/drivers/net/wireless/hostap/Kconfig index c8f6286..308f773 100644 --- a/drivers/net/wireless/hostap/Kconfig +++ b/drivers/net/wireless/hostap/Kconfig @@ -75,7 +75,7 @@ config HOSTAP_PCI config HOSTAP_CS tristate "Host AP driver for Prism2/2.5/3 PC Cards" - depends on PCMCIA!=n && HOSTAP + depends on PCMCIA && HOSTAP ---help--- Host AP driver's version for Prism2/2.5/3 PC Cards. -- cgit v0.10.2 From c6f0d75a2defe8c7d8bf9f78de891cedc46b4b3e Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Sat, 21 Jan 2006 19:35:34 +0000 Subject: [PATCH] Clarify help text of SKGE/SK98LIN/SKY2 Some users have commented that it is unclear which driver they should be using for their Marvell/SysKonnect network adapter, and which ones are/aren't interchangable. This patch attempts to reduce the confusion. Signed-off-by: Daniel Drake Signed-off-by: Jeff Garzik diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 626508a..6a6a084 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -2034,13 +2034,28 @@ config SKGE It does not support the link failover and network management features that "portable" vendor supplied sk98lin driver does. + This driver supports adapters based on the original Yukon chipset: + Marvell 88E8001, Belkin F5D5005, CNet GigaCard, DLink DGE-530T, + Linksys EG1032/EG1064, 3Com 3C940/3C940B, SysKonnect SK-9871/9872. + + It does not support the newer Yukon2 chipset: a separate driver, + sky2, is provided for Yukon2-based adapters. + + To compile this driver as a module, choose M here: the module + will be called skge. This is recommended. config SKY2 tristate "SysKonnect Yukon2 support (EXPERIMENTAL)" depends on PCI && EXPERIMENTAL select CRC32 ---help--- - This driver support the Marvell Yukon 2 Gigabit Ethernet adapter. + This driver supports Gigabit Ethernet adapters based on the the + Marvell Yukon 2 chipset: + Marvell 88E8021/88E8022/88E8035/88E8036/88E8038/88E8050/88E8052/ + 88E8053/88E8055/88E8061/88E8062, SysKonnect SK-9E21D/SK-9S21 + + This driver does not support the original Yukon chipset: a seperate + driver, skge, is provided for Yukon-based adapters. To compile this driver as a module, choose M here: the module will be called sky2. This is recommended. @@ -2050,8 +2065,15 @@ config SK98LIN depends on PCI ---help--- Say Y here if you have a Marvell Yukon or SysKonnect SK-98xx/SK-95xx - compliant Gigabit Ethernet Adapter. The following adapters are supported - by this driver: + compliant Gigabit Ethernet Adapter. + + This driver supports the original Yukon chipset. A cleaner driver is + also available (skge) which seems to work better than this one. + + This driver does not support the newer Yukon2 chipset. A seperate + driver, sky2, is provided to support Yukon2-based adapters. + + The following adapters are supported by this driver: - 3Com 3C940 Gigabit LOM Ethernet Adapter - 3Com 3C941 Gigabit LOM Ethernet Adapter - Allied Telesyn AT-2970LX Gigabit Ethernet Adapter -- cgit v0.10.2