* [git patches] 2.6.x net driver updates
From: Jeff Garzik @ 2006-01-09 17:10 UTC (permalink / raw)
To: Andrew Morton, Linus Torvalds; +Cc: netdev, linux-kernel
Please pull from 'upstream-linus' branch of
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git
to receive the following updates:
Documentation/networking/bonding.txt | 2
MAINTAINERS | 1
drivers/net/3c503.c | 16 +--
drivers/net/Kconfig | 4
drivers/net/ac3200.c | 16 +--
drivers/net/bonding/bonding.h | 8 -
drivers/net/e1000/e1000_param.c | 10 +-
drivers/net/e2100.c | 14 +-
drivers/net/es3210.c | 14 +-
drivers/net/forcedeth.c | 164 +++++++++++++++++++++--------------
drivers/net/gianfar.h | 4
drivers/net/hp-plus.c | 12 +-
drivers/net/hp.c | 12 +-
drivers/net/ibm_emac/ibm_emac.h | 3
drivers/net/ibm_emac/ibm_emac_core.c | 2
drivers/net/lance.c | 22 ++--
drivers/net/lne390.c | 14 +-
drivers/net/mv643xx_eth.c | 2
drivers/net/ne.c | 18 +--
drivers/net/ne2.c | 16 +--
drivers/net/sk98lin/skge.c | 129 ++++++++++++++++-----------
drivers/net/smc-ultra.c | 24 ++---
drivers/net/tulip/tulip_core.c | 2
drivers/net/wd.c | 14 +-
drivers/net/wireless/ipw2100.c | 5 -
net/ieee80211/ieee80211_crypt_wep.c | 61 +++++++++----
net/ieee80211/ieee80211_tx.c | 2
net/ieee80211/ieee80211_wx.c | 2
28 files changed, 341 insertions(+), 252 deletions(-)
Adrian Bunk:
drivers/net/Kconfig: indentation fix
drivers/net/bonding/bonding.h: "extern inline" -> "static inline"
drivers/net/gianfar.h: "extern inline" -> "static inline"
Ayaz Abdulla:
forcedeth: TSO fix for large buffers
Christoph Dworzak:
tulip: enable multiport NIC BIOS fixups for x86_64
Dan Williams:
[patch] ipw2100: support WEXT-18 enc_capa v3
Denis Vlasenko:
fix a few "warning: 'cleanup_card' defined but not used"
Eric Paris:
update bonding.txt to not show ip address on slaves
Eugene Surovegin:
PPC44x EMAC driver: disable TX status deferral in half-duplex mode
Franck:
Add MIPS dependency for dm9000 driver
Johannes Berg:
ieee80211: enable hw wep where host has to build IV
Kenji Kaneshige:
e1000: Fix invalid memory reference
Olaf Hering:
remove bouncing mail address of mv643xx_eth maintainer
Stephen Hemminger:
sk98lin: routine called from probe marked __init
sk98lin: not doing high dma properly
sk98lin: error handling on dual port board
sk98lin: use kzalloc
sk98lin: error handling on probe
sk98lin: error handling of pci setup
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
index b0fe41d..8d8b4e5 100644
--- a/Documentation/networking/bonding.txt
+++ b/Documentation/networking/bonding.txt
@@ -945,7 +945,6 @@ bond0 Link encap:Ethernet HWaddr 00
collisions:0 txqueuelen:0
eth0 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4
- inet addr:XXX.XXX.XXX.YYY Bcast:XXX.XXX.XXX.255 Mask:255.255.252.0
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:3573025 errors:0 dropped:0 overruns:0 frame:0
TX packets:1643167 errors:1 dropped:0 overruns:1 carrier:0
@@ -953,7 +952,6 @@ eth0 Link encap:Ethernet HWaddr 00
Interrupt:10 Base address:0x1080
eth1 Link encap:Ethernet HWaddr 00:C0:F0:1F:37:B4
- inet addr:XXX.XXX.XXX.YYY Bcast:XXX.XXX.XXX.255 Mask:255.255.252.0
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:3651769 errors:0 dropped:0 overruns:0 frame:0
TX packets:1643480 errors:0 dropped:0 overruns:0 carrier:0
diff --git a/MAINTAINERS b/MAINTAINERS
index 76dc820..270e28c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1697,7 +1697,6 @@ S: Maintained
MARVELL MV64340 ETHERNET DRIVER
P: Manish Lachwani
-M: Manish_Lachwani@pmc-sierra.com
L: linux-mips@linux-mips.org
L: netdev@vger.kernel.org
S: Supported
diff --git a/drivers/net/3c503.c b/drivers/net/3c503.c
index 5c5eebd..dcc98af 100644
--- a/drivers/net/3c503.c
+++ b/drivers/net/3c503.c
@@ -148,14 +148,6 @@ el2_pio_probe(struct net_device *dev)
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- /* NB: el2_close() handles free_irq */
- release_region(dev->base_addr, EL2_IO_EXTENT);
- if (ei_status.mem)
- iounmap(ei_status.mem);
-}
-
#ifndef MODULE
struct net_device * __init el2_probe(int unit)
{
@@ -726,6 +718,14 @@ init_module(void)
return -ENXIO;
}
+static void cleanup_card(struct net_device *dev)
+{
+ /* NB: el2_close() handles free_irq */
+ release_region(dev->base_addr, EL2_IO_EXTENT);
+ if (ei_status.mem)
+ iounmap(ei_status.mem);
+}
+
void
cleanup_module(void)
{
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 1960961..733bc25 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -129,7 +129,7 @@ config NET_SB1000
If you don't have this card, of course say N.
- source "drivers/net/arcnet/Kconfig"
+source "drivers/net/arcnet/Kconfig"
source "drivers/net/phy/Kconfig"
@@ -844,7 +844,7 @@ config SMC9194
config DM9000
tristate "DM9000 support"
- depends on ARM && NET_ETHERNET
+ depends on (ARM || MIPS) && NET_ETHERNET
select CRC32
select MII
---help---
diff --git a/drivers/net/ac3200.c b/drivers/net/ac3200.c
index 8a0af54..7952dc6 100644
--- a/drivers/net/ac3200.c
+++ b/drivers/net/ac3200.c
@@ -123,14 +123,6 @@ static int __init do_ac3200_probe(struct
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- /* Someday free_irq may be in ac_close_card() */
- free_irq(dev->irq, dev);
- release_region(dev->base_addr, AC_IO_EXTENT);
- iounmap(ei_status.mem);
-}
-
#ifndef MODULE
struct net_device * __init ac3200_probe(int unit)
{
@@ -406,6 +398,14 @@ init_module(void)
return -ENXIO;
}
+static void cleanup_card(struct net_device *dev)
+{
+ /* Someday free_irq may be in ac_close_card() */
+ free_irq(dev->irq, dev);
+ release_region(dev->base_addr, AC_IO_EXTENT);
+ iounmap(ei_status.mem);
+}
+
void
cleanup_module(void)
{
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 015c7f1..f20bb85 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -205,7 +205,7 @@ struct bonding {
*
* Caller must hold bond lock for read
*/
-extern inline struct slave *bond_get_slave_by_dev(struct bonding *bond, struct net_device *slave_dev)
+static inline struct slave *bond_get_slave_by_dev(struct bonding *bond, struct net_device *slave_dev)
{
struct slave *slave = NULL;
int i;
@@ -219,7 +219,7 @@ extern inline struct slave *bond_get_sla
return slave;
}
-extern inline struct bonding *bond_get_bond_by_slave(struct slave *slave)
+static inline struct bonding *bond_get_bond_by_slave(struct slave *slave)
{
if (!slave || !slave->dev->master) {
return NULL;
@@ -228,13 +228,13 @@ extern inline struct bonding *bond_get_b
return (struct bonding *)slave->dev->master->priv;
}
-extern inline void bond_set_slave_inactive_flags(struct slave *slave)
+static inline void bond_set_slave_inactive_flags(struct slave *slave)
{
slave->state = BOND_STATE_BACKUP;
slave->dev->flags |= IFF_NOARP;
}
-extern inline void bond_set_slave_active_flags(struct slave *slave)
+static inline void bond_set_slave_active_flags(struct slave *slave)
{
slave->state = BOND_STATE_ACTIVE;
slave->dev->flags &= ~IFF_NOARP;
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c
index 38695d5..ccbbe5a 100644
--- a/drivers/net/e1000/e1000_param.c
+++ b/drivers/net/e1000/e1000_param.c
@@ -545,7 +545,7 @@ e1000_check_fiber_options(struct e1000_a
static void __devinit
e1000_check_copper_options(struct e1000_adapter *adapter)
{
- int speed, dplx;
+ int speed, dplx, an;
int bd = adapter->bd_number;
{ /* Speed */
@@ -641,8 +641,12 @@ e1000_check_copper_options(struct e1000_
.p = an_list }}
};
- int an = AutoNeg[bd];
- e1000_validate_option(&an, &opt, adapter);
+ if (num_AutoNeg > bd) {
+ an = AutoNeg[bd];
+ e1000_validate_option(&an, &opt, adapter);
+ } else {
+ an = opt.def;
+ }
adapter->hw.autoneg_advertised = an;
}
diff --git a/drivers/net/e2100.c b/drivers/net/e2100.c
index f5a4dd7..e5c5cd2 100644
--- a/drivers/net/e2100.c
+++ b/drivers/net/e2100.c
@@ -140,13 +140,6 @@ static int __init do_e2100_probe(struct
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- /* NB: e21_close() handles free_irq */
- iounmap(ei_status.mem);
- release_region(dev->base_addr, E21_IO_EXTENT);
-}
-
#ifndef MODULE
struct net_device * __init e2100_probe(int unit)
{
@@ -463,6 +456,13 @@ init_module(void)
return -ENXIO;
}
+static void cleanup_card(struct net_device *dev)
+{
+ /* NB: e21_close() handles free_irq */
+ iounmap(ei_status.mem);
+ release_region(dev->base_addr, E21_IO_EXTENT);
+}
+
void
cleanup_module(void)
{
diff --git a/drivers/net/es3210.c b/drivers/net/es3210.c
index 50f8e23..6b0ab1e 100644
--- a/drivers/net/es3210.c
+++ b/drivers/net/es3210.c
@@ -155,13 +155,6 @@ static int __init do_es_probe(struct net
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- free_irq(dev->irq, dev);
- release_region(dev->base_addr, ES_IO_EXTENT);
- iounmap(ei_status.mem);
-}
-
#ifndef MODULE
struct net_device * __init es_probe(int unit)
{
@@ -456,6 +449,13 @@ init_module(void)
return -ENXIO;
}
+static void cleanup_card(struct net_device *dev)
+{
+ free_irq(dev->irq, dev);
+ release_region(dev->base_addr, ES_IO_EXTENT);
+ iounmap(ei_status.mem);
+}
+
void
cleanup_module(void)
{
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index c39344a..3682ec6 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -101,6 +101,7 @@
* 0.46: 20 Oct 2005: Add irq optimization modes.
* 0.47: 26 Oct 2005: Add phyaddr 0 in phy scan.
* 0.48: 24 Dec 2005: Disable TSO, bugfix for pci_map_single
+ * 0.49: 10 Dec 2005: Fix tso for large buffers.
*
* Known bugs:
* We suspect that on some hardware no TX done interrupts are generated.
@@ -112,7 +113,7 @@
* DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few
* superfluous timer interrupts from the nic.
*/
-#define FORCEDETH_VERSION "0.48"
+#define FORCEDETH_VERSION "0.49"
#define DRV_NAME "forcedeth"
#include <linux/module.h>
@@ -349,6 +350,8 @@ typedef union _ring_type {
#define NV_TX2_VALID (1<<31)
#define NV_TX2_TSO (1<<28)
#define NV_TX2_TSO_SHIFT 14
+#define NV_TX2_TSO_MAX_SHIFT 14
+#define NV_TX2_TSO_MAX_SIZE (1<<NV_TX2_TSO_MAX_SHIFT)
#define NV_TX2_CHECKSUM_L3 (1<<27)
#define NV_TX2_CHECKSUM_L4 (1<<26)
@@ -408,15 +411,15 @@ typedef union _ring_type {
#define NV_WATCHDOG_TIMEO (5*HZ)
#define RX_RING 128
-#define TX_RING 64
+#define TX_RING 256
/*
* If your nic mysteriously hangs then try to reduce the limits
* to 1/0: It might be required to set NV_TX_LASTPACKET in the
* last valid ring entry. But this would be impossible to
* implement - probably a disassembly error.
*/
-#define TX_LIMIT_STOP 63
-#define TX_LIMIT_START 62
+#define TX_LIMIT_STOP 255
+#define TX_LIMIT_START 254
/* rx/tx mac addr + type + vlan + align + slack*/
#define NV_RX_HEADERS (64)
@@ -535,6 +538,7 @@ struct fe_priv {
unsigned int next_tx, nic_tx;
struct sk_buff *tx_skbuff[TX_RING];
dma_addr_t tx_dma[TX_RING];
+ unsigned int tx_dma_len[TX_RING];
u32 tx_flags;
};
@@ -935,6 +939,7 @@ static void nv_init_tx(struct net_device
else
np->tx_ring.ex[i].FlagLen = 0;
np->tx_skbuff[i] = NULL;
+ np->tx_dma[i] = 0;
}
}
@@ -945,30 +950,27 @@ static int nv_init_ring(struct net_devic
return nv_alloc_rx(dev);
}
-static void nv_release_txskb(struct net_device *dev, unsigned int skbnr)
+static int nv_release_txskb(struct net_device *dev, unsigned int skbnr)
{
struct fe_priv *np = netdev_priv(dev);
- struct sk_buff *skb = np->tx_skbuff[skbnr];
- unsigned int j, entry, fragments;
-
- dprintk(KERN_INFO "%s: nv_release_txskb for skbnr %d, skb %p\n",
- dev->name, skbnr, np->tx_skbuff[skbnr]);
-
- entry = skbnr;
- if ((fragments = skb_shinfo(skb)->nr_frags) != 0) {
- for (j = fragments; j >= 1; j--) {
- skb_frag_t *frag = &skb_shinfo(skb)->frags[j-1];
- pci_unmap_page(np->pci_dev, np->tx_dma[entry],
- frag->size,
- PCI_DMA_TODEVICE);
- entry = (entry - 1) % TX_RING;
- }
+
+ dprintk(KERN_INFO "%s: nv_release_txskb for skbnr %d\n",
+ dev->name, skbnr);
+
+ if (np->tx_dma[skbnr]) {
+ pci_unmap_page(np->pci_dev, np->tx_dma[skbnr],
+ np->tx_dma_len[skbnr],
+ PCI_DMA_TODEVICE);
+ np->tx_dma[skbnr] = 0;
+ }
+
+ if (np->tx_skbuff[skbnr]) {
+ dev_kfree_skb_irq(np->tx_skbuff[skbnr]);
+ np->tx_skbuff[skbnr] = NULL;
+ return 1;
+ } else {
+ return 0;
}
- pci_unmap_single(np->pci_dev, np->tx_dma[entry],
- skb->len - skb->data_len,
- PCI_DMA_TODEVICE);
- dev_kfree_skb_irq(skb);
- np->tx_skbuff[skbnr] = NULL;
}
static void nv_drain_tx(struct net_device *dev)
@@ -981,10 +983,8 @@ static void nv_drain_tx(struct net_devic
np->tx_ring.orig[i].FlagLen = 0;
else
np->tx_ring.ex[i].FlagLen = 0;
- if (np->tx_skbuff[i]) {
- nv_release_txskb(dev, i);
+ if (nv_release_txskb(dev, i))
np->stats.tx_dropped++;
- }
}
}
@@ -1021,68 +1021,105 @@ static void drain_ring(struct net_device
static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct fe_priv *np = netdev_priv(dev);
+ u32 tx_flags = 0;
u32 tx_flags_extra = (np->desc_ver == DESC_VER_1 ? NV_TX_LASTPACKET : NV_TX2_LASTPACKET);
unsigned int fragments = skb_shinfo(skb)->nr_frags;
- unsigned int nr = (np->next_tx + fragments) % TX_RING;
+ unsigned int nr = (np->next_tx - 1) % TX_RING;
+ unsigned int start_nr = np->next_tx % TX_RING;
unsigned int i;
+ u32 offset = 0;
+ u32 bcnt;
+ u32 size = skb->len-skb->data_len;
+ u32 entries = (size >> NV_TX2_TSO_MAX_SHIFT) + ((size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0);
+
+ /* add fragments to entries count */
+ for (i = 0; i < fragments; i++) {
+ entries += (skb_shinfo(skb)->frags[i].size >> NV_TX2_TSO_MAX_SHIFT) +
+ ((skb_shinfo(skb)->frags[i].size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0);
+ }
spin_lock_irq(&np->lock);
- if ((np->next_tx - np->nic_tx + fragments) > TX_LIMIT_STOP) {
+ if ((np->next_tx - np->nic_tx + entries - 1) > TX_LIMIT_STOP) {
spin_unlock_irq(&np->lock);
netif_stop_queue(dev);
return NETDEV_TX_BUSY;
}
- np->tx_skbuff[nr] = skb;
-
- if (fragments) {
- dprintk(KERN_DEBUG "%s: nv_start_xmit: buffer contains %d fragments\n", dev->name, fragments);
- /* setup descriptors in reverse order */
- for (i = fragments; i >= 1; i--) {
- skb_frag_t *frag = &skb_shinfo(skb)->frags[i-1];
- np->tx_dma[nr] = pci_map_page(np->pci_dev, frag->page, frag->page_offset, frag->size,
- PCI_DMA_TODEVICE);
+ /* setup the header buffer */
+ do {
+ bcnt = (size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : size;
+ nr = (nr + 1) % TX_RING;
+
+ np->tx_dma[nr] = pci_map_single(np->pci_dev, skb->data + offset, bcnt,
+ PCI_DMA_TODEVICE);
+ np->tx_dma_len[nr] = bcnt;
+
+ if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) {
+ np->tx_ring.orig[nr].PacketBuffer = cpu_to_le32(np->tx_dma[nr]);
+ np->tx_ring.orig[nr].FlagLen = cpu_to_le32((bcnt-1) | tx_flags);
+ } else {
+ np->tx_ring.ex[nr].PacketBufferHigh = cpu_to_le64(np->tx_dma[nr]) >> 32;
+ np->tx_ring.ex[nr].PacketBufferLow = cpu_to_le64(np->tx_dma[nr]) & 0x0FFFFFFFF;
+ np->tx_ring.ex[nr].FlagLen = cpu_to_le32((bcnt-1) | tx_flags);
+ }
+ tx_flags = np->tx_flags;
+ offset += bcnt;
+ size -= bcnt;
+ } while(size);
+
+ /* setup the fragments */
+ for (i = 0; i < fragments; i++) {
+ skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
+ u32 size = frag->size;
+ offset = 0;
+
+ do {
+ bcnt = (size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : size;
+ nr = (nr + 1) % TX_RING;
+
+ np->tx_dma[nr] = pci_map_page(np->pci_dev, frag->page, frag->page_offset+offset, bcnt,
+ PCI_DMA_TODEVICE);
+ np->tx_dma_len[nr] = bcnt;
if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) {
np->tx_ring.orig[nr].PacketBuffer = cpu_to_le32(np->tx_dma[nr]);
- np->tx_ring.orig[nr].FlagLen = cpu_to_le32( (frag->size-1) | np->tx_flags | tx_flags_extra);
+ np->tx_ring.orig[nr].FlagLen = cpu_to_le32((bcnt-1) | tx_flags);
} else {
np->tx_ring.ex[nr].PacketBufferHigh = cpu_to_le64(np->tx_dma[nr]) >> 32;
np->tx_ring.ex[nr].PacketBufferLow = cpu_to_le64(np->tx_dma[nr]) & 0x0FFFFFFFF;
- np->tx_ring.ex[nr].FlagLen = cpu_to_le32( (frag->size-1) | np->tx_flags | tx_flags_extra);
+ np->tx_ring.ex[nr].FlagLen = cpu_to_le32((bcnt-1) | tx_flags);
}
-
- nr = (nr - 1) % TX_RING;
+ offset += bcnt;
+ size -= bcnt;
+ } while (size);
+ }
- if (np->desc_ver == DESC_VER_1)
- tx_flags_extra &= ~NV_TX_LASTPACKET;
- else
- tx_flags_extra &= ~NV_TX2_LASTPACKET;
- }
+ /* set last fragment flag */
+ if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) {
+ np->tx_ring.orig[nr].FlagLen |= cpu_to_le32(tx_flags_extra);
+ } else {
+ np->tx_ring.ex[nr].FlagLen |= cpu_to_le32(tx_flags_extra);
}
+ np->tx_skbuff[nr] = skb;
+
#ifdef NETIF_F_TSO
if (skb_shinfo(skb)->tso_size)
- tx_flags_extra |= NV_TX2_TSO | (skb_shinfo(skb)->tso_size << NV_TX2_TSO_SHIFT);
+ tx_flags_extra = NV_TX2_TSO | (skb_shinfo(skb)->tso_size << NV_TX2_TSO_SHIFT);
else
#endif
- tx_flags_extra |= (skb->ip_summed == CHECKSUM_HW ? (NV_TX2_CHECKSUM_L3|NV_TX2_CHECKSUM_L4) : 0);
+ tx_flags_extra = (skb->ip_summed == CHECKSUM_HW ? (NV_TX2_CHECKSUM_L3|NV_TX2_CHECKSUM_L4) : 0);
- np->tx_dma[nr] = pci_map_single(np->pci_dev, skb->data, skb->len-skb->data_len,
- PCI_DMA_TODEVICE);
-
+ /* set tx flags */
if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) {
- np->tx_ring.orig[nr].PacketBuffer = cpu_to_le32(np->tx_dma[nr]);
- np->tx_ring.orig[nr].FlagLen = cpu_to_le32( (skb->len-skb->data_len-1) | np->tx_flags | tx_flags_extra);
+ np->tx_ring.orig[start_nr].FlagLen |= cpu_to_le32(tx_flags | tx_flags_extra);
} else {
- np->tx_ring.ex[nr].PacketBufferHigh = cpu_to_le64(np->tx_dma[nr]) >> 32;
- np->tx_ring.ex[nr].PacketBufferLow = cpu_to_le64(np->tx_dma[nr]) & 0x0FFFFFFFF;
- np->tx_ring.ex[nr].FlagLen = cpu_to_le32( (skb->len-skb->data_len-1) | np->tx_flags | tx_flags_extra);
+ np->tx_ring.ex[start_nr].FlagLen |= cpu_to_le32(tx_flags | tx_flags_extra);
}
- dprintk(KERN_DEBUG "%s: nv_start_xmit: packet packet %d queued for transmission. tx_flags_extra: %x\n",
- dev->name, np->next_tx, tx_flags_extra);
+ dprintk(KERN_DEBUG "%s: nv_start_xmit: packet %d (entries %d) queued for transmission. tx_flags_extra: %x\n",
+ dev->name, np->next_tx, entries, tx_flags_extra);
{
int j;
for (j=0; j<64; j++) {
@@ -1093,7 +1130,7 @@ static int nv_start_xmit(struct sk_buff
dprintk("\n");
}
- np->next_tx += 1 + fragments;
+ np->next_tx += entries;
dev->trans_start = jiffies;
spin_unlock_irq(&np->lock);
@@ -1140,7 +1177,6 @@ static void nv_tx_done(struct net_device
np->stats.tx_packets++;
np->stats.tx_bytes += skb->len;
}
- nv_release_txskb(dev, i);
}
} else {
if (Flags & NV_TX2_LASTPACKET) {
@@ -1156,9 +1192,9 @@ static void nv_tx_done(struct net_device
np->stats.tx_packets++;
np->stats.tx_bytes += skb->len;
}
- nv_release_txskb(dev, i);
}
}
+ nv_release_txskb(dev, i);
np->nic_tx++;
}
if (np->next_tx - np->nic_tx < TX_LIMIT_START)
@@ -2456,7 +2492,7 @@ static int __devinit nv_probe(struct pci
np->txrxctl_bits |= NVREG_TXRXCTL_RXCHECK;
dev->features |= NETIF_F_HW_CSUM | NETIF_F_SG;
#ifdef NETIF_F_TSO
- /* disabled dev->features |= NETIF_F_TSO; */
+ dev->features |= NETIF_F_TSO;
#endif
}
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index 94a91da..cb9d66a 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -718,14 +718,14 @@ struct gfar_private {
uint32_t msg_enable;
};
-extern inline u32 gfar_read(volatile unsigned *addr)
+static inline u32 gfar_read(volatile unsigned *addr)
{
u32 val;
val = in_be32(addr);
return val;
}
-extern inline void gfar_write(volatile unsigned *addr, u32 val)
+static inline void gfar_write(volatile unsigned *addr, u32 val)
{
out_be32(addr, val);
}
diff --git a/drivers/net/hp-plus.c b/drivers/net/hp-plus.c
index 0abf5dd..74e167e 100644
--- a/drivers/net/hp-plus.c
+++ b/drivers/net/hp-plus.c
@@ -138,12 +138,6 @@ static int __init do_hpp_probe(struct ne
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- /* NB: hpp_close() handles free_irq */
- release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
-}
-
#ifndef MODULE
struct net_device * __init hp_plus_probe(int unit)
{
@@ -473,6 +467,12 @@ init_module(void)
return -ENXIO;
}
+static void cleanup_card(struct net_device *dev)
+{
+ /* NB: hpp_close() handles free_irq */
+ release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
+}
+
void
cleanup_module(void)
{
diff --git a/drivers/net/hp.c b/drivers/net/hp.c
index 59cf841..cf9fb36 100644
--- a/drivers/net/hp.c
+++ b/drivers/net/hp.c
@@ -102,12 +102,6 @@ static int __init do_hp_probe(struct net
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- free_irq(dev->irq, dev);
- release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
-}
-
#ifndef MODULE
struct net_device * __init hp_probe(int unit)
{
@@ -444,6 +438,12 @@ init_module(void)
return -ENXIO;
}
+static void cleanup_card(struct net_device *dev)
+{
+ free_irq(dev->irq, dev);
+ release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
+}
+
void
cleanup_module(void)
{
diff --git a/drivers/net/ibm_emac/ibm_emac.h b/drivers/net/ibm_emac/ibm_emac.h
index 644edbf..c2dae60 100644
--- a/drivers/net/ibm_emac/ibm_emac.h
+++ b/drivers/net/ibm_emac/ibm_emac.h
@@ -110,6 +110,7 @@ struct emac_regs {
#define EMAC_MR1_TFS_2K 0x00080000
#define EMAC_MR1_TR0_MULT 0x00008000
#define EMAC_MR1_JPSM 0x00000000
+#define EMAC_MR1_MWSW_001 0x00000000
#define EMAC_MR1_BASE(opb) (EMAC_MR1_TFS_2K | EMAC_MR1_TR0_MULT)
#else
#define EMAC_MR1_RFS_4K 0x00180000
@@ -130,7 +131,7 @@ struct emac_regs {
(freq) <= 83 ? EMAC_MR1_OBCI_83 : \
(freq) <= 100 ? EMAC_MR1_OBCI_100 : EMAC_MR1_OBCI_100P)
#define EMAC_MR1_BASE(opb) (EMAC_MR1_TFS_2K | EMAC_MR1_TR | \
- EMAC_MR1_MWSW_001 | EMAC_MR1_OBCI(opb))
+ EMAC_MR1_OBCI(opb))
#endif
/* EMACx_TMR0 */
diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c
index 1da8a66..591c586 100644
--- a/drivers/net/ibm_emac/ibm_emac_core.c
+++ b/drivers/net/ibm_emac/ibm_emac_core.c
@@ -408,7 +408,7 @@ static int emac_configure(struct ocp_ene
/* Mode register */
r = EMAC_MR1_BASE(emac_opb_mhz()) | EMAC_MR1_VLE | EMAC_MR1_IST;
if (dev->phy.duplex == DUPLEX_FULL)
- r |= EMAC_MR1_FDE;
+ r |= EMAC_MR1_FDE | EMAC_MR1_MWSW_001;
dev->stop_timeout = STOP_TIMEOUT_10;
switch (dev->phy.speed) {
case SPEED_1000:
diff --git a/drivers/net/lance.c b/drivers/net/lance.c
index 1d75ca0..d1d714f 100644
--- a/drivers/net/lance.c
+++ b/drivers/net/lance.c
@@ -309,17 +309,6 @@ static void lance_tx_timeout (struct net
\f
-static void cleanup_card(struct net_device *dev)
-{
- struct lance_private *lp = dev->priv;
- if (dev->dma != 4)
- free_dma(dev->dma);
- release_region(dev->base_addr, LANCE_TOTAL_SIZE);
- kfree(lp->tx_bounce_buffs);
- kfree((void*)lp->rx_buffs);
- kfree(lp);
-}
-
#ifdef MODULE
#define MAX_CARDS 8 /* Max number of interfaces (cards) per module */
@@ -367,6 +356,17 @@ int init_module(void)
return -ENXIO;
}
+static void cleanup_card(struct net_device *dev)
+{
+ struct lance_private *lp = dev->priv;
+ if (dev->dma != 4)
+ free_dma(dev->dma);
+ release_region(dev->base_addr, LANCE_TOTAL_SIZE);
+ kfree(lp->tx_bounce_buffs);
+ kfree((void*)lp->rx_buffs);
+ kfree(lp);
+}
+
void cleanup_module(void)
{
int this_dev;
diff --git a/drivers/net/lne390.c b/drivers/net/lne390.c
index 309d254..646e89f 100644
--- a/drivers/net/lne390.c
+++ b/drivers/net/lne390.c
@@ -145,13 +145,6 @@ static int __init do_lne390_probe(struct
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- free_irq(dev->irq, dev);
- release_region(dev->base_addr, LNE390_IO_EXTENT);
- iounmap(ei_status.mem);
-}
-
#ifndef MODULE
struct net_device * __init lne390_probe(int unit)
{
@@ -440,6 +433,13 @@ int init_module(void)
return -ENXIO;
}
+static void cleanup_card(struct net_device *dev)
+{
+ free_irq(dev->irq, dev);
+ release_region(dev->base_addr, LNE390_IO_EXTENT);
+ iounmap(ei_status.mem);
+}
+
void cleanup_module(void)
{
int this_dev;
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 3cb9b3f..22c3a37 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -6,7 +6,7 @@
* Copyright (C) 2002 rabeeh@galileo.co.il
*
* Copyright (C) 2003 PMC-Sierra, Inc.,
- * written by Manish Lachwani (lachwani@pmc-sierra.com)
+ * written by Manish Lachwani
*
* Copyright (C) 2003 Ralf Baechle <ralf@linux-mips.org>
*
diff --git a/drivers/net/ne.c b/drivers/net/ne.c
index 0de8fdd..94f782d 100644
--- a/drivers/net/ne.c
+++ b/drivers/net/ne.c
@@ -212,15 +212,6 @@ static int __init do_ne_probe(struct net
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv;
- if (idev)
- pnp_device_detach(idev);
- free_irq(dev->irq, dev);
- release_region(dev->base_addr, NE_IO_EXTENT);
-}
-
#ifndef MODULE
struct net_device * __init ne_probe(int unit)
{
@@ -859,6 +850,15 @@ int init_module(void)
return -ENODEV;
}
+static void cleanup_card(struct net_device *dev)
+{
+ struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv;
+ if (idev)
+ pnp_device_detach(idev);
+ free_irq(dev->irq, dev);
+ release_region(dev->base_addr, NE_IO_EXTENT);
+}
+
void cleanup_module(void)
{
int this_dev;
diff --git a/drivers/net/ne2.c b/drivers/net/ne2.c
index 6d62ada..e6df375 100644
--- a/drivers/net/ne2.c
+++ b/drivers/net/ne2.c
@@ -278,14 +278,6 @@ static int __init do_ne2_probe(struct ne
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- mca_mark_as_unused(ei_status.priv);
- mca_set_adapter_procfn( ei_status.priv, NULL, NULL);
- free_irq(dev->irq, dev);
- release_region(dev->base_addr, NE_IO_EXTENT);
-}
-
#ifndef MODULE
struct net_device * __init ne2_probe(int unit)
{
@@ -812,6 +804,14 @@ int init_module(void)
return -ENXIO;
}
+static void cleanup_card(struct net_device *dev)
+{
+ mca_mark_as_unused(ei_status.priv);
+ mca_set_adapter_procfn( ei_status.priv, NULL, NULL);
+ free_irq(dev->irq, dev);
+ release_region(dev->base_addr, NE_IO_EXTENT);
+}
+
void cleanup_module(void)
{
int this_dev;
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
index 9a76ac1..197edd7 100644
--- a/drivers/net/sk98lin/skge.c
+++ b/drivers/net/sk98lin/skge.c
@@ -282,26 +282,22 @@ SK_U32 Val) /* pointer to store the rea
* Description:
* This function initialize the PCI resources and IO
*
- * Returns: N/A
- *
+ * Returns:
+ * 0 - indicate everything worked ok.
+ * != 0 - error indication
*/
-int SkGeInitPCI(SK_AC *pAC)
+static __devinit int SkGeInitPCI(SK_AC *pAC)
{
struct SK_NET_DEVICE *dev = pAC->dev[0];
struct pci_dev *pdev = pAC->PciDev;
int retval;
- if (pci_enable_device(pdev) != 0) {
- return 1;
- }
-
dev->mem_start = pci_resource_start (pdev, 0);
pci_set_master(pdev);
- if (pci_request_regions(pdev, "sk98lin") != 0) {
- retval = 2;
- goto out_disable;
- }
+ retval = pci_request_regions(pdev, "sk98lin");
+ if (retval)
+ goto out;
#ifdef SK_BIG_ENDIAN
/*
@@ -320,9 +316,8 @@ int SkGeInitPCI(SK_AC *pAC)
* Remap the regs into kernel space.
*/
pAC->IoBase = ioremap_nocache(dev->mem_start, 0x4000);
-
- if (!pAC->IoBase){
- retval = 3;
+ if (!pAC->IoBase) {
+ retval = -EIO;
goto out_release;
}
@@ -330,8 +325,7 @@ int SkGeInitPCI(SK_AC *pAC)
out_release:
pci_release_regions(pdev);
- out_disable:
- pci_disable_device(pdev);
+ out:
return retval;
}
@@ -492,7 +486,7 @@ module_param_array(AutoSizing, charp, NU
* 0, if everything is ok
* !=0, on error
*/
-static int __init SkGeBoardInit(struct SK_NET_DEVICE *dev, SK_AC *pAC)
+static int __devinit SkGeBoardInit(struct SK_NET_DEVICE *dev, SK_AC *pAC)
{
short i;
unsigned long Flags;
@@ -529,7 +523,7 @@ SK_BOOL DualNet;
if (SkGeInit(pAC, pAC->IoBase, SK_INIT_DATA) != 0) {
printk("HWInit (0) failed.\n");
spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
- return(-EAGAIN);
+ return -EIO;
}
SkI2cInit( pAC, pAC->IoBase, SK_INIT_DATA);
SkEventInit(pAC, pAC->IoBase, SK_INIT_DATA);
@@ -551,7 +545,7 @@ SK_BOOL DualNet;
if (SkGeInit(pAC, pAC->IoBase, SK_INIT_IO) != 0) {
printk("sk98lin: HWInit (1) failed.\n");
spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
- return(-EAGAIN);
+ return -EIO;
}
SkI2cInit( pAC, pAC->IoBase, SK_INIT_IO);
SkEventInit(pAC, pAC->IoBase, SK_INIT_IO);
@@ -583,20 +577,20 @@ SK_BOOL DualNet;
} else {
printk(KERN_WARNING "sk98lin: Illegal number of ports: %d\n",
pAC->GIni.GIMacsFound);
- return -EAGAIN;
+ return -EIO;
}
if (Ret) {
printk(KERN_WARNING "sk98lin: Requested IRQ %d is busy.\n",
dev->irq);
- return -EAGAIN;
+ return Ret;
}
pAC->AllocFlag |= SK_ALLOC_IRQ;
/* Alloc memory for this board (Mem for RxD/TxD) : */
if(!BoardAllocMem(pAC)) {
printk("No memory for descriptor rings.\n");
- return(-EAGAIN);
+ return -ENOMEM;
}
BoardInitMem(pAC);
@@ -612,7 +606,7 @@ SK_BOOL DualNet;
DualNet)) {
BoardFreeMem(pAC);
printk("sk98lin: SkGeInitAssignRamToQueues failed.\n");
- return(-EAGAIN);
+ return -EIO;
}
return (0);
@@ -633,8 +627,7 @@ SK_BOOL DualNet;
* SK_TRUE, if all memory could be allocated
* SK_FALSE, if not
*/
-static SK_BOOL BoardAllocMem(
-SK_AC *pAC)
+static __devinit SK_BOOL BoardAllocMem(SK_AC *pAC)
{
caddr_t pDescrMem; /* pointer to descriptor memory area */
size_t AllocLength; /* length of complete descriptor area */
@@ -727,8 +720,7 @@ size_t AllocLength; /* length of comple
*
* Returns: N/A
*/
-static void BoardInitMem(
-SK_AC *pAC) /* pointer to adapter context */
+static __devinit void BoardInitMem(SK_AC *pAC)
{
int i; /* loop counter */
int RxDescrSize; /* the size of a rx descriptor rounded up to alignment*/
@@ -4776,32 +4768,47 @@ static int __devinit skge_probe_one(stru
struct net_device *dev = NULL;
static int boards_found = 0;
int error = -ENODEV;
+ int using_dac = 0;
char DeviceStr[80];
if (pci_enable_device(pdev))
goto out;
/* Configure DMA attributes. */
- if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) &&
- pci_set_dma_mask(pdev, DMA_32BIT_MASK))
- goto out_disable_device;
-
+ if (sizeof(dma_addr_t) > sizeof(u32) &&
+ !(error = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) {
+ using_dac = 1;
+ error = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
+ if (error < 0) {
+ printk(KERN_ERR "sk98lin %s unable to obtain 64 bit DMA "
+ "for consistent allocations\n", pci_name(pdev));
+ goto out_disable_device;
+ }
+ } else {
+ error = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
+ if (error) {
+ printk(KERN_ERR "sk98lin %s no usable DMA configuration\n",
+ pci_name(pdev));
+ goto out_disable_device;
+ }
+ }
- if ((dev = alloc_etherdev(sizeof(DEV_NET))) == NULL) {
- printk(KERN_ERR "Unable to allocate etherdev "
+ error = -ENOMEM;
+ dev = alloc_etherdev(sizeof(DEV_NET));
+ if (!dev) {
+ printk(KERN_ERR "sk98lin: unable to allocate etherdev "
"structure!\n");
goto out_disable_device;
}
pNet = netdev_priv(dev);
- pNet->pAC = kmalloc(sizeof(SK_AC), GFP_KERNEL);
+ pNet->pAC = kzalloc(sizeof(SK_AC), GFP_KERNEL);
if (!pNet->pAC) {
- printk(KERN_ERR "Unable to allocate adapter "
+ printk(KERN_ERR "sk98lin: unable to allocate adapter "
"structure!\n");
goto out_free_netdev;
}
- memset(pNet->pAC, 0, sizeof(SK_AC));
pAC = pNet->pAC;
pAC->PciDev = pdev;
@@ -4810,6 +4817,7 @@ static int __devinit skge_probe_one(stru
pAC->CheckQueue = SK_FALSE;
dev->irq = pdev->irq;
+
error = SkGeInitPCI(pAC);
if (error) {
printk(KERN_ERR "sk98lin: PCI setup failed: %i\n", error);
@@ -4844,19 +4852,25 @@ static int __devinit skge_probe_one(stru
#endif
}
+ if (using_dac)
+ dev->features |= NETIF_F_HIGHDMA;
+
pAC->Index = boards_found++;
- if (SkGeBoardInit(dev, pAC))
+ error = SkGeBoardInit(dev, pAC);
+ if (error)
goto out_free_netdev;
/* Read Adapter name from VPD */
if (ProductStr(pAC, DeviceStr, sizeof(DeviceStr)) != 0) {
+ error = -EIO;
printk(KERN_ERR "sk98lin: Could not read VPD data.\n");
goto out_free_resources;
}
/* Register net device */
- if (register_netdev(dev)) {
+ error = register_netdev(dev);
+ if (error) {
printk(KERN_ERR "sk98lin: Could not register device.\n");
goto out_free_resources;
}
@@ -4883,15 +4897,17 @@ static int __devinit skge_probe_one(stru
boards_found++;
+ pci_set_drvdata(pdev, dev);
+
/* More then one port found */
if ((pAC->GIni.GIMacsFound == 2 ) && (pAC->RlmtNets == 2)) {
- if ((dev = alloc_etherdev(sizeof(DEV_NET))) == 0) {
- printk(KERN_ERR "Unable to allocate etherdev "
+ dev = alloc_etherdev(sizeof(DEV_NET));
+ if (!dev) {
+ printk(KERN_ERR "sk98lin: unable to allocate etherdev "
"structure!\n");
- goto out;
+ goto single_port;
}
- pAC->dev[1] = dev;
pNet = netdev_priv(dev);
pNet->PortNr = 1;
pNet->NetNr = 1;
@@ -4920,20 +4936,28 @@ static int __devinit skge_probe_one(stru
#endif
}
- if (register_netdev(dev)) {
- printk(KERN_ERR "sk98lin: Could not register device for seconf port.\n");
+ if (using_dac)
+ dev->features |= NETIF_F_HIGHDMA;
+
+ error = register_netdev(dev);
+ if (error) {
+ printk(KERN_ERR "sk98lin: Could not register device"
+ " for second port. (%d)\n", error);
free_netdev(dev);
- pAC->dev[1] = pAC->dev[0];
- } else {
- memcpy(&dev->dev_addr,
- &pAC->Addr.Net[1].CurrentMacAddress, 6);
- memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
-
- printk("%s: %s\n", dev->name, DeviceStr);
- printk(" PrefPort:B RlmtMode:Dual Check Link State\n");
+ goto single_port;
}
+
+ pAC->dev[1] = dev;
+ memcpy(&dev->dev_addr,
+ &pAC->Addr.Net[1].CurrentMacAddress, 6);
+ memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
+
+ printk("%s: %s\n", dev->name, DeviceStr);
+ printk(" PrefPort:B RlmtMode:Dual Check Link State\n");
}
+single_port:
+
/* Save the hardware revision */
pAC->HWRevision = (((pAC->GIni.GIPciHwRev >> 4) & 0x0F)*10) +
(pAC->GIni.GIPciHwRev & 0x0F);
@@ -4945,7 +4969,6 @@ static int __devinit skge_probe_one(stru
memset(&pAC->PnmiBackup, 0, sizeof(SK_PNMI_STRUCT_DATA));
memcpy(&pAC->PnmiBackup, &pAC->PnmiStruct, sizeof(SK_PNMI_STRUCT_DATA));
- pci_set_drvdata(pdev, dev);
return 0;
out_free_resources:
diff --git a/drivers/net/smc-ultra.c b/drivers/net/smc-ultra.c
index ba8593a..3db30cd 100644
--- a/drivers/net/smc-ultra.c
+++ b/drivers/net/smc-ultra.c
@@ -168,18 +168,6 @@ static int __init do_ultra_probe(struct
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- /* NB: ultra_close_card() does free_irq */
-#ifdef __ISAPNP__
- struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv;
- if (idev)
- pnp_device_detach(idev);
-#endif
- release_region(dev->base_addr - ULTRA_NIC_OFFSET, ULTRA_IO_EXTENT);
- iounmap(ei_status.mem);
-}
-
#ifndef MODULE
struct net_device * __init ultra_probe(int unit)
{
@@ -594,6 +582,18 @@ init_module(void)
return -ENXIO;
}
+static void cleanup_card(struct net_device *dev)
+{
+ /* NB: ultra_close_card() does free_irq */
+#ifdef __ISAPNP__
+ struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv;
+ if (idev)
+ pnp_device_detach(idev);
+#endif
+ release_region(dev->base_addr - ULTRA_NIC_OFFSET, ULTRA_IO_EXTENT);
+ iounmap(ei_status.mem);
+}
+
void
cleanup_module(void)
{
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index 125ed00..c67c912 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -1564,7 +1564,7 @@ static int __devinit tulip_init_one (str
dev->dev_addr, 6);
}
#endif
-#if defined(__i386__) /* Patch up x86 BIOS bug. */
+#if defined(__i386__) || defined(__x86_64__) /* Patch up x86 BIOS bug. */
if (last_irq)
irq = last_irq;
#endif
diff --git a/drivers/net/wd.c b/drivers/net/wd.c
index b03feae..7caa8dc 100644
--- a/drivers/net/wd.c
+++ b/drivers/net/wd.c
@@ -127,13 +127,6 @@ static int __init do_wd_probe(struct net
return -ENODEV;
}
-static void cleanup_card(struct net_device *dev)
-{
- free_irq(dev->irq, dev);
- release_region(dev->base_addr - WD_NIC_OFFSET, WD_IO_EXTENT);
- iounmap(ei_status.mem);
-}
-
#ifndef MODULE
struct net_device * __init wd_probe(int unit)
{
@@ -538,6 +531,13 @@ init_module(void)
return -ENXIO;
}
+static void cleanup_card(struct net_device *dev)
+{
+ free_irq(dev->irq, dev);
+ release_region(dev->base_addr - WD_NIC_OFFSET, WD_IO_EXTENT);
+ iounmap(ei_status.mem);
+}
+
void
cleanup_module(void)
{
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index 44cd3fc..cf05661 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -7153,7 +7153,7 @@ static int ipw2100_wx_get_range(struct n
/* Set the Wireless Extension versions */
range->we_version_compiled = WIRELESS_EXT;
- range->we_version_source = 16;
+ range->we_version_source = 18;
// range->retry_capa; /* What retry options are supported */
// range->retry_flags; /* How to decode max/min retry limit */
@@ -7184,6 +7184,9 @@ static int ipw2100_wx_get_range(struct n
IW_EVENT_CAPA_MASK(SIOCGIWAP));
range->event_capa[1] = IW_EVENT_CAPA_K_1;
+ range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 |
+ IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP;
+
IPW_DEBUG_WX("GET Range\n");
return 0;
diff --git a/net/ieee80211/ieee80211_crypt_wep.c b/net/ieee80211/ieee80211_crypt_wep.c
index 073aebd..f8dca31 100644
--- a/net/ieee80211/ieee80211_crypt_wep.c
+++ b/net/ieee80211/ieee80211_crypt_wep.c
@@ -75,22 +75,14 @@ static void prism2_wep_deinit(void *priv
kfree(priv);
}
-/* Perform WEP encryption on given skb that has at least 4 bytes of headroom
- * for IV and 4 bytes of tailroom for ICV. Both IV and ICV will be transmitted,
- * so the payload length increases with 8 bytes.
- *
- * WEP frame payload: IV + TX key idx, RC4(data), ICV = RC4(CRC32(data))
- */
-static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
+/* Add WEP IV/key info to a frame that has at least 4 bytes of headroom */
+static int prism2_wep_build_iv(struct sk_buff *skb, int hdr_len, void *priv)
{
struct prism2_wep_data *wep = priv;
- u32 crc, klen, len;
- u8 key[WEP_KEY_LEN + 3];
- u8 *pos, *icv;
- struct scatterlist sg;
-
- if (skb_headroom(skb) < 4 || skb_tailroom(skb) < 4 ||
- skb->len < hdr_len)
+ u32 klen, len;
+ u8 *pos;
+
+ if (skb_headroom(skb) < 4 || skb->len < hdr_len)
return -1;
len = skb->len - hdr_len;
@@ -112,15 +104,47 @@ static int prism2_wep_encrypt(struct sk_
}
/* Prepend 24-bit IV to RC4 key and TX frame */
- *pos++ = key[0] = (wep->iv >> 16) & 0xff;
- *pos++ = key[1] = (wep->iv >> 8) & 0xff;
- *pos++ = key[2] = wep->iv & 0xff;
+ *pos++ = (wep->iv >> 16) & 0xff;
+ *pos++ = (wep->iv >> 8) & 0xff;
+ *pos++ = wep->iv & 0xff;
*pos++ = wep->key_idx << 6;
+ return 0;
+}
+
+/* Perform WEP encryption on given skb that has at least 4 bytes of headroom
+ * for IV and 4 bytes of tailroom for ICV. Both IV and ICV will be transmitted,
+ * so the payload length increases with 8 bytes.
+ *
+ * WEP frame payload: IV + TX key idx, RC4(data), ICV = RC4(CRC32(data))
+ */
+static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
+{
+ struct prism2_wep_data *wep = priv;
+ u32 crc, klen, len;
+ u8 *pos, *icv;
+ struct scatterlist sg;
+ u8 key[WEP_KEY_LEN + 3];
+
+ /* other checks are in prism2_wep_build_iv */
+ if (skb_tailroom(skb) < 4)
+ return -1;
+
+ /* add the IV to the frame */
+ if (prism2_wep_build_iv(skb, hdr_len, priv))
+ return -1;
+
+ /* Copy the IV into the first 3 bytes of the key */
+ memcpy(key, skb->data + hdr_len, 3);
+
/* Copy rest of the WEP key (the secret part) */
memcpy(key + 3, wep->key, wep->key_len);
+
+ len = skb->len - hdr_len - 4;
+ pos = skb->data + hdr_len + 4;
+ klen = 3 + wep->key_len;
- /* Append little-endian CRC32 and encrypt it to produce ICV */
+ /* Append little-endian CRC32 over only the data and encrypt it to produce ICV */
crc = ~crc32_le(~0, pos, len);
icv = skb_put(skb, 4);
icv[0] = crc;
@@ -231,6 +255,7 @@ static struct ieee80211_crypto_ops ieee8
.name = "WEP",
.init = prism2_wep_init,
.deinit = prism2_wep_deinit,
+ .build_iv = prism2_wep_build_iv,
.encrypt_mpdu = prism2_wep_encrypt,
.decrypt_mpdu = prism2_wep_decrypt,
.encrypt_msdu = NULL,
diff --git a/net/ieee80211/ieee80211_tx.c b/net/ieee80211/ieee80211_tx.c
index 445f206..e5b33c8 100644
--- a/net/ieee80211/ieee80211_tx.c
+++ b/net/ieee80211/ieee80211_tx.c
@@ -288,7 +288,7 @@ int ieee80211_xmit(struct sk_buff *skb,
/* Determine total amount of storage required for TXB packets */
bytes = skb->len + SNAP_SIZE + sizeof(u16);
- if (host_encrypt)
+ if (host_encrypt || host_build_iv)
fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA |
IEEE80211_FCTL_PROTECTED;
else
diff --git a/net/ieee80211/ieee80211_wx.c b/net/ieee80211/ieee80211_wx.c
index 181755f..406d5b9 100644
--- a/net/ieee80211/ieee80211_wx.c
+++ b/net/ieee80211/ieee80211_wx.c
@@ -284,7 +284,7 @@ int ieee80211_wx_set_encode(struct ieee8
};
int i, key, key_provided, len;
struct ieee80211_crypt_data **crypt;
- int host_crypto = ieee->host_encrypt || ieee->host_decrypt;
+ int host_crypto = ieee->host_encrypt || ieee->host_decrypt || ieee->host_build_iv;
IEEE80211_DEBUG_WX("SET_ENCODE\n");
^ permalink raw reply related
* Re: [Bcm43xx-dev] [Fwd: State of the Union: Wireless]
From: Ingo Oeser @ 2006-01-09 18:24 UTC (permalink / raw)
To: David S. Miller
Cc: dlang, kaber, marcel, mbuesch, jgarzik, bcm43xx-dev, netdev,
linux-kernel
In-Reply-To: <20060106.141836.41371212.davem@davemloft.net>
David S. Miller wrote:
> From: David Lang <dlang@digitalinsight.com>
> Date: Fri, 6 Jan 2006 14:16:17 -0800 (PST)
>
> > character devices are far easier to script. this really sounds like the
> > type of configuration stuff that sysfs was designed for. can we avoid yet
> > another configuration tool that's required?
>
> netlink is being recommended exactly because it can result
> in only needing one tool for everything
Yes, iproute2 rocks!
I recently discovered that it can do "xfrm" stuff and was amazed to
see that the developer(s) had a big clue about what we like to
see (and what is human readable), if we type "ip xfrm state"
and "ip xfrm policy" as opposed to "setkey -D" and "setkey -PD".
So I can only hope that netlink and iproute will be chosen as a way
to represent it to the user, just because of the clueful developers of
iproute2.
Regards
Ingo Oeser
^ permalink raw reply
* Re: [2.6.15] running tcpdump on 3c905b causes freeze (reproducable)
From: Folkert van Heusden @ 2006-01-09 19:37 UTC (permalink / raw)
To: Andrew Morton; +Cc: netdev, linux-kernel
In-Reply-To: <20060109144522.GB10955@vanheusden.com>
> > Have you tried enabling the NMI watchdog? Enable CONFIG_X86_LOCAL_APIC and
> > boot with `nmi_watchdog=1' on the command line, make sure that the NMI line
> > of /proc/interrupts is incrementing.
> I'll give it a try. I've added it to the append-line in the lilo config.
> Am now compiling the kernel.
No change. Well, that is: the last message on the console now is
"setting eth1 to promiscues mode".
Folkert van Heusden
--
Try MultiTail! Multiple windows with logfiles, filtered with regular
expressions, colored output, etc. etc. www.vanheusden.com/multitail/
----------------------------------------------------------------------
Get your PGP/GPG key signed at www.biglumber.com!
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com
^ permalink raw reply
* Re: [PATCH] netlink oops fix due to incorrect error code
From: Patrick McHardy @ 2006-01-09 23:50 UTC (permalink / raw)
To: Kirill Korotaev, David S. Miller
Cc: Linus Torvalds, Andrew Morton, linux-kernel, Dmitry Mishin,
Stanislav Protassov, Kernel Netdev Mailing List
In-Reply-To: <43C27662.2030400@openvz.org>
Kirill Korotaev wrote:
> Fixed oops after failed netlink socket creation.
> Wrong parathenses in if() statement caused err to be 1,
> instead of negative value.
> Trivial fix, not trivial to find though.
>
> Signed-Off-By: Dmitry Mishin <dim@sw.ru>
> Signed-Off-By: Kirill Korotaev <dev@openvz.org>
Good catch. Dave, please apply.
>
> ------------------------------------------------------------------------
>
> --- ./net/netlink/af_netlink.c.nlfix 2006-01-06 18:37:28.000000000 +0300
> +++ ./net/netlink/af_netlink.c 2006-01-09 16:40:49.000000000 +0300
> @@ -416,7 +416,7 @@ static int netlink_create(struct socket
> groups = nl_table[protocol].groups;
> netlink_unlock_table();
>
> - if ((err = __netlink_create(sock, protocol) < 0))
> + if ((err = __netlink_create(sock, protocol)) < 0)
> goto out_module;
>
> nlk = nlk_sk(sock->sk);
>
^ permalink raw reply
* Re: [PATCH] netlink oops fix due to incorrect error code
From: David S. Miller @ 2006-01-09 23:54 UTC (permalink / raw)
To: kaber; +Cc: dev, torvalds, akpm, linux-kernel, dim, st, netdev
In-Reply-To: <43C2F6DC.7040602@trash.net>
From: Patrick McHardy <kaber@trash.net>
Date: Tue, 10 Jan 2006 00:50:52 +0100
> Kirill Korotaev wrote:
> > Fixed oops after failed netlink socket creation.
> > Wrong parathenses in if() statement caused err to be 1,
> > instead of negative value.
> > Trivial fix, not trivial to find though.
> >
> > Signed-Off-By: Dmitry Mishin <dim@sw.ru>
> > Signed-Off-By: Kirill Korotaev <dev@openvz.org>
>
> Good catch. Dave, please apply.
Already in Linus's tree, he applied it directly :-)
^ permalink raw reply
* [PATCH] happy-meal-pci-probing
From: Jiri Slaby @ 2006-01-10 0:58 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, davem, akpm, jgarzik, netdev
In-Reply-To: <8budr11mfchfp03ncrpqjeck6f04urom8n@4ax.com>
against 2.6.15-mm2
happy-meal-pci-probing
Pci probing functions added, some functions were rewritten.
Use PCI_DEVICE macro.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
commit eb724d05644c4a6fa80fc7f4beaeabfcd7a19905
tree a75be76af0e6a59f2f1526c7cce188403cff63cf
parent 43aabaed0719318490527bd09bc0b0872953c518
author <ku@bellona.(none)> Tue, 10 Jan 2006 01:52:57 +0100
committer <ku@bellona.(none)> Tue, 10 Jan 2006 01:52:57 +0100
drivers/net/sunhme.c | 79 +++++++++++++++++++++++++++++++++++---------------
1 files changed, 55 insertions(+), 24 deletions(-)
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -3013,7 +3013,7 @@ static void get_hme_mac_nonsparc(struct
}
#endif /* !(__sparc__) */
-static int __init happy_meal_pci_init(struct pci_dev *pdev)
+static int __devinit happy_meal_pci_init(struct pci_dev *pdev)
{
struct quattro *qp = NULL;
#ifdef __sparc__
@@ -3073,6 +3073,7 @@ static int __init happy_meal_pci_init(st
memset(hp, 0, sizeof(*hp));
hp->happy_dev = pdev;
+ pci_dev_get(pdev);
spin_lock_init(&hp->happy_lock);
@@ -3260,6 +3261,7 @@ err_out_free_res:
pci_release_regions(pdev);
err_out_clear_quattro:
+ pci_dev_put(pdev);
if (qp != NULL)
qp->happy_meals[qfe_slot] = NULL;
@@ -3304,21 +3306,58 @@ static int __init happy_meal_sbus_probe(
#endif
#ifdef CONFIG_PCI
-static int __init happy_meal_pci_probe(void)
+static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
+ const struct pci_device_id *id)
{
- struct pci_dev *pdev = NULL;
- int cards = 0;
+ int retval;
+
+ retval = pci_enable_device(pdev);
+ if (retval < 0)
+ goto err;
+
+ pci_set_master(pdev);
+ happy_meal_pci_init(pdev);
+
+ return 0;
+err:
+ return retval;
+}
- while ((pdev = pci_find_device(PCI_VENDOR_ID_SUN,
- PCI_DEVICE_ID_SUN_HAPPYMEAL, pdev)) != NULL) {
- if (pci_enable_device(pdev))
- continue;
- pci_set_master(pdev);
- cards++;
- happy_meal_pci_init(pdev);
+static void __devexit happy_meal_pci_remove(struct pci_dev *pdev)
+{
+ struct quattro *tmp, *qp = qfe_pci_list;
+ struct pci_dev *bdev = pdev->bus->self;
+
+ if (qp->quattro_dev == bdev) { /* is it the 1st one? */
+ qfe_pci_list = qp->next;
+ kfree(qp);
+ goto end;
}
- return cards;
+
+ for (; qp->next != NULL; qp = qp->next) /* some further? */
+ if (qp->next->quattro_dev == bdev)
+ break;
+
+ tmp = qp->next; /* kill it, but preserve list */
+ qp->next = qp->next->next;
+ kfree(tmp);
+end:
+ pci_dev_put(pdev);
}
+
+static struct pci_device_id happy_meal_pci_tbl[] = {
+ { PCI_DEVICE(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_HAPPYMEAL) },
+ { 0 }
+};
+MODULE_DEVICE_TABLE(pci, happy_meal_pci_tbl);
+
+static struct pci_driver happy_meal_pci_driver = {
+ .name = "happy_meal_pci",
+ .id_table = happy_meal_pci_tbl,
+ .probe = happy_meal_pci_probe,
+ .remove = __devexit_p(happy_meal_pci_remove)
+};
+
#endif
static int __init happy_meal_probe(void)
@@ -3337,11 +3376,10 @@ static int __init happy_meal_probe(void)
cards += happy_meal_sbus_probe();
#endif
#ifdef CONFIG_PCI
- cards += happy_meal_pci_probe();
+ return pci_register_driver(&happy_meal_pci_driver);
+#else
+ return cards ? 0 : -ENODEV;
#endif
- if (!cards)
- return -ENODEV;
- return 0;
}
@@ -3408,14 +3446,7 @@ static void __exit happy_meal_cleanup_mo
}
#endif
#ifdef CONFIG_PCI
- while (qfe_pci_list) {
- struct quattro *qfe = qfe_pci_list;
- struct quattro *next = qfe->next;
-
- kfree(qfe);
-
- qfe_pci_list = next;
- }
+ pci_unregister_driver(&happy_meal_pci_driver);
#endif
}
^ permalink raw reply
* Re: PROBLEM: bug in e1000 module causes very high CPU load
From: Jesse Brandeburg @ 2006-01-10 2:41 UTC (permalink / raw)
To: Leroy van Logchem; +Cc: linux-kernel, Kernel Netdev Mailing List, ph0x
In-Reply-To: <b7561c4a0512231514y3bd6564jd13d16ea4476f07e@mail.gmail.com>
On 12/23/05, Leroy van Logchem <leroy.vanlogchem@gmail.com> wrote:
> <snip>
> > Yes, let the server act as usual, it just starts happening out of the blue.
> > No new hardware has been added or removed, no new programs has been
> > installed.
>
> "Me too"
<snip>
> Is there a method which can give hints about what was going on during
> the sharply rising load? My guess is that even monitoring/sampling
well, maybe top, maybe you could schedule sar to gather stats on your system.
> aint doable anymore if the bad situation occurs. Tips on obtaining
> information about subjects like:
> - who was using which tcp/udp connection with what bandwidth
i like a utility like iptraf to help with this.
> - who was generating how many read/writes on which filesystem incl. location
hm, thats a little tougher, nfsstat doesn't give that does it.
> - etc etc.
> are more then welcome too. Does using profile=2 and storing
> readprofile output to files every 5 seconds give enough information to
> tacle the source of this problem?
yes, i think that would certainly help figure out what happens at the TOD :-)
you could enable sysrq in order to get a stack after it hung. For
bonus points you can hook up a serial console and dump the state of
all processes with sysrq.
hopefully before it died you would be able to sync your drive and
reboot in order to maximize your chances of fully writing files.
Jesse
^ permalink raw reply
* [PATCH 1/2 RESEND- 2.6.15] net: 32 bit (socket layer) ioctl emulation for 64 bit kernels
From: Shaun Pereira @ 2006-01-10 5:31 UTC (permalink / raw)
To: Arnd Bergmann, Arnaldo Carvalho de Melo, Andi Kleen, linux-kenel,
x25 maintainer, netdev
Cc: SP
Hi Arnd, Arnaldo
Thanks for your comments. I initially did not wish to change any of the
other modules, but based on Arnd's comments I have removed the
extra macro, SOCKOPS_COMPAT_WRAP and use the original SOCKOPS_WRAP.
I'm a bit pressed for time to use the lock_sock() in each of the
functions pointed to by proto_ops, ( getting rid of SOCKS_WRAP
in x25 at the moment), as we are currently building an application
for a telco on linux. Perhaps will try this a bit later, and use the
SOCKOPS_WRAP macro for now. I have made the compat_ioctl function
pointer unconditional in proto_ops as suggested.
Patch 2/2 has the modifications for x25. Any suggestions are welcome.
rgds,
Shaun
diff -uprN -X dontdiff linux-2.6.15-vanilla/include/linux/net.h
linux-2.6.15/include/linux/net.h
--- linux-2.6.15-vanilla/include/linux/net.h 2006-01-03
14:21:10.000000000 +1100
+++ linux-2.6.15/include/linux/net.h 2006-01-10 15:56:55.000000000 +1100
@@ -143,6 +143,8 @@ struct proto_ops {
struct poll_table_struct *wait);
int (*ioctl) (struct socket *sock, unsigned int cmd,
unsigned long arg);
+ int (*compat_ioctl) (struct socket *sock, unsigned int cmd,
+ unsigned long arg);
int (*listen) (struct socket *sock, int len);
int (*shutdown) (struct socket *sock, int flags);
int (*setsockopt)(struct socket *sock, int level,
@@ -247,6 +249,8 @@ SOCKCALL_UWRAP(name, poll, (struct file
(file, sock, wait)) \
SOCKCALL_WRAP(name, ioctl, (struct socket *sock, unsigned int cmd, \
unsigned long arg), (sock, cmd, arg)) \
+SOCKCALL_WRAP(name, compat_ioctl, (struct socket *sock, unsigned int
cmd, \
+ unsigned long arg), (sock, cmd, arg)) \
SOCKCALL_WRAP(name, listen, (struct socket *sock, int len), (sock,
len)) \
SOCKCALL_WRAP(name, shutdown, (struct socket *sock, int flags), (sock,
flags)) \
SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int
optname, \
@@ -271,6 +275,7 @@ static struct proto_ops name##_ops = {
.getname = __lock_##name##_getname, \
.poll = __lock_##name##_poll, \
.ioctl = __lock_##name##_ioctl, \
+ .compat_ioctl = __lock_##name##_compat_ioctl, \
.listen = __lock_##name##_listen, \
.shutdown = __lock_##name##_shutdown, \
.setsockopt = __lock_##name##_setsockopt, \
@@ -279,6 +284,7 @@ static struct proto_ops name##_ops = {
.recvmsg = __lock_##name##_recvmsg, \
.mmap = __lock_##name##_mmap, \
};
+
#endif
#define MODULE_ALIAS_NETPROTO(proto) \
diff -uprN -X dontdiff linux-2.6.15-vanilla/net/appletalk/ddp.c
linux-2.6.15/net/appletalk/ddp.c
--- linux-2.6.15-vanilla/net/appletalk/ddp.c 2006-01-03
14:21:10.000000000 +1100
+++ linux-2.6.15/net/appletalk/ddp.c 2006-01-10 15:56:55.000000000 +1100
@@ -1852,6 +1852,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
.getname = atalk_getname,
.poll = datagram_poll,
.ioctl = atalk_ioctl,
+ .compat_ioctl = NULL,
.listen = sock_no_listen,
.shutdown = sock_no_shutdown,
.setsockopt = sock_no_setsockopt,
diff -uprN -X dontdiff linux-2.6.15-vanilla/net/econet/af_econet.c
linux-2.6.15/net/econet/af_econet.c
--- linux-2.6.15-vanilla/net/econet/af_econet.c 2006-01-03
14:21:10.000000000 +1100
+++ linux-2.6.15/net/econet/af_econet.c 2006-01-10 15:56:55.000000000
+1100
@@ -698,6 +698,7 @@ static struct net_proto_family econet_fa
.owner = THIS_MODULE,
};
+
static struct proto_ops SOCKOPS_WRAPPED(econet_ops) = {
.family = PF_ECONET,
.owner = THIS_MODULE,
@@ -709,6 +710,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
.getname = econet_getname,
.poll = datagram_poll,
.ioctl = econet_ioctl,
+ .compat_ioctl= NULL,
.listen = sock_no_listen,
.shutdown = sock_no_shutdown,
.setsockopt = sock_no_setsockopt,
diff -uprN -X dontdiff linux-2.6.15-vanilla/net/ipx/af_ipx.c
linux-2.6.15/net/ipx/af_ipx.c
--- linux-2.6.15-vanilla/net/ipx/af_ipx.c 2006-01-03 14:21:10.000000000
+1100
+++ linux-2.6.15/net/ipx/af_ipx.c 2006-01-10 15:56:55.000000000 +1100
@@ -1912,6 +1912,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
.getname = ipx_getname,
.poll = datagram_poll,
.ioctl = ipx_ioctl,
+ .compat_ioctl = NULL,
.listen = sock_no_listen,
.shutdown = sock_no_shutdown, /* FIXME: support shutdown */
.setsockopt = ipx_setsockopt,
diff -uprN -X dontdiff linux-2.6.15-vanilla/net/irda/af_irda.c
linux-2.6.15/net/irda/af_irda.c
--- linux-2.6.15-vanilla/net/irda/af_irda.c 2006-01-03
14:21:10.000000000 +1100
+++ linux-2.6.15/net/irda/af_irda.c 2006-01-10 15:56:55.000000000 +1100
@@ -2474,6 +2474,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
.getname = irda_getname,
.poll = irda_poll,
.ioctl = irda_ioctl,
+ .compat_ioctl= NULL,
.listen = irda_listen,
.shutdown = irda_shutdown,
.setsockopt = irda_setsockopt,
@@ -2495,6 +2496,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
.getname = irda_getname,
.poll = datagram_poll,
.ioctl = irda_ioctl,
+ .compat_ioctl= NULL,
.listen = irda_listen,
.shutdown = irda_shutdown,
.setsockopt = irda_setsockopt,
@@ -2516,6 +2518,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
.getname = irda_getname,
.poll = datagram_poll,
.ioctl = irda_ioctl,
+ .compat_ioctl= NULL,
.listen = irda_listen,
.shutdown = irda_shutdown,
.setsockopt = irda_setsockopt,
@@ -2538,6 +2541,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
.getname = irda_getname,
.poll = datagram_poll,
.ioctl = irda_ioctl,
+ .compat_ioctl= NULL,
.listen = sock_no_listen,
.shutdown = irda_shutdown,
.setsockopt = irda_setsockopt,
diff -uprN -X dontdiff linux-2.6.15-vanilla/net/socket.c
linux-2.6.15/net/socket.c
--- linux-2.6.15-vanilla/net/socket.c 2006-01-03 14:21:10.000000000
+1100
+++ linux-2.6.15/net/socket.c 2006-01-10 15:56:55.000000000 +1100
@@ -109,6 +109,10 @@ static unsigned int sock_poll(struct fil
struct poll_table_struct *wait);
static long sock_ioctl(struct file *file,
unsigned int cmd, unsigned long arg);
+#ifdef CONFIG_COMPAT
+static long compat_sock_ioctl(struct file *file,
+ unsigned int cmd, unsigned long arg);
+#endif
static int sock_fasync(int fd, struct file *filp, int on);
static ssize_t sock_readv(struct file *file, const struct iovec
*vector,
unsigned long count, loff_t *ppos);
@@ -130,6 +134,9 @@ static struct file_operations socket_fil
.aio_write = sock_aio_write,
.poll = sock_poll,
.unlocked_ioctl = sock_ioctl,
+#ifdef CONFIG_COMPAT
+ .compat_ioctl = compat_sock_ioctl,
+#endif
.mmap = sock_mmap,
.open = sock_no_open, /* special open code to disallow open via /proc
*/
.release = sock_close,
@@ -2084,6 +2091,20 @@ void socket_seq_show(struct seq_file *se
}
#endif /* CONFIG_PROC_FS */
+#ifdef CONFIG_COMPAT
+static long compat_sock_ioctl(struct file *file, unsigned cmd, unsigned
long arg)
+{
+ struct socket *sock;
+ sock = file->private_data;
+
+ int ret = -ENOIOCTLCMD;
+ if(sock->ops->compat_ioctl) {
+ ret = sock->ops->compat_ioctl(sock,cmd,arg);
+ }
+ return ret;
+}
+#endif
+
/* ABI emulation layers need these two */
EXPORT_SYMBOL(move_addr_to_kernel);
EXPORT_SYMBOL(move_addr_to_user);
diff -uprN -X dontdiff linux-2.6.15-vanilla/net/x25/af_x25.c
linux-2.6.15/net/x25/af_x25.c
--- linux-2.6.15-vanilla/net/x25/af_x25.c 2006-01-03 14:21:10.000000000
+1100
+++ linux-2.6.15/net/x25/af_x25.c 2006-01-10 15:56:55.000000000 +1100
@@ -1391,6 +1391,7 @@ static struct net_proto_family x25_famil
.owner = THIS_MODULE,
};
+
static struct proto_ops SOCKOPS_WRAPPED(x25_proto_ops) = {
.family = AF_X25,
.owner = THIS_MODULE,
@@ -1402,6 +1403,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
.getname = x25_getname,
.poll = datagram_poll,
.ioctl = x25_ioctl,
+ .compat_ioctl= NULL,
.listen = x25_listen,
.shutdown = sock_no_shutdown,
.setsockopt = x25_setsockopt,
^ permalink raw reply
* [PATCH 2/2 - 2.6.15]net:32 bit (socket layer) ioctl emulation for 64 bit kernels
From: Shaun Pereira @ 2006-01-10 5:31 UTC (permalink / raw)
To: Arnd Bergmann, Arnaldo Carvalho de Melo, Andi Kleen, linux-kenel,
x25 maintainer, netdev
Cc: SP
x25 module patch
diff -uprN -X dontdiff linux-2.6.15-vanilla/include/net/x25.h
linux-2.6.15/include/net/x25.h
--- linux-2.6.15-vanilla/include/net/x25.h 2006-01-03 14:21:10.000000000
+1100
+++ linux-2.6.15/include/net/x25.h 2006-01-10 16:15:16.000000000 +1100
@@ -223,6 +223,18 @@ extern struct x25_route *x25_get_route(s
extern struct net_device *x25_dev_get(char *);
extern void x25_route_device_down(struct net_device *dev);
extern int x25_route_ioctl(unsigned int, void __user *);
+
+#ifdef CONFIG_COMPAT
+#include <linux/compat.h>
+
+struct x25_route_struct32{
+ struct x25_address address;
+ compat_uint_t sigdigits;
+ char device[200];
+};
+extern int compat_x25_route_ioctl(unsigned int, struct
x25_route_struct32 __user *);
+#endif
+
extern void x25_route_free(void);
static __inline__ void x25_route_hold(struct x25_route *rt)
diff -uprN -X dontdiff linux-2.6.15-vanilla/net/x25/af_x25.c
linux-2.6.15/net/x25/af_x25.c
--- linux-2.6.15-vanilla/net/x25/af_x25.c 2006-01-10 16:06:29.000000000
+1100
+++ linux-2.6.15/net/x25/af_x25.c 2006-01-10 16:15:16.000000000 +1100
@@ -475,6 +475,12 @@ out:
void x25_init_timers(struct sock *sk);
+#ifdef CONFIG_COMPAT
+#include "x25_ioctl_compat.c"
+#else
+#define compat_x25_ioctl NULL
+#endif
+
static int x25_create(struct socket *sock, int protocol)
{
struct sock *sk;
@@ -1403,7 +1409,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
.getname = x25_getname,
.poll = datagram_poll,
.ioctl = x25_ioctl,
- .compat_ioctl= NULL,
+ .compat_ioctl= compat_x25_ioctl,
.listen = x25_listen,
.shutdown = sock_no_shutdown,
.setsockopt = x25_setsockopt,
diff -uprN -X dontdiff linux-2.6.15-vanilla/net/x25/x25_ioctl_compat.c
linux-2.6.15/net/x25/x25_ioctl_compat.c
--- linux-2.6.15-vanilla/net/x25/x25_ioctl_compat.c 1970-01-01
10:00:00.000000000 +1000
+++ linux-2.6.15/net/x25/x25_ioctl_compat.c 2006-01-10
16:15:16.000000000 +1100
@@ -0,0 +1,264 @@
+#include <linux/compat.h>
+
+struct x25_subscrip_struct32{
+ char device[200-sizeof(compat_ulong_t)];
+ compat_ulong_t global_facil_mask;
+ compat_uint_t extended;
+};
+
+struct x25_facilities32{
+ compat_uint_t winzize_in, winsize_out;
+ compat_uint_t pacsize_in, packsize_out;
+ compat_uint_t throughput;
+ compat_uint_t reverse;
+};
+
+struct x25_calluserdata32 {
+ compat_uint_t cudlength;
+ unsigned char cuddata[128];
+};
+
+struct x25_subaddr32 {
+ compat_uint_t cudmatchlength;
+};
+
+static int compat_x25_subscr_ioctl(unsigned int cmd,
+ struct x25_subscrip_struct32 __user *x25_subscr32)
+{
+ struct x25_subscrip_struct x25_subscr;
+ struct x25_neigh *nb;
+ struct net_device *dev;
+ int rc = -EINVAL;
+
+ if (cmd != SIOCX25GSUBSCRIP && cmd != SIOCX25SSUBSCRIP)
+ goto out;
+
+ rc = -EFAULT;
+ if(copy_from_user(&x25_subscr, x25_subscr32, sizeof(*x25_subscr32)))
+ goto out;
+
+ rc = -EINVAL;
+ if ((dev = x25_dev_get(x25_subscr.device)) == NULL)
+ goto out;
+
+ if ((nb = x25_get_neigh(dev)) == NULL)
+ goto out_dev_put;
+
+ dev_put(dev);
+
+ if(cmd == SIOCX25GSUBSCRIP) {
+ x25_subscr.extended = nb->extended;
+ x25_subscr.global_facil_mask = nb->global_facil_mask;
+ rc = copy_to_user(x25_subscr32, &x25_subscr,
+ sizeof(*x25_subscr32)) ? -EFAULT : 0;
+ } else {
+ rc = -EINVAL;
+ if (!(x25_subscr.extended && x25_subscr.extended != 1)) {
+ rc = 0;
+ nb->extended = x25_subscr.extended;
+ nb->global_facil_mask = x25_subscr.global_facil_mask;
+ }
+ }
+ x25_neigh_put(nb);
+out:
+ return rc;
+out_dev_put:
+ dev_put(dev);
+ goto out;
+}
+
+static int compat_x25_facility_ioctl(struct socket *sock, struct
x25_facilities32 __user *facilities32)
+{
+ struct sock *sk = sock->sk;
+ struct x25_sock *x25 = x25_sk(sk);
+ struct x25_facilities facilities;
+ int rc;
+ rc = -EFAULT;
+ if(copy_from_user(&facilities, facilities32, sizeof(*facilities32)))
+ goto out;
+ rc = -EINVAL;
+ if (sk->sk_state != TCP_LISTEN &&
+ sk->sk_state != TCP_CLOSE)
+ goto out;
+ if (facilities.pacsize_in < X25_PS16 ||
+ facilities.pacsize_in > X25_PS4096)
+ goto out;
+ if (facilities.pacsize_out < X25_PS16 ||
+ facilities.pacsize_out > X25_PS4096)
+ goto out;
+ if (facilities.winsize_in < 1 ||
+ facilities.winsize_in > 127)
+ goto out;
+ if (facilities.throughput < 0x03 ||
+ facilities.throughput > 0xDD)
+ goto out;
+ if (facilities.reverse &&
+ (facilities.reverse | 0x81)!= 0x81)
+ goto out;
+ x25->facilities = facilities;
+ rc = 0;
+out :
+ return rc;
+}
+
+static int compat_x25_get_facility_ioctl(struct socket *sock, struct
x25_facilities32 __user *facility32)
+{
+ struct sock *sk = sock->sk;
+ struct x25_sock *x25 = x25_sk(sk);
+ struct x25_facilities fac = x25->facilities;
+ int rc;
+
+ rc = copy_to_user(facility32, &fac, sizeof(fac)) ? -EFAULT : 0;
+ return rc;
+}
+
+static int compat_x25_cud_ioctl(struct socket *sock, struct
x25_calluserdata32 __user *calluserdata32)
+{
+ struct sock *sk = sock->sk;
+ struct x25_sock *x25 = x25_sk(sk);
+ struct x25_calluserdata calluserdata;
+ int rc;
+
+ rc = -EFAULT;
+ if(copy_from_user(&calluserdata, calluserdata32, sizeof
(*calluserdata32)))
+ goto out;
+
+ rc = -EINVAL;
+ if (calluserdata.cudlength > X25_MAX_CUD_LEN)
+ goto out;
+
+ x25->calluserdata = calluserdata;
+ rc = 0;
+out:
+ return rc;
+}
+
+static int compat_x25_get_cud_ioctl(struct socket *sock, struct
x25_calluserdata32 __user *calluserdata32)
+{
+ struct sock *sk = sock->sk;
+ struct x25_sock *x25 = x25_sk(sk);
+ struct x25_calluserdata cud = x25->calluserdata;
+ int rc;
+
+ rc = copy_to_user(calluserdata32, &cud, sizeof(cud))? -EFAULT : 0;
+ return rc;
+}
+
+static int compat_x25_cud_match_ioctl(struct socket *sock, struct
x25_subaddr32 __user *sub_addr32)
+{
+ struct sock *sk = sock->sk;
+ struct x25_sock *x25 = x25_sk(sk);
+ struct x25_subaddr sub_addr;
+ int rc;
+
+ rc = -EINVAL;
+ if(sk->sk_state != TCP_CLOSE)
+ goto out;
+ rc = -EFAULT;
+ if(copy_from_user(&sub_addr, sub_addr32, sizeof(*sub_addr32)))
+ goto out;
+ rc = -EINVAL;
+ if(sub_addr.cudmatchlength > X25_MAX_CUD_LEN)
+ goto out;
+ x25->cudmatchlength = sub_addr.cudmatchlength;
+ rc = 0;
+out:
+ return rc;
+}
+
+static int compat_x25_accept_ctrl(struct socket *sock, unsigned int
cmd)
+{
+ struct sock *sk = sock->sk;
+ struct x25_sock *x25 = x25_sk(sk);
+ int rc = -EINVAL;
+
+ switch(cmd){
+
+ case SIOCX25CALLACCPTAPPRV: {
+ rc = -EINVAL;
+ if (sk->sk_state != TCP_CLOSE)
+ break;
+ x25->accptapprv = X25_ALLOW_ACCPT_APPRV;
+ rc = 0;
+ break;
+ }
+
+ case SIOCX25SENDCALLACCPT: {
+ rc = -EINVAL;
+ if (sk->sk_state != TCP_ESTABLISHED)
+ break;
+ if (x25->accptapprv)
+ break;
+ x25_write_internal(sk, X25_CALL_ACCEPTED);
+ x25->state = X25_STATE_3;
+ rc = 0;
+ break;
+ }
+ }
+ return rc;
+}
+
+static int compat_x25_ioctl(struct socket *sock, unsigned int cmd,
unsigned long arg)
+{
+ void __user *argp = compat_ptr(arg);
+ int rc = -ENOIOCTLCMD;
+
+ switch(cmd) {
+ case TIOCOUTQ:
+ case TIOCINQ:
+ case SIOCGSTAMP:
+ case SIOCGIFADDR:
+ case SIOCSIFADDR:
+ case SIOCGIFDSTADDR:
+ case SIOCSIFDSTADDR:
+ case SIOCGIFBRDADDR:
+ case SIOCSIFBRDADDR:
+ case SIOCGIFNETMASK:
+ case SIOCSIFNETMASK:
+ case SIOCGIFMETRIC:
+ case SIOCSIFMETRIC:
+ case SIOCADDRT:
+ case SIOCDELRT:
+ rc = -EPERM;
+ if (!capable(CAP_NET_ADMIN))
+ break;
+ rc = compat_x25_route_ioctl(cmd, argp);
+ break;
+ case SIOCX25GSUBSCRIP:
+ rc = compat_x25_subscr_ioctl(cmd, argp);
+ break;
+ case SIOCX25SSUBSCRIP:
+ rc = -EPERM;
+ if (!capable(CAP_NET_ADMIN))
+ break;
+ rc = compat_x25_subscr_ioctl(cmd, argp);
+ break;
+ case SIOCX25GFACILITIES:
+ rc = compat_x25_get_facility_ioctl(sock, argp);
+ break;
+ case SIOCX25SFACILITIES:
+ rc = compat_x25_facility_ioctl(sock, argp);
+ break;
+ case SIOCX25GCALLUSERDATA:
+ rc = compat_x25_get_cud_ioctl(sock, argp);
+ break;
+ case SIOCX25SCALLUSERDATA:
+ rc = compat_x25_cud_ioctl(sock, argp);
+ break;
+ case SIOCX25GCAUSEDIAG:
+ case SIOCX25SCUDMATCHLEN:
+ rc = compat_x25_cud_match_ioctl(sock,argp);
+ break;
+ case SIOCX25CALLACCPTAPPRV:
+ rc = compat_x25_accept_ctrl(sock,SIOCX25CALLACCPTAPPRV);
+ break;
+ case SIOCX25SENDCALLACCPT:
+ rc = compat_x25_accept_ctrl(sock,SIOCX25SENDCALLACCPT);
+ break;
+ default:
+ rc = -ENOIOCTLCMD;
+ break;
+ }
+
+ return rc;
+}
diff -uprN -X dontdiff linux-2.6.15-vanilla/net/x25/x25_route.c
linux-2.6.15/net/x25/x25_route.c
--- linux-2.6.15-vanilla/net/x25/x25_route.c 2006-01-03
14:21:10.000000000 +1100
+++ linux-2.6.15/net/x25/x25_route.c 2006-01-10 16:15:16.000000000 +1100
@@ -204,6 +204,36 @@ out:
return rc;
}
+#ifdef CONFIG_COMPAT
+
+int compat_x25_route_ioctl(unsigned int cmd, struct x25_route_struct32
__user *rt32)
+{
+ struct x25_route_struct rt;
+ struct net_device *dev;
+ int rc = -EINVAL;
+
+ if (cmd != SIOCADDRT && cmd != SIOCDELRT)
+ goto out;
+
+ rc = -EFAULT;
+ if(copy_from_user(&rt, rt32, sizeof(*rt32)))
+ goto out;
+
+ dev = x25_dev_get(rt.device);
+ if (!dev)
+ goto out;
+
+ if (cmd == SIOCADDRT)
+ rc = x25_add_route(&rt.address, rt.sigdigits, dev);
+ else
+ rc = x25_del_route(&rt.address, rt.sigdigits, dev);
+ dev_put(dev);
+out:
+ return rc;
+
+}
+#endif
+
/*
* Release all memory associated with X.25 routing structures.
*/
^ permalink raw reply
* [2.6.15 patch] wireless/atmel: add IWENCODEEXT, IWAUTH, and association event support
From: Dan Williams @ 2006-01-10 5:56 UTC (permalink / raw)
To: simon; +Cc: netdev, jgarzik
Hi,
This patch allows the Atmel driver to work correctly with wpa_supplicant
and other programs that require some conformance with WEXT-18. It
should not affect current behavior of the driver. The patch does four
things:
1) Implements SIOCSIWENCODEEXT, SIOCGIWENCODEEXT, SIOCSIWAUTH, and
SIOCGIWAUTH calls for unencrypted and WEP operation
2) Accepts zero-filled addresses for SIOCSIWAP, which are legal and
should turn off any previous forced WAP address
3) Sends association and de-association events to userspace at most of
the appropriate times
4) Fixes erroneous order of CIPHER_SUITE_WEP_* arguments in one location
which are actually unused anyway
Signed-off-by: Dan Williams <dcbw@redhat.com>
--- a/drivers/net/wireless/atmel.c 2006-01-09 12:45:00.000000000 -0500
+++ b/drivers/net/wireless/atmel.c 2006-01-10 00:10:46.000000000 -0500
@@ -1407,6 +1407,17 @@
{
struct atmel_private *priv = netdev_priv(dev);
+ /* Send event to userspace that we are disassociating */
+ if (priv->station_state == STATION_STATE_READY) {
+ union iwreq_data wrqu;
+
+ wrqu.data.length = 0;
+ wrqu.data.flags = 0;
+ wrqu.ap_addr.sa_family = ARPHRD_ETHER;
+ memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN);
+ wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
+ }
+
atmel_enter_state(priv, STATION_STATE_DOWN);
if (priv->bus_type == BUS_TYPE_PCCARD)
@@ -1780,10 +1791,10 @@
priv->wep_is_on = 1;
priv->exclude_unencrypted = 1;
if (priv->wep_key_len[index] > 5) {
- priv->pairwise_cipher_suite = CIPHER_SUITE_WEP_64;
+ priv->pairwise_cipher_suite = CIPHER_SUITE_WEP_128;
priv->encryption_level = 2;
} else {
- priv->pairwise_cipher_suite = CIPHER_SUITE_WEP_128;
+ priv->pairwise_cipher_suite = CIPHER_SUITE_WEP_64;
priv->encryption_level = 1;
}
}
@@ -1853,6 +1864,181 @@
return 0;
}
+static int atmel_set_encodeext(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu,
+ char *extra)
+{
+ struct atmel_private *priv = netdev_priv(dev);
+ struct iw_point *encoding = &wrqu->encoding;
+ struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
+ int idx, key_len;
+
+ /* Determine and validate the key index */
+ idx = encoding->flags & IW_ENCODE_INDEX;
+ if (idx) {
+ if (idx < 1 || idx > WEP_KEYS)
+ return -EINVAL;
+ idx--;
+ } else
+ idx = priv->default_key;
+
+ if ((encoding->flags & IW_ENCODE_DISABLED) ||
+ ext->alg == IW_ENCODE_ALG_NONE) {
+ priv->wep_is_on = 0;
+ priv->encryption_level = 0;
+ priv->pairwise_cipher_suite = CIPHER_SUITE_NONE;
+ }
+
+ if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY)
+ priv->default_key = idx;
+
+ /* Set the requested key */
+ switch (ext->alg) {
+ case IW_ENCODE_ALG_NONE:
+ break;
+ case IW_ENCODE_ALG_WEP:
+ if (ext->key_len > 5) {
+ priv->wep_key_len[idx] = 13;
+ priv->pairwise_cipher_suite = CIPHER_SUITE_WEP_128;
+ priv->encryption_level = 2;
+ } else if (ext->key_len > 0) {
+ priv->wep_key_len[idx] = 5;
+ priv->pairwise_cipher_suite = CIPHER_SUITE_WEP_64;
+ priv->encryption_level = 1;
+ } else {
+ return -EINVAL;
+ }
+ priv->wep_is_on = 1;
+ memset(priv->wep_keys[idx], 0, 13);
+ key_len = min ((int)ext->key_len, priv->wep_key_len[idx]);
+ memcpy(priv->wep_keys[idx], ext->key, key_len);
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ return -EINPROGRESS;
+}
+
+static int atmel_get_encodeext(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu,
+ char *extra)
+{
+ struct atmel_private *priv = netdev_priv(dev);
+ struct iw_point *encoding = &wrqu->encoding;
+ struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
+ int idx, max_key_len;
+
+ max_key_len = encoding->length - sizeof(*ext);
+ if (max_key_len < 0)
+ return -EINVAL;
+
+ idx = encoding->flags & IW_ENCODE_INDEX;
+ if (idx) {
+ if (idx < 1 || idx > WEP_KEYS)
+ return -EINVAL;
+ idx--;
+ } else
+ idx = priv->default_key;
+
+ encoding->flags = idx + 1;
+ memset(ext, 0, sizeof(*ext));
+
+ if (!priv->wep_is_on) {
+ ext->alg = IW_ENCODE_ALG_NONE;
+ ext->key_len = 0;
+ encoding->flags |= IW_ENCODE_DISABLED;
+ } else {
+ if (priv->encryption_level > 0)
+ ext->alg = IW_ENCODE_ALG_WEP;
+ else
+ return -EINVAL;
+
+ ext->key_len = priv->wep_key_len[idx];
+ memcpy(ext->key, priv->wep_keys[idx], ext->key_len);
+ encoding->flags |= IW_ENCODE_ENABLED;
+ }
+
+ return 0;
+}
+
+static int atmel_set_auth(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
+{
+ struct atmel_private *priv = netdev_priv(dev);
+ struct iw_param *param = &wrqu->param;
+
+ switch (param->flags & IW_AUTH_INDEX) {
+ case IW_AUTH_WPA_VERSION:
+ case IW_AUTH_CIPHER_PAIRWISE:
+ case IW_AUTH_CIPHER_GROUP:
+ case IW_AUTH_KEY_MGMT:
+ case IW_AUTH_RX_UNENCRYPTED_EAPOL:
+ case IW_AUTH_PRIVACY_INVOKED:
+ /*
+ * atmel does not use these parameters
+ */
+ break;
+
+ case IW_AUTH_DROP_UNENCRYPTED:
+ priv->exclude_unencrypted = param->value ? 1 : 0;
+ break;
+
+ case IW_AUTH_80211_AUTH_ALG: {
+ if (param->value & IW_AUTH_ALG_SHARED_KEY) {
+ priv->exclude_unencrypted = 1;
+ } else if (param->value & IW_AUTH_ALG_OPEN_SYSTEM) {
+ priv->exclude_unencrypted = 0;
+ } else
+ return -EINVAL;
+ break;
+ }
+
+ case IW_AUTH_WPA_ENABLED:
+ /* Silently accept disable of WPA */
+ if (param->value > 0)
+ return -EOPNOTSUPP;
+ break;
+
+ default:
+ return -EOPNOTSUPP;
+ }
+ return -EINPROGRESS;
+}
+
+static int atmel_get_auth(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
+{
+ struct atmel_private *priv = netdev_priv(dev);
+ struct iw_param *param = &wrqu->param;
+
+ switch (param->flags & IW_AUTH_INDEX) {
+ case IW_AUTH_DROP_UNENCRYPTED:
+ param->value = priv->exclude_unencrypted;
+ break;
+
+ case IW_AUTH_80211_AUTH_ALG:
+ if (priv->exclude_unencrypted == 1)
+ param->value = IW_AUTH_ALG_SHARED_KEY;
+ else
+ param->value = IW_AUTH_ALG_OPEN_SYSTEM;
+ break;
+
+ case IW_AUTH_WPA_ENABLED:
+ param->value = 0;
+ break;
+
+ default:
+ return -EOPNOTSUPP;
+ }
+ return 0;
+}
+
+
static int atmel_get_name(struct net_device *dev,
struct iw_request_info *info,
char *cwrq,
@@ -2289,13 +2475,15 @@
{
struct atmel_private *priv = netdev_priv(dev);
int i;
- static const u8 bcast[] = { 255, 255, 255, 255, 255, 255 };
+ static const u8 any[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
+ static const u8 off[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
unsigned long flags;
if (awrq->sa_family != ARPHRD_ETHER)
return -EINVAL;
- if (memcmp(bcast, awrq->sa_data, 6) == 0) {
+ if (!memcmp(any, awrq->sa_data, 6) ||
+ !memcmp(off, awrq->sa_data, 6)) {
del_timer_sync(&priv->management_timer);
spin_lock_irqsave(&priv->irqlock, flags);
atmel_scan(priv, 1);
@@ -2378,6 +2566,15 @@
(iw_handler) atmel_get_encode, /* SIOCGIWENCODE */
(iw_handler) atmel_set_power, /* SIOCSIWPOWER */
(iw_handler) atmel_get_power, /* SIOCGIWPOWER */
+ (iw_handler) NULL, /* -- hole -- */
+ (iw_handler) NULL, /* -- hole -- */
+ (iw_handler) NULL, /* SIOCSIWGENIE */
+ (iw_handler) NULL, /* SIOCGIWGENIE */
+ (iw_handler) atmel_set_auth, /* SIOCSIWAUTH */
+ (iw_handler) atmel_get_auth, /* SIOCGIWAUTH */
+ (iw_handler) atmel_set_encodeext, /* SIOCSIWENCODEEXT */
+ (iw_handler) atmel_get_encodeext, /* SIOCGIWENCODEEXT */
+ (iw_handler) NULL, /* SIOCSIWPMKSA */
};
static const iw_handler atmel_private_handler[] =
@@ -2924,6 +3121,8 @@
u16 ass_id = le16_to_cpu(ass_resp->ass_id);
u16 rates_len = ass_resp->length > 4 ? 4 : ass_resp->length;
+ union iwreq_data wrqu;
+
if (frame_len < 8 + rates_len)
return;
@@ -2954,6 +3153,14 @@
priv->station_is_associated = 1;
priv->station_was_associated = 1;
atmel_enter_state(priv, STATION_STATE_READY);
+
+ /* Send association event to userspace */
+ wrqu.data.length = 0;
+ wrqu.data.flags = 0;
+ memcpy(wrqu.ap_addr.sa_data, priv->CurrentBSSID, ETH_ALEN);
+ wrqu.ap_addr.sa_family = ARPHRD_ETHER;
+ wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
+
return;
}
@@ -3632,6 +3839,7 @@
struct atmel_private *priv = netdev_priv(dev);
u8 configuration;
+ int old_state = priv->station_state;
/* data to add to the firmware names, in priority order
this implemenents firmware versioning */
@@ -3792,6 +4000,17 @@
else
build_wep_mib(priv);
+ if (old_state == STATION_STATE_READY)
+ {
+ union iwreq_data wrqu;
+
+ wrqu.data.length = 0;
+ wrqu.data.flags = 0;
+ wrqu.ap_addr.sa_family = ARPHRD_ETHER;
+ memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN);
+ wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
+ }
+
return 1;
}
^ permalink raw reply
* RFC: kill acx100-devel, migrate to netdev@vger.kernel.org
From: Denis Vlasenko @ 2006-01-10 6:29 UTC (permalink / raw)
To: acx100-devel; +Cc: netdev
Hi folks,
Please read http://lkml.org/lkml/2006/1/5/671
What about moving all acx development discussion
to netdev@vger.kernel.org?
If yes, can acx100-devel address be automatically
redirected?
--
vda
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
^ permalink raw reply
* Re: State of the Union: Wireless
From: Denis Vlasenko @ 2006-01-10 6:39 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev, linux-kernel, acx100-devel
In-Reply-To: <20060106042218.GA18974@havoc.gtf.org>
On Friday 06 January 2006 06:22, Jeff Garzik wrote:
>
> State of the Union - Wireless
> January 5, 2006
[ snip ]
> * Wireless drivers and the wireless stack need to be maintained IN-TREE
> as a COLLECTIVE ENTITY, not piecemeal maintenance as its done now.
>
> The whole point of working in-tree, the whole point of this open source
> thing is that everybody works on the same code, and the entire Internet
> is your test bed. Quality improves the more people work together.
> The entire Linux kernel engineering process is focused on getting core
> kernel code out to distributions (then to end users) and power users.
> Out-of-tree code breaks that model, breaking the It Just Works(tm)
> theme applicable to other Linux-supported hardware.
Cool, so may I please know why acx driver is not included in the mainline?
In case it needs more work, well, (a) at least tell us what exactly
you want improved, and (b) why do you think that in-tree acx would not
be improved? It will get more visibility, maybe some people will
get interested and will send a patch or two to us...
> * Release early, release often. Pushing from an external repository to
> the official kernel tree every few months creates more problems
> than it solves. Out-of-tree drivers fail to take advantage of
> recent kernel changes and coding practices, which leads to bugs and
> incompatibilities. Slow pushing leads to huge periodic updates,
> which are awful for debugging, testing, and general use.
I want to avoid exactly this, and therefore want acx in mainline.
> * ALL wireless stacks need work. It is currently fashionable to laud
> DeviceScape and trash in-kernel ieee80211, but outside of the
> cheerleading, BOTH have real technical issues that need addressing.
> IOW, no matter what code is chosen, _somebody_ is on the hook for
> a fair amount of work. A switch is not without its costs.
>
> * I would prefer that people patch the in-tree ieee80211 code,
> probably in the direction of Jiri Benc's proposed ieee80211_device
> direction. I take patches from all parties, not just Intel.
>
> * However, if the engineering reasons for switching to DeviceScape
> or another wireless stack are powerful enough to overcome Linux's
> "no big patches, evolve it" maxim, great! But make sure to work
> on converting drivers to this new stack. The wireless drivers and
> wireless stack should evolve in tandem. Otherwise, drivers get
> left behind, grow moldy, and Linux users suffer.
How are we going to find out which stack is best and which stack
we should concentrate our efforts on? In an absense of wifi maintainer,
maybe we should throw _all stacks_ (currently two) into the mainline,
and evolution will find the best one. Yes, it would be a bit ugly
at first, but I hope it will speed up evolution a lot.
Let current stack sit in include/net/ieee80211*.h and net/ieee80211/*,
add dcape one into include/net/wlan*.h and net/wlan/*
(s/wlan/dscape/ or whatever)
We can even give Devicescape folks blanket permissions to
maintain their stack in include/net/wlan*.h and net/wlan/*.
Maybe they can act as a wifi maintainer long term.
Existing drivers won't need to closely track every change
in dscape stack. If dscape will survive, old drivers can be
converted to it gradually. If not, just dike it out.
> * Feel free to submit radical changes -- wireless is yet young --
> just make sure all drivers keep working from release to release.
>
> * Long term, wireless should go from being a library of common code to a
> "real" wireless stack, as shown in the template developed by David Miller:
> http://kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.6/davem-p80211.tar.bz2
> Zhu Yi @ Intel and Vladmir @ somewhere both independently did some
> work in this area.
>
> * Please CC wireless stack/driver discussions to netdev@vger.kernel.org
> mailing list, rather than everybody hiding in their own little
> corner.
[snip]
> So... there it is. We suck. There's hope. No Luke Skywalker in sight.
> I hope we can avoid being slaves to fashion, by merging a rewrite, but
> that way be the way to go.
--
vda
^ permalink raw reply
* Re: [2.6.15] running tcpdump on 3c905b causes freeze (reproducable)
From: Andrew Morton @ 2006-01-10 6:48 UTC (permalink / raw)
To: Folkert van Heusden; +Cc: netdev, linux-kernel
In-Reply-To: <20060109193754.GD12673@vanheusden.com>
Folkert van Heusden <folkert@vanheusden.com> wrote:
>
> > > Have you tried enabling the NMI watchdog? Enable CONFIG_X86_LOCAL_APIC and
> > > boot with `nmi_watchdog=1' on the command line, make sure that the NMI line
> > > of /proc/interrupts is incrementing.
> > I'll give it a try. I've added it to the append-line in the lilo config.
> > Am now compiling the kernel.
>
> No change. Well, that is: the last message on the console now is
> "setting eth1 to promiscues mode".
>
Did you confirm that the NMI counters in /proc/interrupts are incrementing?
^ permalink raw reply
* Re: State of the Union: Wireless
From: Chase Venters @ 2006-01-10 8:36 UTC (permalink / raw)
To: Denis Vlasenko; +Cc: Jeff Garzik, netdev, linux-kernel, acx100-devel
In-Reply-To: <200601100839.26052.vda@ilport.com.ua>
On Tuesday 10 January 2006 00:39, Denis Vlasenko wrote:
> How are we going to find out which stack is best and which stack
> we should concentrate our efforts on? In an absense of wifi maintainer,
> maybe we should throw _all stacks_ (currently two) into the mainline,
> and evolution will find the best one. Yes, it would be a bit ugly
> at first, but I hope it will speed up evolution a lot.
>
> Let current stack sit in include/net/ieee80211*.h and net/ieee80211/*,
> add dcape one into include/net/wlan*.h and net/wlan/*
> (s/wlan/dscape/ or whatever)
>
> We can even give Devicescape folks blanket permissions to
> maintain their stack in include/net/wlan*.h and net/wlan/*.
> Maybe they can act as a wifi maintainer long term.
>
> Existing drivers won't need to closely track every change
> in dscape stack. If dscape will survive, old drivers can be
> converted to it gradually. If not, just dike it out.
I don't like the idea of maintaining two of anything. What if I have two
wireless interfaces, each using a different stack?
Performance--,
Kernel size++
I get that it's hard to get everyone to agree on one stack or another, but we
need to make the decision now because the longer we don't have a decision
made (this includes maintaining two in-tree stacks) the longer it's going to
take us to have serious / robust / reliable / consistent wireless support.
I know basically nothing about 802.11, but it seems to me that what should
happen is that if there is sufficient motivation to boot ieee80211 in favor
of DeviceScape, someone should cook up the patches.
Besides, assume we did bless two stacks. Every new driver / driver that wanted
to go mainline would choose one or another (it's already clear that people
disagree). Thus we end up with *more* work to do in order to decide one way
or another (since we have to partially break & fully port all the drivers
from one stack to another).
There's incompatibility all over this wireless landscape. The best way to deal
with it is to make all the big hard decisions now - say "this is the way it's
going to be" and work from there. We can always undo mistakes later, but
we'll never get to that point if we don't start moving in one direction
instead of ten.
> --
> vda
> -
Cheers,
Chase
^ permalink raw reply
* [PATCH] net: fix PRIO qdisc bands init
From: Amnon Aaronsohn @ 2006-01-10 10:30 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
The PRIO queuing discipline currently initializes only the bands
that appear in the priomap. It should instead initialize all the
configured bands.
Signed-off-by: Amnon Aaronsohn <bla@cs.huji.ac.il>
---
--- linux-2.6.14/net/sched/sch_prio.c 2005-10-28 02:02:08.000000000 +0200
+++ work-2.6.14/net/sched/sch_prio.c 2006-01-10 12:02:20.000000000 +0200
@@ -227,14 +227,13 @@ static int prio_tune(struct Qdisc *sch,
}
sch_tree_unlock(sch);
- for (i=0; i<=TC_PRIO_MAX; i++) {
- int band = q->prio2band[i];
- if (q->queues[band] == &noop_qdisc) {
+ for (i=0; i<q->bands; i++) {
+ if (q->queues[i] == &noop_qdisc) {
struct Qdisc *child;
child = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops);
if (child) {
sch_tree_lock(sch);
- child = xchg(&q->queues[band], child);
+ child = xchg(&q->queues[i], child);
if (child != &noop_qdisc)
qdisc_destroy(child);
^ permalink raw reply
* Re: Re: State of the Union: Wireless
From: Andreas Mohr @ 2006-01-10 10:41 UTC (permalink / raw)
To: acx100-devel; +Cc: Jeff Garzik, netdev, linux-kernel
In-Reply-To: <200601100839.26052.vda@ilport.com.ua>
Hi,
On Tue, Jan 10, 2006 at 08:39:25AM +0200, Denis Vlasenko wrote:
> On Friday 06 January 2006 06:22, Jeff Garzik wrote:
> >
> > State of the Union - Wireless
> > January 5, 2006
>
> [ snip ]
>
> > * Wireless drivers and the wireless stack need to be maintained IN-TREE
> > as a COLLECTIVE ENTITY, not piecemeal maintenance as its done now.
> >
> > The whole point of working in-tree, the whole point of this open source
> > thing is that everybody works on the same code, and the entire Internet
> > is your test bed. Quality improves the more people work together.
> > The entire Linux kernel engineering process is focused on getting core
> > kernel code out to distributions (then to end users) and power users.
> > Out-of-tree code breaks that model, breaking the It Just Works(tm)
> > theme applicable to other Linux-supported hardware.
>
> Cool, so may I please know why acx driver is not included in the mainline?
> In case it needs more work, well, (a) at least tell us what exactly
> you want improved, and (b) why do you think that in-tree acx would not
> be improved? It will get more visibility, maybe some people will
> get interested and will send a patch or two to us...
I think wording is a tad bit too aggressive here, since we (well, at least me)
haven't made many efforts to get it included, since we had to work out
some things. However at this point we should really go for inclusion,
the sooner the better (right?).
> > * Release early, release often. Pushing from an external repository to
> > the official kernel tree every few months creates more problems
> > than it solves. Out-of-tree drivers fail to take advantage of
> > recent kernel changes and coding practices, which leads to bugs and
> > incompatibilities. Slow pushing leads to huge periodic updates,
> > which are awful for debugging, testing, and general use.
>
> I want to avoid exactly this, and therefore want acx in mainline.
ACK.
> How are we going to find out which stack is best and which stack
> we should concentrate our efforts on? In an absense of wifi maintainer,
> maybe we should throw _all stacks_ (currently two) into the mainline,
> and evolution will find the best one. Yes, it would be a bit ugly
> at first, but I hope it will speed up evolution a lot.
I have to admit that a big item on our acx ToDo list was the missing ieee80211
integration, but now that there's a second stack on the horizon and things
look less decided I'm not that much troubled by our lack of ieee80211 use
any more ;)
That said, of course we should try to get rid of our own, historic (originating
from binary TI driver!) in-driver stack very soon.
I won't do any comments on which stack to use, though, I will do research first
and then work out which one to use depending on popularity and features
matching our chips' properties.
Andreas Mohr
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
^ permalink raw reply
* Re: [PATCH 1/2 RESEND- 2.6.15] net: 32 bit (socket layer) ioctl emulation for 64 bit kernels
From: Arnd Bergmann @ 2006-01-10 12:03 UTC (permalink / raw)
To: spereira
Cc: Arnaldo Carvalho de Melo, Andi Kleen, linux-kenel, x25 maintainer,
netdev, SP
In-Reply-To: <1136871078.5742.26.camel@spereira05.tusc.com.au>
On Tuesday 10 January 2006 05:31, Shaun Pereira wrote:
> Hi Arnd, Arnaldo
> Thanks for your comments. I initially did not wish to change any of the
> other modules, but based on Arnd's comments I have removed the
> extra macro, SOCKOPS_COMPAT_WRAP and use the original SOCKOPS_WRAP.
Ok, looks better now. Just a few tiny style comments:
> +++ linux-2.6.15/net/appletalk/ddp.c 2006-01-10 15:56:55.000000000 +1100
> @@ -1852,6 +1852,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
> .getname = atalk_getname,
> .poll = datagram_poll,
> .ioctl = atalk_ioctl,
> + .compat_ioctl = NULL,
> .listen = sock_no_listen,
> .shutdown = sock_no_shutdown,
> .setsockopt = sock_no_setsockopt,
No need to set .compat_ioctl to NULL, that's what it already is when you
don't assign it at all. Leaving it out makes it easier to grep for users.
> @@ -709,6 +710,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
> .getname = econet_getname,
> .poll = datagram_poll,
> .ioctl = econet_ioctl,
> + .compat_ioctl= NULL,
> .listen = sock_no_listen,
> .shutdown = sock_no_shutdown,
> .setsockopt = sock_no_setsockopt,
> diff -uprN -X dontdiff linux-2.6.15-vanilla/net/ipx/af_ipx.c
> linux-2.6.15/net/ipx/af_ipx.c
> --- linux-2.6.15-vanilla/net/ipx/af_ipx.c 2006-01-03 14:21:10.000000000
> +1100
> +++ linux-2.6.15/net/ipx/af_ipx.c 2006-01-10 15:56:55.000000000 +1100
> @@ -1912,6 +1912,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
> .getname = ipx_getname,
> .poll = datagram_poll,
> .ioctl = ipx_ioctl,
> + .compat_ioctl = NULL,
> .listen = sock_no_listen,
> .shutdown = sock_no_shutdown, /* FIXME: support shutdown */
> .setsockopt = ipx_setsockopt,
> diff -uprN -X dontdiff linux-2.6.15-vanilla/net/irda/af_irda.c
> linux-2.6.15/net/irda/af_irda.c
> --- linux-2.6.15-vanilla/net/irda/af_irda.c 2006-01-03
> 14:21:10.000000000 +1100
> +++ linux-2.6.15/net/irda/af_irda.c 2006-01-10 15:56:55.000000000 +1100
> @@ -2474,6 +2474,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
> .getname = irda_getname,
> .poll = irda_poll,
> .ioctl = irda_ioctl,
> + .compat_ioctl= NULL,
> .listen = irda_listen,
> .shutdown = irda_shutdown,
> .setsockopt = irda_setsockopt,
> @@ -2495,6 +2496,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
> .getname = irda_getname,
> .poll = datagram_poll,
> .ioctl = irda_ioctl,
> + .compat_ioctl= NULL,
> .listen = irda_listen,
> .shutdown = irda_shutdown,
> .setsockopt = irda_setsockopt,
> @@ -2516,6 +2518,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
> .getname = irda_getname,
> .poll = datagram_poll,
> .ioctl = irda_ioctl,
> + .compat_ioctl= NULL,
> .listen = irda_listen,
> .shutdown = irda_shutdown,
> .setsockopt = irda_setsockopt,
> @@ -2538,6 +2541,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
> .getname = irda_getname,
> .poll = datagram_poll,
> .ioctl = irda_ioctl,
> + .compat_ioctl= NULL,
> .listen = sock_no_listen,
> .shutdown = irda_shutdown,
> .setsockopt = irda_setsockopt,
> static struct proto_ops SOCKOPS_WRAPPED(x25_proto_ops) = {
> .family = AF_X25,
> .owner = THIS_MODULE,
> @@ -1402,6 +1403,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
> .getname = x25_getname,
> .poll = datagram_poll,
> .ioctl = x25_ioctl,
> + .compat_ioctl= NULL,
> .listen = x25_listen,
> .shutdown = sock_no_shutdown,
> .setsockopt = x25_setsockopt,
>
>
Same comment applies to all these.
> +static long compat_sock_ioctl(struct file *file, unsigned cmd, unsigned
> long arg)
> +{
> + struct socket *sock;
> + sock = file->private_data;
> +
> + int ret = -ENOIOCTLCMD;
> + if(sock->ops->compat_ioctl) {
> + ret = sock->ops->compat_ioctl(sock,cmd,arg);
> + }
Leave out the curly braces here and put a space between the function
arguments, so it becomes
+ if(sock->ops->compat_ioctl)
+ ret = sock->ops->compat_ioctl(sock, cmd, arg);
Arnd <><
^ permalink raw reply
* Re: [PATCH 2/2 - 2.6.15]net:32 bit (socket layer) ioctl emulation for 64 bit kernels
From: Arnd Bergmann @ 2006-01-10 13:00 UTC (permalink / raw)
To: spereira
Cc: Arnaldo Carvalho de Melo, Andi Kleen, linux-kenel, x25 maintainer,
netdev, SP
In-Reply-To: <1136871083.5742.27.camel@spereira05.tusc.com.au>
On Tuesday 10 January 2006 05:31, Shaun Pereira wrote:
> --- linux-2.6.15-vanilla/include/net/x25.h 2006-01-03 14:21:10.000000000
> +1100
> +++ linux-2.6.15/include/net/x25.h 2006-01-10 16:15:16.000000000 +1100
> @@ -223,6 +223,18 @@ extern struct x25_route *x25_get_route(s
> extern struct net_device *x25_dev_get(char *);
> extern void x25_route_device_down(struct net_device *dev);
> extern int x25_route_ioctl(unsigned int, void __user *);
> +
> +#ifdef CONFIG_COMPAT
> +#include <linux/compat.h>
Don't hide #include <...> inside #ifdef, just add this in the beginning.
> +
> +struct x25_route_struct32{
> + struct x25_address address;
> + compat_uint_t sigdigits;
> + char device[200];
> +};
> +extern int compat_x25_route_ioctl(unsigned int, struct
> x25_route_struct32 __user *);
> +#endif
> +
Hmm. Declarations should not be hidden by #ifdef either, but of course
compat_uint_t is not defined on 32 bit systems.
Actually, the structure should already be the same on all 32 and 64 bit
systems, there is no 'long' or pointer in there.
I'm pretty sure you can simply call x25_route_ioctl instead of
introducing a new compat_x25_route_ioctl(), or did you have a different
reason to do this?
> extern void x25_route_free(void);
>
> static __inline__ void x25_route_hold(struct x25_route *rt)
> diff -uprN -X dontdiff linux-2.6.15-vanilla/net/x25/af_x25.c
> linux-2.6.15/net/x25/af_x25.c
> --- linux-2.6.15-vanilla/net/x25/af_x25.c 2006-01-10 16:06:29.000000000
> +1100
> +++ linux-2.6.15/net/x25/af_x25.c 2006-01-10 16:15:16.000000000 +1100
> @@ -475,6 +475,12 @@ out:
>
> void x25_init_timers(struct sock *sk);
>
> +#ifdef CONFIG_COMPAT
> +#include "x25_ioctl_compat.c"
> +#else
> +#define compat_x25_ioctl NULL
> +#endif
> +
No, this is not a good way to do it. It's good put it in a separate file,
if the compat code is large, but then better use Makefile magic to do
conditional compilation, like:
obj-$(CONFIG_X25) += x25.o
x25-$(CONFIG_COMPAT) += x25_ioctl_compat.o
[ OTOH, with the changes I propose below, it probably becomes so small
that it's no longer worth doing a separate file. ]
> static int x25_create(struct socket *sock, int protocol)
> {
> struct sock *sk;
> @@ -1403,7 +1409,7 @@ static struct proto_ops SOCKOPS_WRAPPED(
> .getname = x25_getname,
> .poll = datagram_poll,
> .ioctl = x25_ioctl,
> - .compat_ioctl= NULL,
> + .compat_ioctl= compat_x25_ioctl,
> .listen = x25_listen,
> .shutdown = sock_no_shutdown,
> .setsockopt = x25_setsockopt,
Then this normally becomes
.poll = datagram_poll,
.ioctl = x25_ioctl,
+#ifdef CONFIG_COMPAT
+ .compat_ioctl= compat_x25_ioctl,
+#endif
.listen = x25_listen,
.shutdown = sock_no_shutdown,
or you change the declaration in the header file to become
#ifdef CONFIG_COMPAT
extern long compat_x25_ioctl(struct file *, unsigned int, unsigned long);
#else
#define compat_x25_ioctl NULL
#endif
> diff -uprN -X dontdiff linux-2.6.15-vanilla/net/x25/x25_ioctl_compat.c
> linux-2.6.15/net/x25/x25_ioctl_compat.c
> --- linux-2.6.15-vanilla/net/x25/x25_ioctl_compat.c 1970-01-01
> 10:00:00.000000000 +1000
> +++ linux-2.6.15/net/x25/x25_ioctl_compat.c 2006-01-10
> 16:15:16.000000000 +1100
> @@ -0,0 +1,264 @@
> +#include <linux/compat.h>
> +
> +struct x25_subscrip_struct32{
> + char device[200-sizeof(compat_ulong_t)];
> + compat_ulong_t global_facil_mask;
> + compat_uint_t extended;
> +};
Please don't use a compat_ prefix instead of a 32 postfix,
i.e. compat_x25_subscrip_struct.
> +
> +struct x25_facilities32{
> + compat_uint_t winzize_in, winsize_out;
> + compat_uint_t pacsize_in, packsize_out;
> + compat_uint_t throughput;
> + compat_uint_t reverse;
> +};
> +
> +struct x25_calluserdata32 {
> + compat_uint_t cudlength;
> + unsigned char cuddata[128];
> +};
> +
> +struct x25_subaddr32 {
> + compat_uint_t cudmatchlength;
> +};
These should all be compatible and not need a conversion at all.
> +
> +static int compat_x25_subscr_ioctl(unsigned int cmd,
> + struct x25_subscrip_struct32 __user *x25_subscr32)
> +{
> ...
that function looks good.
> +static int compat_x25_facility_ioctl(struct socket *sock, struct
> x25_facilities32 __user *facilities32)
> +static int compat_x25_get_facility_ioctl(struct socket *sock, struct
> x25_facilities32 __user *facility32)
> +static int compat_x25_cud_ioctl(struct socket *sock, struct
> x25_calluserdata32 __user *calluserdata32)
> +static int compat_x25_get_cud_ioctl(struct socket *sock, struct
> x25_calluserdata32 __user *calluserdata32)
> +static int compat_x25_cud_match_ioctl(struct socket *sock, struct
> x25_subaddr32 __user *sub_addr32)
> +static int compat_x25_accept_ctrl(struct socket *sock, unsigned int
> cmd)
All these appear pointless to me, as the arguments are the same as in
the native 64 bit case.
> +
> +static int compat_x25_ioctl(struct socket *sock, unsigned int cmd,
> unsigned long arg)
> ...
> + case SIOCX25GFACILITIES:
> + rc = compat_x25_get_facility_ioctl(sock, argp);
> + break;
> + case SIOCX25SFACILITIES:
> + rc = compat_x25_facility_ioctl(sock, argp);
> + break;
> + case SIOCX25GCALLUSERDATA:
> + rc = compat_x25_get_cud_ioctl(sock, argp);
> + break;
> + case SIOCX25SCALLUSERDATA:
> + rc = compat_x25_cud_ioctl(sock, argp);
> + break;
> + case SIOCX25GCAUSEDIAG:
> + case SIOCX25SCUDMATCHLEN:
> + rc = compat_x25_cud_match_ioctl(sock,argp);
> + break;
> + case SIOCX25CALLACCPTAPPRV:
> + rc = compat_x25_accept_ctrl(sock,SIOCX25CALLACCPTAPPRV);
> + break;
> + case SIOCX25SENDCALLACCPT:
> + rc = compat_x25_accept_ctrl(sock,SIOCX25SENDCALLACCPT);
> + break;
Then these could become
+ case SIOCX25GFACILITIES:
+ case SIOCX25SFACILITIES:
+ case SIOCX25GCALLUSERDATA:
+ case SIOCX25SCALLUSERDATA:
+ case SIOCX25GCAUSEDIAG:
+ case SIOCX25SCUDMATCHLEN:
+ case SIOCX25CALLACCPTAPPRV:
+ case SIOCX25SENDCALLACCPT:
+ rc = x25_ioctl(sock, cmd, (unsigned long)argp);
+ break;
The casting argp to unsigned long instead of using arg takes care of
the pointer type problem, so it even works on s390 (your code did as well).
> +#ifdef CONFIG_COMPAT
> +
> +int compat_x25_route_ioctl(unsigned int cmd, struct x25_route_struct32
> __user *rt32)
> +{
AFAICS; this function is identical to x25_route_ioctl, so just call that
one.
Arnd <><
^ permalink raw reply
* Re: State of the Union: Wireless
From: Johannes Berg @ 2006-01-10 13:18 UTC (permalink / raw)
To: Denis Vlasenko; +Cc: Jeff Garzik, netdev, linux-kernel
In-Reply-To: <200601071649.35321.vda@ilport.com.ua>
Denis Vlasenko wrote:
> I am confused.
Which isn't really all that surprising.
> ftp://ftp.berlios.de/pub/bcm43xx/snapshots/softmac/ieee80211softmac-20060107.tar.bz2
> which is not the same. For example, ieee80211softmac.h file exists in both
> tarballs but is not identical.
>
> Suppose one wants to use softmac in a project. What tarball contains
> the bleeding edge of softmac?
The one from the softmac page is created from the git repository. The one
on the bcm page is created from the now historical mercurial archive.
I need to get the bcm people to take away that snapshot and link to the
correct one.
johannes
^ permalink raw reply
* Re: [2.6.15] running tcpdump on 3c905b causes freeze (reproducable)
From: Folkert van Heusden @ 2006-01-10 14:27 UTC (permalink / raw)
To: Andrew Morton; +Cc: netdev, linux-kernel
In-Reply-To: <20060109224821.7a40bc69.akpm@osdl.org>
> > > > Have you tried enabling the NMI watchdog? Enable CONFIG_X86_LOCAL_APIC and
> > > > boot with `nmi_watchdog=1' on the command line, make sure that the NMI line
> > > > of /proc/interrupts is incrementing.
> > > I'll give it a try. I've added it to the append-line in the lilo config.
> > > Am now compiling the kernel.
> > No change. Well, that is: the last message on the console now is
> > "setting eth1 to promiscues mode".
> Did you confirm that the NMI counters in /proc/interrupts are incrementing?
Yes:
root@muur:/home/folkert# for i in `seq 1 5` ; do cat /proc/interrupts | grep NMI ; sleep 1 ; done
NMI: 6949080 6949067
NMI: 6949182 6949169
NMI: 6949284 6949271
NMI: 6949386 6949373
NMI: 6949488 6949475
Folkert van Heusden
--
Try MultiTail! Multiple windows with logfiles, filtered with regular
expressions, colored output, etc. etc. www.vanheusden.com/multitail/
----------------------------------------------------------------------
Get your PGP/GPG key signed at www.biglumber.com!
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com
^ permalink raw reply
* Transmit timeout with E1000
From: Erik Mouw @ 2006-01-10 15:12 UTC (permalink / raw)
To: e1000-devel; +Cc: netdev
Hi,
I have lots of transmit timeouts with an Intel E1000 card during large
TCP transmissions (remotely viewing a 3000x2000 jpeg image using XV is
an excellent way to trigger it). This is what I get in linux-2.6.8.1:
Jan 10 15:24:41 zurix kernel: NETDEV WATCHDOG: eth0: transmit timed out
Jan 10 15:24:41 zurix kernel: e1000: eth0: e1000_watchdog: NIC Link is Up 1000 Mbps Full Duplex
Jan 10 15:24:46 zurix kernel: nfs: server abra2 not responding, still trying
Jan 10 15:24:46 zurix kernel: nfs: server abra2 OK
And this is with linux-2.6.15:
Jan 10 06:53:27 zurix kernel: e1000: eth0: e1000_clean_tx_irq: Detected Tx Unit Hang
Jan 10 06:53:27 zurix kernel: TDH <b0>
Jan 10 06:53:27 zurix kernel: TDT <b0>
Jan 10 06:53:27 zurix kernel: next_to_use <b0>
Jan 10 06:53:27 zurix kernel: next_to_clean <c3>
Jan 10 06:53:27 zurix kernel: buffer_info[next_to_clean]
Jan 10 06:53:27 zurix kernel: dma <e938a5e>
Jan 10 06:53:27 zurix kernel: time_stamp <872de93>
Jan 10 06:53:27 zurix kernel: next_to_watch <c3>
Jan 10 06:53:27 zurix kernel: jiffies <872e086>
Jan 10 06:53:27 zurix kernel: next_to_watch.status <0>
Jan 10 06:53:29 zurix kernel: e1000: eth0: e1000_clean_tx_irq: Detected Tx Unit Hang
Jan 10 06:53:29 zurix kernel: TDH <b0>
Jan 10 06:53:29 zurix kernel: TDT <b0>
Jan 10 06:53:29 zurix kernel: next_to_use <b0>
Jan 10 06:53:29 zurix kernel: next_to_clean <c3>
Jan 10 06:53:29 zurix kernel: buffer_info[next_to_clean]
Jan 10 06:53:29 zurix kernel: dma <e938a5e>
Jan 10 06:53:29 zurix kernel: time_stamp <872de93>
Jan 10 06:53:29 zurix kernel: next_to_watch <c3>
Jan 10 06:53:29 zurix kernel: jiffies <872e27a>
Jan 10 06:53:29 zurix kernel: next_to_watch.status <0>
Jan 10 06:53:31 zurix kernel: e1000: eth0: e1000_clean_tx_irq: Detected Tx Unit Hang
Jan 10 06:53:31 zurix kernel: TDH <b0>
Jan 10 06:53:31 zurix kernel: TDT <b0>
Jan 10 06:53:31 zurix kernel: next_to_use <b0>
Jan 10 06:53:31 zurix kernel: next_to_clean <c3>
Jan 10 06:53:31 zurix kernel: buffer_info[next_to_clean]
Jan 10 06:53:31 zurix kernel: dma <e938a5e>
Jan 10 06:53:31 zurix kernel: time_stamp <872de93>
Jan 10 06:53:31 zurix kernel: next_to_watch <c3>
Jan 10 06:53:31 zurix kernel: jiffies <872e46e>
Jan 10 06:53:31 zurix kernel: next_to_watch.status <0>
Jan 10 06:53:32 zurix kernel: nfs: server abra2 not responding, still trying
Jan 10 06:53:33 zurix kernel: NETDEV WATCHDOG: eth0: transmit timed out
Jan 10 06:53:36 zurix kernel: e1000: eth0: e1000_watchdog_task: NIC Link is Up 1000 Mbps Full Duplex
Jan 10 06:53:37 zurix kernel: nfs: server abra2 OK
The system is a an AMD Athlon XP 2000+ running at 1.666 GHz with a VIA
KT400 chipset (Asrock K7VT4APro).
Here's the relevant output from lspci:
0000:00:0b.0 Ethernet controller: Intel Corporation 82541PI Gigabit
Ethernet Controller (rev 05)
Subsystem: Intel Corporation: Unknown device 1376
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop-
ParErr- Stepping- SERR- FastB2B-
Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 32 (63750ns min), Cache Line Size: 0x08 (32 bytes)
Interrupt: pin A routed to IRQ 19
Region 0: Memory at dffc0000 (32-bit, non-prefetchable) [size=128K]
Region 1: Memory at dffa0000 (32-bit, non-prefetchable) [size=128K]
Region 2: I/O ports at d400 [size=64]
Expansion ROM at fffe0000 [disabled] [size=128K]
Capabilities: [dc] Power Management version 2
Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=1 PME-
Capabilities: [e4] PCI-X non-bridge device.
Command: DPERE- ERO+ RBC=0 OST=0
Status: Bus=0 Dev=0 Func=0 64bit- 133MHz- SCD- USC-, DC=simple, DMMRBC=2, DMOST=0, DMCRS=0, RSCEM-
00: 86 80 7c 10 17 00 30 02 05 00 00 02 08 20 00 00
10: 00 00 fc df 00 00 fa df 01 d4 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 86 80 76 13
30: 00 00 fe ff dc 00 00 00 00 00 00 00 0c 01 ff 00
Loaded modules (with 2.6.8.1): nfsd exportfs sd_mod sg lp sr_mod
autofs4 nfs lockd sunrpc ide_cd cdrom floppy parport_pc parport
8250_pnp 8250 serial_core snd_via82xx snd_ac97_codec snd_pcm_oss
snd_mixer_oss snd_pcm snd_timer snd_page_alloc gameport snd_mpu401_uart
snd_rawmidi snd_seq_device snd soundcore joydev evdev ehci_hcd usbhid
uhci_hcd usbcore sata_via libata e1000 reiserfs mga via_agp agpgart .
So far I have replaced the NIC, the motherboard, the power supply, RAM,
network cable, and gigE switch, but to no avail. I've tried three
different kernels (2.6.8.1, 2.6.11-ac7, and 2.6.15) but the problem
remains. I've been stress testing the system by continuously compiling
kernels (over NFS), but after 288 runs there hasn't been a single error
so I guess the CPU and RAM are OK. The amount of transmit timeouts is
less with linux-2.6.8.1, so for the moment I keep running that version.
We have about 15 other machines using the Intel E1000, but I haven't
seen these kind of problems on any of the other machines. I have run
out of ideas, so I hope somebody knows how to solve this. If you need
more information, just let me know.
Erik
--
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
^ permalink raw reply
* [2.6 patch] drivers/net/irda/Kconfig: DONGLE_OLD: remove dependency on non-existing symbol
From: Adrian Bunk @ 2006-01-10 17:09 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel, Jean-Luc Leger
Jean-Luc Leger <reiga@dspnet.fr.eu.org> reported this alternative
dependency on a non-existing symbol.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
--- linux-2.6.15-mm2-full/drivers/net/irda/Kconfig.old 2006-01-10 17:48:41.000000000 +0100
+++ linux-2.6.15-mm2-full/drivers/net/irda/Kconfig 2006-01-10 17:48:59.000000000 +0100
@@ -1,4 +1,3 @@
-
menu "Infrared-port device drivers"
depends on IRDA!=n
@@ -156,7 +155,7 @@
config DONGLE_OLD
bool "Old Serial dongle support"
- depends on (IRTTY_OLD || IRPORT_SIR) && BROKEN_ON_SMP
+ depends on IRPORT_SIR && BROKEN_ON_SMP
help
Say Y here if you have an infrared device that connects to your
computer's serial port. These devices are called dongles. Then say Y
^ permalink raw reply
* [ANNOUNCE] iproute2 2.6.15-060110
From: Stephen Hemminger @ 2006-01-10 19:25 UTC (permalink / raw)
To: netdev; +Cc: linux-net
Update to iproute2 is available. Most of the changes were to repair the
things that broke with the introduction of the batch mode to the ip command.
http://developer.osdl.org/dev/iproute2/download/iproute2-2.6.15-060110.tar.gz
For information see:
http://linux-net.osdl.org/index.php/Iproute2
Recent changes
Masahide NAKAMURA
Add ip link ntable
Stephen Hemminger
Update headers to santized kernel 2.6.15
Fix ipv6 priority option in u32
Add corrupt feature for netem
Jamal Hadi Salim
Add ifb documention
Patrick McHardy
Add back ip command aliases
--
Stephen Hemminger <shemminger@osdl.org>
OSDL http://developer.osdl.org/~shemminger
^ permalink raw reply
* Re: [2.6 patch] drivers/net/irda/Kconfig: DONGLE_OLD: remove dependency on non-existing symbol
From: David S. Miller @ 2006-01-10 21:11 UTC (permalink / raw)
To: bunk; +Cc: netdev, linux-kernel, reiga
In-Reply-To: <20060110170903.GQ3911@stusta.de>
From: Adrian Bunk <bunk@stusta.de>
Date: Tue, 10 Jan 2006 18:09:03 +0100
> Jean-Luc Leger <reiga@dspnet.fr.eu.org> reported this alternative
> dependency on a non-existing symbol.
>
> Signed-off-by: Adrian Bunk <bunk@stusta.de>
Applied, thanks.
^ permalink raw reply
* Re: RFC: kill acx100-devel, migrate to netdev@vger.kernel.org
From: Carlos Martín @ 2006-01-10 23:16 UTC (permalink / raw)
To: Denis Vlasenko; +Cc: acx100-devel, netdev
In-Reply-To: <200601100829.47592.vda@ilport.com.ua>
On Tuesday 10 January 2006 07:29, Denis Vlasenko wrote:
> Hi folks,
>
> Please read http://lkml.org/lkml/2006/1/5/671
>
> What about moving all acx development discussion
> to netdev@vger.kernel.org?
Sure, if the driver ships with mainline. Until it does, it would be OT here,
IMO.
>
> If yes, can acx100-devel address be automatically
> redirected?
If you'd like for people to still be able to use acx100-devel as before,
you'd have to forward everything back and forth, and a discussion that started
in netdev wouldn't have an easy way to get copied to acx100-devel unless it
was manually CCd.
I think it'd be easier just to tell people that discussion happens at netdev
from now/whenever on.
cmn
--
Carlos Martín http://www.cmartin.tk
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id\x16865&op=click
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox