Commit f55dfb3d authored by Jeff Garzik's avatar Jeff Garzik

Merge pobox.com:/spare/repo/netdev-2.6/misc

into pobox.com:/spare/repo/net-drivers-2.6
parents 394fdea7 71d5090c
...@@ -2007,6 +2007,11 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm) ...@@ -2007,6 +2007,11 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm)
int bd_flags, desc_type, mapsize; int bd_flags, desc_type, mapsize;
u16 csum; u16 csum;
/* make sure the rx descriptor isn't read before rxretprd */
if (idx == rxretcsm)
rmb();
retdesc = &ap->rx_return_ring[idx]; retdesc = &ap->rx_return_ring[idx];
skbidx = retdesc->idx; skbidx = retdesc->idx;
bd_flags = retdesc->flags; bd_flags = retdesc->flags;
......
...@@ -481,6 +481,7 @@ struct netdrv_private { ...@@ -481,6 +481,7 @@ struct netdrv_private {
unsigned int mediasense:1; /* Media sensing in progress. */ unsigned int mediasense:1; /* Media sensing in progress. */
spinlock_t lock; spinlock_t lock;
chip_t chipset; chip_t chipset;
u32 pci_state[16]; /* Data saved during suspend */
}; };
MODULE_AUTHOR ("Jeff Garzik <jgarzik@pobox.com>"); MODULE_AUTHOR ("Jeff Garzik <jgarzik@pobox.com>");
...@@ -488,12 +489,10 @@ MODULE_DESCRIPTION ("Skeleton for a PCI Fast Ethernet driver"); ...@@ -488,12 +489,10 @@ MODULE_DESCRIPTION ("Skeleton for a PCI Fast Ethernet driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_PARM (multicast_filter_limit, "i"); MODULE_PARM (multicast_filter_limit, "i");
MODULE_PARM (max_interrupt_work, "i"); MODULE_PARM (max_interrupt_work, "i");
MODULE_PARM (debug, "i");
MODULE_PARM (media, "1-" __MODULE_STRING(8) "i"); MODULE_PARM (media, "1-" __MODULE_STRING(8) "i");
MODULE_PARM_DESC (multicast_filter_limit, "pci-skeleton maximum number of filtered multicast addresses"); MODULE_PARM_DESC (multicast_filter_limit, "pci-skeleton maximum number of filtered multicast addresses");
MODULE_PARM_DESC (max_interrupt_work, "pci-skeleton maximum events handled per interrupt"); MODULE_PARM_DESC (max_interrupt_work, "pci-skeleton maximum events handled per interrupt");
MODULE_PARM_DESC (media, "pci-skeleton: Bits 0-3: media type, bit 17: full duplex"); MODULE_PARM_DESC (media, "pci-skeleton: Bits 0-3: media type, bit 17: full duplex");
MODULE_PARM_DESC (debug, "(unused)");
static int read_eeprom (void *ioaddr, int location, int addr_len); static int read_eeprom (void *ioaddr, int location, int addr_len);
static int netdrv_open (struct net_device *dev); static int netdrv_open (struct net_device *dev);
...@@ -588,7 +587,6 @@ static int __devinit netdrv_init_board (struct pci_dev *pdev, ...@@ -588,7 +587,6 @@ static int __devinit netdrv_init_board (struct pci_dev *pdev,
void *ioaddr = NULL; void *ioaddr = NULL;
struct net_device *dev; struct net_device *dev;
struct netdrv_private *tp; struct netdrv_private *tp;
u8 tmp8;
int rc, i; int rc, i;
u32 pio_start, pio_end, pio_flags, pio_len; u32 pio_start, pio_end, pio_flags, pio_len;
unsigned long mmio_start, mmio_end, mmio_flags, mmio_len; unsigned long mmio_start, mmio_end, mmio_flags, mmio_len;
...@@ -744,7 +742,6 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev, ...@@ -744,7 +742,6 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev,
int i, addr_len, option; int i, addr_len, option;
void *ioaddr = NULL; void *ioaddr = NULL;
static int board_idx = -1; static int board_idx = -1;
u8 tmp;
/* when built into the kernel, we only print version if device is found */ /* when built into the kernel, we only print version if device is found */
#ifndef MODULE #ifndef MODULE
...@@ -868,7 +865,7 @@ static void __devexit netdrv_remove_one (struct pci_dev *pdev) ...@@ -868,7 +865,7 @@ static void __devexit netdrv_remove_one (struct pci_dev *pdev)
pci_set_drvdata (pdev, NULL); pci_set_drvdata (pdev, NULL);
pci_power_off (pdev, -1); pci_disable_device (pdev);
DPRINTK ("EXIT\n"); DPRINTK ("EXIT\n");
} }
...@@ -1136,7 +1133,6 @@ static void netdrv_hw_start (struct net_device *dev) ...@@ -1136,7 +1133,6 @@ static void netdrv_hw_start (struct net_device *dev)
struct netdrv_private *tp = dev->priv; struct netdrv_private *tp = dev->priv;
void *ioaddr = tp->mmio_addr; void *ioaddr = tp->mmio_addr;
u32 i; u32 i;
u8 tmp;
DPRINTK ("ENTER\n"); DPRINTK ("ENTER\n");
...@@ -1875,9 +1871,11 @@ static void netdrv_set_rx_mode (struct net_device *dev) ...@@ -1875,9 +1871,11 @@ static void netdrv_set_rx_mode (struct net_device *dev)
rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
mc_filter[1] = mc_filter[0] = 0; mc_filter[1] = mc_filter[0] = 0;
for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
i++, mclist = mclist->next) i++, mclist = mclist->next) {
set_bit (ether_crc (ETH_ALEN, mclist->dmi_addr) >> 26, int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26;
mc_filter);
mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
}
} }
/* if called from irq handler, lock already acquired */ /* if called from irq handler, lock already acquired */
...@@ -1908,7 +1906,7 @@ static int netdrv_suspend (struct pci_dev *pdev, u32 state) ...@@ -1908,7 +1906,7 @@ static int netdrv_suspend (struct pci_dev *pdev, u32 state)
unsigned long flags; unsigned long flags;
if (!netif_running(dev)) if (!netif_running(dev))
return; return 0;
netif_device_detach (dev); netif_device_detach (dev);
spin_lock_irqsave (&tp->lock, flags); spin_lock_irqsave (&tp->lock, flags);
...@@ -1923,7 +1921,8 @@ static int netdrv_suspend (struct pci_dev *pdev, u32 state) ...@@ -1923,7 +1921,8 @@ static int netdrv_suspend (struct pci_dev *pdev, u32 state)
spin_unlock_irqrestore (&tp->lock, flags); spin_unlock_irqrestore (&tp->lock, flags);
pci_power_off (pdev, -1); pci_save_state (pdev, tp->pci_state);
pci_set_power_state (pdev, 3);
return 0; return 0;
} }
...@@ -1932,10 +1931,12 @@ static int netdrv_suspend (struct pci_dev *pdev, u32 state) ...@@ -1932,10 +1931,12 @@ static int netdrv_suspend (struct pci_dev *pdev, u32 state)
static int netdrv_resume (struct pci_dev *pdev) static int netdrv_resume (struct pci_dev *pdev)
{ {
struct net_device *dev = pci_get_drvdata (pdev); struct net_device *dev = pci_get_drvdata (pdev);
struct netdrv_private *tp = dev->priv;
if (!netif_running(dev)) if (!netif_running(dev))
return; return 0;
pci_power_on (pdev); pci_set_power_state (pdev, 0);
pci_restore_state (pdev, tp->pci_state);
netif_device_attach (dev); netif_device_attach (dev);
netdrv_hw_start (dev); netdrv_hw_start (dev);
......
...@@ -58,7 +58,6 @@ typedef struct s_AC SK_AC; ...@@ -58,7 +58,6 @@ typedef struct s_AC SK_AC;
#define SK_ADDR_EQUAL(a1,a2) (!memcmp(a1,a2,6)) #define SK_ADDR_EQUAL(a1,a2) (!memcmp(a1,a2,6))
#include <linux/version.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/string.h> #include <linux/string.h>
......
...@@ -57,8 +57,8 @@ ...@@ -57,8 +57,8 @@
#define DRV_MODULE_NAME "tg3" #define DRV_MODULE_NAME "tg3"
#define PFX DRV_MODULE_NAME ": " #define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "3.7" #define DRV_MODULE_VERSION "3.8"
#define DRV_MODULE_RELDATE "July 2, 2004" #define DRV_MODULE_RELDATE "July 14, 2004"
#define TG3_DEF_MAC_MODE 0 #define TG3_DEF_MAC_MODE 0
#define TG3_DEF_RX_MODE 0 #define TG3_DEF_RX_MODE 0
...@@ -2455,6 +2455,11 @@ static int tg3_rx(struct tg3 *tp, int budget) ...@@ -2455,6 +2455,11 @@ static int tg3_rx(struct tg3 *tp, int budget)
int received; int received;
hw_idx = tp->hw_status->idx[0].rx_producer; hw_idx = tp->hw_status->idx[0].rx_producer;
/*
* We need to order the read of hw_idx and the read of
* the opaque cookie.
*/
rmb();
sw_idx = rx_rcb_ptr % TG3_RX_RCB_RING_SIZE(tp); sw_idx = rx_rcb_ptr % TG3_RX_RCB_RING_SIZE(tp);
work_mask = 0; work_mask = 0;
received = 0; received = 0;
......
...@@ -1971,7 +1971,6 @@ static struct pci_device_id dmfe_pci_tbl[] = { ...@@ -1971,7 +1971,6 @@ static struct pci_device_id dmfe_pci_tbl[] = {
{ 0x1282, 0x9102, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_DM9102_ID }, { 0x1282, 0x9102, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_DM9102_ID },
{ 0x1282, 0x9100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_DM9100_ID }, { 0x1282, 0x9100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_DM9100_ID },
{ 0x1282, 0x9009, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_DM9009_ID }, { 0x1282, 0x9009, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_DM9009_ID },
{ 0x10B9, 0x5261, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_DM9102_ID },
{ 0, } { 0, }
}; };
MODULE_DEVICE_TABLE(pci, dmfe_pci_tbl); MODULE_DEVICE_TABLE(pci, dmfe_pci_tbl);
......
...@@ -1210,6 +1210,7 @@ struct airo_info { ...@@ -1210,6 +1210,7 @@ struct airo_info {
APListRid *APList; APListRid *APList;
#define PCI_SHARED_LEN 2*MPI_MAX_FIDS*PKTSIZE+RIDSIZE #define PCI_SHARED_LEN 2*MPI_MAX_FIDS*PKTSIZE+RIDSIZE
u32 pci_state[16]; u32 pci_state[16];
char proc_name[IFNAMSIZ];
}; };
static inline int bap_read(struct airo_info *ai, u16 *pu16Dst, int bytelen, static inline int bap_read(struct airo_info *ai, u16 *pu16Dst, int bytelen,
...@@ -3162,11 +3163,12 @@ static irqreturn_t airo_interrupt ( int irq, void* dev_id, struct pt_regs *regs) ...@@ -3162,11 +3163,12 @@ static irqreturn_t airo_interrupt ( int irq, void* dev_id, struct pt_regs *regs)
} else } else
hdrlen = ETH_ALEN * 2; hdrlen = ETH_ALEN * 2;
skb = dev_alloc_skb( len + hdrlen + 2 ); skb = dev_alloc_skb( len + hdrlen + 2 + 2 );
if ( !skb ) { if ( !skb ) {
apriv->stats.rx_dropped++; apriv->stats.rx_dropped++;
goto badrx; goto badrx;
} }
skb_reserve(skb, 2); /* This way the IP header is aligned */
buffer = (u16*)skb_put (skb, len + hdrlen); buffer = (u16*)skb_put (skb, len + hdrlen);
if (test_bit(FLAG_802_11, &apriv->flags)) { if (test_bit(FLAG_802_11, &apriv->flags)) {
buffer[0] = fc; buffer[0] = fc;
...@@ -4369,7 +4371,8 @@ static int setup_proc_entry( struct net_device *dev, ...@@ -4369,7 +4371,8 @@ static int setup_proc_entry( struct net_device *dev,
struct airo_info *apriv ) { struct airo_info *apriv ) {
struct proc_dir_entry *entry; struct proc_dir_entry *entry;
/* First setup the device directory */ /* First setup the device directory */
apriv->proc_entry = create_proc_entry(dev->name, strcpy(apriv->proc_name,dev->name);
apriv->proc_entry = create_proc_entry(apriv->proc_name,
S_IFDIR|airo_perm, S_IFDIR|airo_perm,
airo_entry); airo_entry);
apriv->proc_entry->uid = proc_uid; apriv->proc_entry->uid = proc_uid;
...@@ -4470,7 +4473,7 @@ static int takedown_proc_entry( struct net_device *dev, ...@@ -4470,7 +4473,7 @@ static int takedown_proc_entry( struct net_device *dev,
remove_proc_entry("APList",apriv->proc_entry); remove_proc_entry("APList",apriv->proc_entry);
remove_proc_entry("BSSList",apriv->proc_entry); remove_proc_entry("BSSList",apriv->proc_entry);
remove_proc_entry("WepKey",apriv->proc_entry); remove_proc_entry("WepKey",apriv->proc_entry);
remove_proc_entry(dev->name,airo_entry); remove_proc_entry(apriv->proc_name,airo_entry);
return 0; return 0;
} }
......
...@@ -28,10 +28,6 @@ const int frequency_list_bg[] = { 2412, 2417, 2422, 2427, 2432, 2437, 2442, ...@@ -28,10 +28,6 @@ const int frequency_list_bg[] = { 2412, 2417, 2422, 2427, 2432, 2437, 2442,
2447, 2452, 2457, 2462, 2467, 2472, 2484 2447, 2452, 2457, 2462, 2467, 2472, 2484
}; };
const int frequency_list_a[] = { 5170, 5180, 5190, 5200, 5210, 5220, 5230,
5240, 5260, 5280, 5300, 5320
};
int int
channel_of_freq(int f) channel_of_freq(int f)
{ {
...@@ -41,10 +37,8 @@ channel_of_freq(int f) ...@@ -41,10 +37,8 @@ channel_of_freq(int f)
while ((c < 14) && (f != frequency_list_bg[c])) while ((c < 14) && (f != frequency_list_bg[c]))
c++; c++;
return (c >= 14) ? 0 : ++c; return (c >= 14) ? 0 : ++c;
} else if ((f >= (int) 5170) && (f <= (int) 5320)) { } else if ((f >= (int) 5000) && (f <= (int) 6000)) {
while ((c < 12) && (f != frequency_list_a[c])) return ( (f - 5000) / 5 );
c++;
return (c >= 12) ? 0 : (c + 37);
} else } else
return 0; return 0;
} }
...@@ -68,7 +62,7 @@ struct oid_t isl_oid[] = { ...@@ -68,7 +62,7 @@ struct oid_t isl_oid[] = {
/* 802.11 */ /* 802.11 */
OID_U32_C(DOT11_OID_BSSTYPE, 0x10000000), OID_U32_C(DOT11_OID_BSSTYPE, 0x10000000),
OID_STRUCT_C(DOT11_OID_BSSID, 0x10000001, u8[6], OID_TYPE_SSID), OID_STRUCT_C(DOT11_OID_BSSID, 0x10000001, u8[6], OID_TYPE_RAW),
OID_STRUCT_C(DOT11_OID_SSID, 0x10000002, struct obj_ssid, OID_STRUCT_C(DOT11_OID_SSID, 0x10000002, struct obj_ssid,
OID_TYPE_SSID), OID_TYPE_SSID),
OID_U32(DOT11_OID_STATE, 0x10000003), OID_U32(DOT11_OID_STATE, 0x10000003),
...@@ -776,8 +770,9 @@ mgt_response_to_str(enum oid_num_t n, union oid_res_t *r, char *str) ...@@ -776,8 +770,9 @@ mgt_response_to_str(enum oid_num_t n, union oid_res_t *r, char *str)
case OID_TYPE_SSID:{ case OID_TYPE_SSID:{
struct obj_ssid *ssid = r->ptr; struct obj_ssid *ssid = r->ptr;
return snprintf(str, PRIV_STR_SIZE, return snprintf(str, PRIV_STR_SIZE,
"length=%u\noctets=%s\n", "length=%u\noctets=%.*s\n",
ssid->length, ssid->octets); ssid->length, ssid->length,
ssid->octets);
} }
break; break;
case OID_TYPE_KEY:{ case OID_TYPE_KEY:{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment