[patch 03/14] e1000: omit stats for broken counter in 82543

2006-12-15 Thread Arjan van de Ven
Subject: e1000: omit stats for broken counter in 82543
From: Jesse Brandeburg [EMAIL PROTECTED]

The 82543 chip does not count tx_carrier_errors properly in FD mode;
report zeros instead of garbage.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000_main.c |5 +
 1 file changed, 5 insertions(+), 0 deletion(-)

Index: linux-2.6/drivers/net/e1000/e1000_main.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -3580,7 +3580,12 @@ e1000_update_stats(struct e1000_adapter 
adapter-net_stats.tx_errors = adapter-stats.txerrc;
adapter-net_stats.tx_aborted_errors = adapter-stats.ecol;
adapter-net_stats.tx_window_errors = adapter-stats.latecol;
adapter-net_stats.tx_carrier_errors = adapter-stats.tncrs;
+   if (adapter-hw.mac_type == e1000_82543 
+   adapter-link_duplex == FULL_DUPLEX) {
+   adapter-net_stats.tx_carrier_errors = 0;
+   adapter-stats.tncrs = 0;
+   }
 
/* Tx Dropped needs to be maintained elsewhere */
 

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 13/14] e1000: 3 new driver stats for managability testing

2006-12-15 Thread Arjan van de Ven
Subject: e1000: 3 new driver stats for managability testing
From: Jesse Brandeburg [EMAIL PROTECTED]

Add 3 extra packet redirect counters for tracking purposes to make sure we
can test that all packets arrive properly.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000_ethtool.c |3 +++
 drivers/net/e1000/e1000_main.c|7 +++
 2 files changed, 10 insertions(+)

Index: linux-2.6/drivers/net/e1000/e1000_ethtool.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_ethtool.c
+++ linux-2.6/drivers/net/e1000/e1000_ethtool.c
@@ -100,6 +100,9 @@ static const struct e1000_stats e1000_gs
{ rx_csum_offload_errors, E1000_STAT(hw_csum_err) },
{ rx_header_split, E1000_STAT(rx_hdr_split) },
{ alloc_rx_buff_failed, E1000_STAT(alloc_rx_buff_failed) },
+   { tx_smbus, E1000_STAT(stats.mgptc) },
+   { rx_smbus, E1000_STAT(stats.mgprc) },
+   { dropped_smbus, E1000_STAT(stats.mgpdc) },
 };
 
 #define E1000_QUEUE_STATS_LEN 0
Index: linux-2.6/drivers/net/e1000/e1000_main.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -3633,6 +3633,13 @@ e1000_update_stats(struct e1000_adapter 
adapter-phy_stats.receive_errors += phy_tmp;
}
 
+   /* Management Stats */
+   if (adapter-hw.mac_type  e1000_82544) {
+   adapter-stats.mgptc += E1000_READ_REG(hw, MGTPTC);
+   adapter-stats.mgprc += E1000_READ_REG(hw, MGTPRC);
+   adapter-stats.mgpdc += E1000_READ_REG(hw, MGTPDC);
+   }
+
spin_unlock_irqrestore(adapter-stats_lock, flags);
 }
 #ifdef CONFIG_PCI_MSI

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 12/14] e1000: Make the copybreak value a module parameter

2006-12-15 Thread Arjan van de Ven
Subject: e1000: Make the copybreak value a module parameter
From: Jesse Brandeburg [EMAIL PROTECTED]

Allow the user to vary the size that copybreak works. Currently cb is enabled
for packets  256 bytes, but various tests indicate that this should be
configurable for specific use cases. In addition, this parameter allows us
to force never/always during testing to get full and predictable coverage of 
both code paths.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000_main.c |   19 
 1 file changed, 15 insertions(+), 4 deletions(-)

Index: linux-2.6/drivers/net/e1000/e1000_main.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -213,6 +213,12 @@ static void e1000_netpoll (struct net_de
 
 extern void e1000_check_options(struct e1000_adapter *adapter);
 
+#define COPYBREAK_DEFAULT 256
+static unsigned int copybreak __read_mostly = COPYBREAK_DEFAULT;
+module_param(copybreak, uint, 0644);
+MODULE_PARM_DESC(copybreak,
+   Maximum size of packet that is copied to a new buffer on receive);
+
 static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,
  pci_channel_state_t state);
 static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev);
@@ -264,7 +271,13 @@ e1000_init_module(void)
printk(KERN_INFO %s\n, e1000_copyright);
 
ret = pci_register_driver(e1000_driver);
-
+   if (copybreak != COPYBREAK_DEFAULT) {
+   if (copybreak == 0)
+   printk(KERN_INFO e1000: copybreak disabled\n);
+   else
+   printk(KERN_INFO e1000: copybreak enabled for 
+  packets = %u bytes\n, copybreak);
+   }
return ret;
 }
 
@@ -4245,8 +4258,7 @@ e1000_clean_rx_irq(struct e1000_adapter 
/* code added for copybreak, this should improve
 * performance for small packets with large amounts
 * of reassembly being done in the stack */
-#define E1000_CB_LENGTH 256
-   if (length  E1000_CB_LENGTH) {
+   if (length  copybreak) {
struct sk_buff *new_skb =
netdev_alloc_skb(netdev, length + NET_IP_ALIGN);
if (new_skb) {
@@ -4404,7 +4416,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapt
 
/* page alloc/put takes too long and effects small packet
 * throughput, so unsplit small packets and save the alloc/put*/
-   if (l1  ((length + l1) = adapter-rx_ps_bsize0)) {
+   if (l1  (l1 = copybreak)  ((length + l1) = 
adapter-rx_ps_bsize0)) {
u8 *vaddr;
/* there is no documentation about how to call
 * kmap_atomic, so we can't hold the mapping

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 04/14] e1000: consolidate managability enabling/disabling

2006-12-15 Thread Arjan van de Ven
Subject: e1000: consolidate managability enabling/disabling
From: Jesse Brandeburg [EMAIL PROTECTED]

Several bugs existed in how we handle manageability issues all over the driver.
This patch consolidates all the managability release and init code in two single
functions and call them from appropriate locations. This fixes several
BMC packet redirect issues and powerup/down hiccups.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000_hw.c   |5 -
 drivers/net/e1000/e1000_hw.h   |1 
 drivers/net/e1000/e1000_main.c |  127 +
 3 files changed, 71 insertions(+), 62 deletions(-)

Index: linux-2.6/drivers/net/e1000/e1000_hw.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_hw.c
+++ linux-2.6/drivers/net/e1000/e1000_hw.c
@@ -7817,9 +7817,8 @@ e1000_enable_mng_pass_thru(struct e1000_
 fwsm = E1000_READ_REG(hw, FWSM);
 factps = E1000_READ_REG(hw, FACTPS);
 
-if (((fwsm  E1000_FWSM_MODE_MASK) ==
-(e1000_mng_mode_pt  E1000_FWSM_MODE_SHIFT)) 
-(factps  E1000_FACTPS_MNGCG))
+if fwsm  E1000_FWSM_MODE_MASK)  E1000_FWSM_MODE_SHIFT) ==
+   e1000_mng_mode_pt)  !(factps  E1000_FACTPS_MNGCG))
 return TRUE;
 } else
 if ((manc  E1000_MANC_SMBUS_EN)  !(manc  E1000_MANC_ASF_EN))
Index: linux-2.6/drivers/net/e1000/e1000_hw.h
===
--- linux-2.6.orig/drivers/net/e1000/e1000_hw.h
+++ linux-2.6/drivers/net/e1000/e1000_hw.h
@@ -1301,6 +1301,7 @@ struct e1000_ffvt_entry {
 #define E1000_82542_RSSIR   E1000_RSSIR
 #define E1000_82542_KUMCTRLSTA E1000_KUMCTRLSTA
 #define E1000_82542_SW_FW_SYNC E1000_SW_FW_SYNC
+#define E1000_82542_MANC2H  E1000_MANC2H
 
 /* Statistics counters collected by the MAC */
 struct e1000_hw_stats {
Index: linux-2.6/drivers/net/e1000/e1000_main.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -464,6 +464,51 @@ e1000_get_hw_control(struct e1000_adapte
}
 }
 
+static void
+e1000_init_manageability(struct e1000_adapter *adapter)
+{
+   if (adapter-en_mng_pt) {
+   uint32_t manc2h = E1000_READ_REG(adapter-hw, MANC2H);
+   uint32_t manc = E1000_READ_REG(adapter-hw, MANC);
+
+   /* disable hardware interception of ARP */
+   manc = ~(E1000_MANC_ARP_EN);
+
+   /* enable receiving management packets to the host */
+   /* this will probably generate destination unreachable messages
+* from the host OS, but the packets will be handled on SMBUS */
+   if (adapter-hw.mac_type = e1000_82571) {
+   manc |= E1000_MANC_EN_MNG2HOST;
+#define E1000_MNG2HOST_PORT_623 (1  5)
+#define E1000_MNG2HOST_PORT_664 (1  6)
+   manc2h |= E1000_MNG2HOST_PORT_623;
+   manc2h |= E1000_MNG2HOST_PORT_664;
+   E1000_WRITE_REG(adapter-hw, MANC2H, manc2h);
+   }
+
+   E1000_WRITE_REG(adapter-hw, MANC, manc);
+   }
+}
+
+static void
+e1000_release_manageability(struct e1000_adapter *adapter)
+{
+   if (adapter-en_mng_pt) {
+   uint32_t manc = E1000_READ_REG(adapter-hw, MANC);
+
+   /* re-enable hardware interception of ARP */
+   manc |= E1000_MANC_ARP_EN;
+
+   if (adapter-hw.mac_type = e1000_82571)
+   manc = ~E1000_MANC_EN_MNG2HOST;
+
+   /* don't explicitly have to mess with MANC2H since
+* MANC has an enable disable that gates MANC2H */
+
+   E1000_WRITE_REG(adapter-hw, MANC, manc);
+   }
+}
+
 int
 e1000_up(struct e1000_adapter *adapter)
 {
@@ -475,6 +520,7 @@ e1000_up(struct e1000_adapter *adapter)
e1000_set_multi(netdev);
 
e1000_restore_vlan(adapter);
+   e1000_init_manageability(adapter);
 
e1000_configure_tx(adapter);
e1000_setup_rctl(adapter);
@@ -614,7 +660,7 @@ e1000_reinit_locked(struct e1000_adapter
 void
 e1000_reset(struct e1000_adapter *adapter)
 {
-   uint32_t pba, manc;
+   uint32_t pba;
uint16_t fc_high_water_mark = E1000_FC_HIGH_DIFF;
 
/* Repartition Pba for greater than 9k mtu
@@ -705,14 +751,7 @@ e1000_reset(struct e1000_adapter *adapte
phy_data);
}
 
-   if ((adapter-en_mng_pt) 
-   (adapter-hw.mac_type = e1000_82540) 
-   (adapter-hw.mac_type  e1000_82571) 
-   (adapter-hw.media_type == e1000_media_type_copper)) {
-   manc = E1000_READ_REG(adapter-hw, MANC);
-   manc |= (E1000_MANC_ARP_EN | 

[patch 06/14] e1000: disable TSO on the 82544 with slab debugging

2006-12-15 Thread Arjan van de Ven
Subject: e1000: disable TSO on the 82544 with slab debugging
From: Jesse Brandeburg [EMAIL PROTECTED]

CONFIG_DEBUG_SLAB changes alignments of the data structures the slab
allocators return. These break certain workarounds for TSO on the 82544.
Since DEBUG_SLAB is relatively rare and not used for performance sensitive
cases, the simplest fix is to disable TSO in this special situation.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000_main.c |6 ++
 1 file changed, 6 insertions(+)

Index: linux-2.6/drivers/net/e1000/e1000_main.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -911,6 +911,12 @@ e1000_probe(struct pci_dev *pdev,
   (adapter-hw.mac_type != e1000_82547))
netdev-features |= NETIF_F_TSO;
 
+#ifdef CONFIG_DEBUG_SLAB
+   /* 82544's work arounds do not play nicely with DEBUG SLAB */
+   if (adapter-hw.mac_type == e1000_82544)
+   netdev-features = ~NETIF_F_TSO;
+#endif
+
 #ifdef NETIF_F_TSO6
if (adapter-hw.mac_type  e1000_82547_rev_2)
netdev-features |= NETIF_F_TSO6;

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 05/14] e1000: Fix Wake-on-Lan with forced gigabit speed

2006-12-15 Thread Arjan van de Ven
Subject: e1000: Fix Wake-on-Lan with forced gigabit speed
From: Jesse Brandeburg [EMAIL PROTECTED]

If the user has forced gigabit speed, phy power management must be disabled;
otherwise the NIC would try to negotiate to a linkspeed of 10/100 mbit on
shutdown, which would lead to a total loss of link. This loss of link breaks
Wake-on-Lan and IPMI.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000_main.c |   14 ++
 1 file changed, 14 insertions(+)

Index: linux-2.6/drivers/net/e1000/e1000_main.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -732,6 +732,20 @@ e1000_reset(struct e1000_adapter *adapte
if (e1000_init_hw(adapter-hw))
DPRINTK(PROBE, ERR, Hardware Error\n);
e1000_update_mng_vlan(adapter);
+
+   /* if (adapter-hwflags  HWFLAGS_PHY_PWR_BIT) { */
+   if (adapter-hw.mac_type = e1000_82544 
+   adapter-hw.mac_type = e1000_82547_rev_2 
+   adapter-hw.autoneg == 1 
+   adapter-hw.autoneg_advertised == ADVERTISE_1000_FULL) {
+   uint32_t ctrl = E1000_READ_REG(adapter-hw, CTRL);
+   /* clear phy power management bit if we are in gig only mode,
+* which if enabled will attempt negotiation to 100Mb, which
+* can cause a loss of link at power off or driver unload */
+   ctrl = ~E1000_CTRL_SWDPIN3;
+   E1000_WRITE_REG(adapter-hw, CTRL, ctrl);
+   }
+
/* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */
E1000_WRITE_REG(adapter-hw, VET, ETHERNET_IEEE_VLAN_TYPE);
 

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 14/14] e1000: No-delay link detection at interface up

2006-12-15 Thread Arjan van de Ven
Subject: e1000: No-delay link detection at interface up
From: Jesse Brandeburg [EMAIL PROTECTED]

Currently after an interface up, the link state is detected 2 seconds later
when the first watchdog timer runs. This patch changes that by triggering
the hardware to generate a link-change interrupt from the up() function
instead. This has the result that the link state gets detected immediately
and without races. This has the potential to speed up booting since a normal
distribution boot process waits for a link before DHCP is attempted.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000_main.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/net/e1000/e1000_main.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -543,7 +543,8 @@ e1000_up(struct e1000_adapter *adapter)
 
clear_bit(__E1000_DOWN, adapter-flags);
 
-   mod_timer(adapter-watchdog_timer, jiffies + 2 * HZ);
+   /* fire a link change interrupt to start the watchdog */
+   E1000_WRITE_REG(adapter-hw, ICS, E1000_ICS_LSC);
return 0;
 }
 

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 10/14] e1000: narrow down the scope of the tipg timer tweak

2006-12-15 Thread Arjan van de Ven
Subject: e1000: narrow down the scope of the tipg timer tweak
From: Jesse Brandeburg [EMAIL PROTECTED]

the driver has (ancient) code for messing with TIPG from the 82542 days.
Unfortunately this code was running on our current adapters and setting
TIPG for fiber to be +1 over the copper value.  This caused 1.45Mpps
to be sent instead of 1.487Mpps.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000_main.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/net/e1000/e1000_main.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -1582,9 +1582,9 @@ e1000_configure_tx(struct e1000_adapter 
}
 
/* Set the default values for the Tx Inter Packet Gap timer */
-
-   if (hw-media_type == e1000_media_type_fiber ||
-   hw-media_type == e1000_media_type_internal_serdes)
+   if (adapter-hw.mac_type = e1000_82547_rev_2 
+   (hw-media_type == e1000_media_type_fiber ||
+hw-media_type == e1000_media_type_internal_serdes))
tipg = DEFAULT_82543_TIPG_IPGT_FIBER;
else
tipg = DEFAULT_82543_TIPG_IPGT_COPPER;

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 01/14] e1000: The user-supplied itr setting needs the lower 2 bits masked off

2006-12-15 Thread Arjan van de Ven
Subject: e1000: The user-supplied itr setting needs the lower 2 bits masked off
From: Jesse Brandeburg [EMAIL PROTECTED]

The lower 2 bits of a user-supplied itr setting (via ethtool) need to be
masked off: These lower two bits are used as control bits.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]

---
 drivers/net/e1000/e1000_param.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/net/e1000/e1000_param.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_param.c
+++ linux-2.6/drivers/net/e1000/e1000_param.c
@@ -487,7 +487,9 @@ e1000_check_options(struct e1000_adapter
e1000_validate_option(adapter-itr, opt,
adapter);
/* save the setting, because the dynamic bits 
change itr */
-   adapter-itr_setting = adapter-itr;
+   /* clear the lower two bits because they are
+* used as control */
+   adapter-itr_setting = adapter-itr  ~3;
break;
}
} else {

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 11/14] e1000: Fix PBA allocation calculations

2006-12-15 Thread Arjan van de Ven
Subject: e1000: Fix PBA allocation calculations
From: Bruce Allan [EMAIL PROTECTED]

Assign the PBA to be large enough to contain at least 2 jumbo frames on
all adapters. This dramatically increases performance on several adapters
and fixes TX performance degradation issues where the PBA was misallocated
in the old algorithm.

Signed-off-by: Bruce Allan [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000_hw.h   |1 
 drivers/net/e1000/e1000_main.c |   99 +++--
 2 files changed, 86 insertions(+), 14 deletions(-)

Index: linux-2.6/drivers/net/e1000/e1000_main.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -661,16 +661,34 @@ e1000_reinit_locked(struct e1000_adapter
 void
 e1000_reset(struct e1000_adapter *adapter)
 {
-   uint32_t pba;
+   uint32_t pba = 0, tx_space, min_tx_space, min_rx_space;
uint16_t fc_high_water_mark = E1000_FC_HIGH_DIFF;
+   boolean_t legacy_pba_adjust = FALSE;
 
/* Repartition Pba for greater than 9k mtu
 * To take effect CTRL.RST is required.
 */
 
switch (adapter-hw.mac_type) {
+   case e1000_82542_rev2_0:
+   case e1000_82542_rev2_1:
+   case e1000_82543:
+   case e1000_82544:
+   case e1000_82540:
+   case e1000_82541:
+   case e1000_82541_rev_2:
+   legacy_pba_adjust = TRUE;
+   pba = E1000_PBA_48K;
+   break;
+   case e1000_82545:
+   case e1000_82545_rev_3:
+   case e1000_82546:
+   case e1000_82546_rev_3:
+   pba = E1000_PBA_48K;
+   break;
case e1000_82547:
case e1000_82547_rev_2:
+   legacy_pba_adjust = TRUE;
pba = E1000_PBA_30K;
break;
case e1000_82571:
@@ -679,27 +697,80 @@ e1000_reset(struct e1000_adapter *adapte
pba = E1000_PBA_38K;
break;
case e1000_82573:
-   pba = E1000_PBA_12K;
+   pba = E1000_PBA_20K;
break;
case e1000_ich8lan:
pba = E1000_PBA_8K;
-   break;
-   default:
-   pba = E1000_PBA_48K;
+   case e1000_undefined:
+   case e1000_num_macs:
break;
}
 
-   if ((adapter-hw.mac_type != e1000_82573) 
-  (adapter-netdev-mtu  E1000_RXBUFFER_8192))
-   pba -= 8; /* allocate more FIFO for Tx */
+   if (legacy_pba_adjust == TRUE) {
+   if (adapter-netdev-mtu  E1000_RXBUFFER_8192)
+   pba -= 8; /* allocate more FIFO for Tx */
 
+   if (adapter-hw.mac_type == e1000_82547) {
+   adapter-tx_fifo_head = 0;
+   adapter-tx_head_addr = pba  E1000_TX_HEAD_ADDR_SHIFT;
+   adapter-tx_fifo_size =
+   (E1000_PBA_40K - pba)  E1000_PBA_BYTES_SHIFT;
+   atomic_set(adapter-tx_fifo_stall, 0);
+   }
+   } else if (adapter-hw.max_frame_size  MAXIMUM_ETHERNET_FRAME_SIZE) {
+   /* adjust PBA for jumbo frames */
+   E1000_WRITE_REG(adapter-hw, PBA, pba);
+
+   /* To maintain wire speed transmits, the Tx FIFO should be
+* large enough to accomodate two full transmit packets,
+* rounded up to the next 1KB and expressed in KB.  Likewise,
+* the Rx FIFO should be large enough to accomodate at least
+* one full receive packet and is similarly rounded up and
+* expressed in KB. */
+   pba = E1000_READ_REG(adapter-hw, PBA);
+   /* upper 16 bits has Tx packet buffer allocation size in KB */
+   tx_space = pba  16;
+   /* lower 16 bits has Rx packet buffer allocation size in KB */
+   pba = 0x;
+   /* don't include ethernet FCS because hardware appends/strips */
+   min_rx_space = adapter-netdev-mtu + ENET_HEADER_SIZE +
+  VLAN_TAG_SIZE;
+   min_tx_space = min_rx_space;
+   min_tx_space *= 2;
+   E1000_ROUNDUP(min_tx_space, 1024);
+   min_tx_space = 10;
+   E1000_ROUNDUP(min_rx_space, 1024);
+   min_rx_space = 10;
+
+   /* If current Tx allocation is less than the min Tx FIFO size,
+* and the min Tx FIFO size is less than the current Rx FIFO
+* allocation, take space away from current Rx allocation */
+   if (tx_space  min_tx_space 
+   ((min_tx_space - tx_space)  pba)) {
+   pba = pba - (min_tx_space - tx_space);
 
-   if (adapter-hw.mac_type == e1000_82547) {
-   

[patch 02/14] e1000: dynamic itr: take TSO and jumbo into account

2006-12-15 Thread Arjan van de Ven
Subject: e1000: dynamic itr: take TSO and jumbo into account
From: Jesse Brandeburg [EMAIL PROTECTED]

The dynamic interrupt rate control patches omitted proper counting
for jumbo's and TSO resulting in suboptimal interrupt mitigation strategies.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000_main.c |   43 +
 1 file changed, 25 insertions(+), 16 deletions(-)

Index: linux-2.6/drivers/net/e1000/e1000_main.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -2628,29 +2628,34 @@ static unsigned int e1000_update_itr(str
if (packets == 0)
goto update_itr_done;
 
-
switch (itr_setting) {
case lowest_latency:
-   if ((packets  5)  (bytes  512))
+   /* jumbo frames get bulk treatment*/
+   if (bytes/packets  8000)
+   retval = bulk_latency;
+   else if ((packets  5)  (bytes  512))
retval = low_latency;
break;
case low_latency:  /* 50 usec aka 2 ints/s */
if (bytes  1) {
-   if ((packets  10) ||
-((bytes/packets)  1200))
+   /* jumbo frames need bulk latency setting */
+   if (bytes/packets  8000)
+   retval = bulk_latency;
+   else if ((packets  10) || ((bytes/packets)  1200))
retval = bulk_latency;
else if ((packets  35))
retval = lowest_latency;
-   } else if (packets = 2  bytes  512)
+   } else if (bytes/packets  2000)
+   retval = bulk_latency;
+   else if (packets = 2  bytes  512)
retval = lowest_latency;
break;
case bulk_latency: /* 250 usec aka 4000 ints/s */
if (bytes  25000) {
if (packets  35)
retval = low_latency;
-   } else {
-   if (bytes  6000)
-   retval = low_latency;
+   } else if (bytes  6000) {
+   retval = low_latency;
}
break;
}
@@ -2679,17 +2684,20 @@ static void e1000_set_itr(struct e1000_a
adapter-tx_itr,
adapter-total_tx_packets,
adapter-total_tx_bytes);
+   /* conservative mode (itr 3) eliminates the lowest_latency setting */
+   if (adapter-itr_setting == 3  adapter-tx_itr == lowest_latency)
+   adapter-tx_itr = low_latency;
+
adapter-rx_itr = e1000_update_itr(adapter,
adapter-rx_itr,
adapter-total_rx_packets,
adapter-total_rx_bytes);
+   /* conservative mode (itr 3) eliminates the lowest_latency setting */
+   if (adapter-itr_setting == 3  adapter-rx_itr == lowest_latency)
+   adapter-rx_itr = low_latency;
 
current_itr = max(adapter-rx_itr, adapter-tx_itr);
 
-   /* conservative mode eliminates the lowest_latency setting */
-   if (current_itr == lowest_latency  (adapter-itr_setting == 3))
-   current_itr = low_latency;
-
switch (current_itr) {
/* counts and packets in update_itr are dependent on these numbers */
case lowest_latency:
@@ -3868,11 +3876,11 @@ e1000_clean_tx_irq(struct e1000_adapter 
cleaned = (i == eop);
 
if (cleaned) {
-   /* this packet count is wrong for TSO but has a
-* tendency to make dynamic ITR change more
-* towards bulk */
+   struct sk_buff *skb = buffer_info-skb;
+   unsigned int segs = skb_shinfo(skb)-gso_segs;
+   total_tx_packets += segs;
total_tx_packets++;
-   total_tx_bytes += buffer_info-skb-len;
+   total_tx_bytes += skb-len;
}
e1000_unmap_and_free_tx_resource(adapter, buffer_info);
tx_desc-upper.data = 0;

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 07/14] e1000: workaround for the ESB2 NIC RX unit issue

2006-12-15 Thread Arjan van de Ven
Subject: e1000: workaround for the ESB2 NIC RX unit issue
From: Jesse Brandeburg [EMAIL PROTECTED]

In rare occasions, ESB2 systems would end up started without the RX
unit being turned on. Add a check that runs post-init to work around this
issue.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000_main.c |7 +++
 1 file changed, 7 insertions(+)

Index: linux-2.6/drivers/net/e1000/e1000_main.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -2579,6 +2579,13 @@ e1000_watchdog(unsigned long data)
netif_wake_queue(netdev);
mod_timer(adapter-phy_info_timer, jiffies + 2 * HZ);
adapter-smartspeed = 0;
+   } else {
+   /* make sure the receive unit is started */
+   if (adapter-hw.mac_type == e1000_80003es2lan) {
+   struct e1000_hw *hw = adapter-hw;
+   uint32_t rctl = E1000_READ_REG(hw, RCTL);
+   E1000_WRITE_REG(hw, RCTL, rctl | E1000_RCTL_EN);
+   }
}
} else {
if (netif_carrier_ok(netdev)) {

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2.6.18 1/2] LARTC: trace control for netem: userspace

2006-12-15 Thread Rainer Baumann
Trace Control for Netem: Emulate network properties such as long range 
dependency and self-similarity of cross-traffic.

user space (iproute2):
The directory tc/netem was split in two parts, one containing the original 
distribution tables and the other the tools to generate trace files as well as 
the program responsible for reading the delay values from the trace file and 
sending them to the kernel (called flowseed).

If the trace option is set, netem initializes the kernel and starts the 
flowseedprocess. The flowseedprocess does not
send data to the kernel until the registration is completed. The data is sent 
to the kernel module via configfs. For each qdisc applied, a new directory (in 
/config/tcn/) is created. The write returns when the kernel needs new data, or 
when the corresponding qdisc was deleted. In the first case new data is sent 
and in the latter case the flowseedprocess terminates himself.

Signed-off-by: Rainer Baumann [EMAIL PROTECTED]

---

Patch for iproute2-2.6.16-060323: http://tcn.hypert.net/tcn_iproute2.patch




-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2.6.18 0/2] LARTC: trace control for netem

2006-12-15 Thread Rainer Baumann
Hi Stephen

As discussed yesterday, here our patches to integrate trace control into netem



Trace Control for Netem: Emulate network properties such as long range 
dependency and self-similarity of cross-traffic.

A new option (trace) has been added to the netem command. If the trace option 
is used, the values for packet delay etc. are read from a pregenerated trace 
file, afterwards the packets are processed by the normal netem functions. The 
packet action values are readout from the trace file in user space and sent to 
kernel space via configfs.







-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2.6.18 2/2] LARTC: trace control for netem: kernelspace

2006-12-15 Thread Rainer Baumann
Trace Control for Netem: Emulate network properties such as long range 
dependency and self-similarity of cross-traffic.

kernel space:
The delay, drop, duplication and corruption values are readout in user space 
and sent to kernel space via configfs. The userspace process will hang on 
write until the kernel needs new data.

In order to have always packet action values ready to apply, there are two 
buffers that hold these values. Packet action values can be read from one 
buffer and the other buffer can be refilled with new values simultaneously. The 
synchronization of need more delay values and return from write is done 
with the use of wait queues.

Having applied the delay value to a packet, the packet gets processed by the 
original netem functions.

Signed-off-by: Rainer Baumann [EMAIL PROTECTED]

---

Patch for linux kernel 2.6.18.13: 
http://tcn.hypert.net/tcn_kernel_configfs.patch









-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


EEPROM infrastructure (was: [PATCH] eeprom_93cx6: Add write support)

2006-12-15 Thread Ingo Oeser
Lennart Sorensen schrieb:
 On Wed, Dec 13, 2006 at 07:56:50PM +0100, Ivo van Doorn wrote:
  This patch addes support for writing to the eeprom,
  this also moves some duplicate code into seperate functions.
  
  Signed-off-by Ivo van Doorn [EMAIL PROTECTED]
 
 Thank you.  I will have a try with that to see if I can get that to work
 with the jsm driver.  Too bad the serial drivers don't have any
 geteeprom/seteeprom standard ioctl's the way ethtool does for network
 devices.

It might be even better to have eeprom writing infrastructure.

Many device types come with eeproms today and they implement
it per driver or subsystem. On embedded platforms these EEPROMs
might even be shared among different devices.

So it might be time to generalize this like we did with LEDs.

Any comments?

Regards

Ingo Oeser
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Bridge it's MAC address question

2006-12-15 Thread Lennert Buytenhek
On Mon, Oct 30, 2006 at 07:28:37AM -0800, Stephen Hemminger wrote:

  Could somebody explain, why bridge uses minimal MAC of the attached devices?
  It makes this address instable, variable during bridge life-cycle, which is 
  not good for DHCP. For example, I want to attach multiple virtual devices 
  to 
  one physical. Then, I need to make sure that after each virtual device 
  addition, bridge addr is not changed and still addr of the physical device. 
   
  Why not to use MAC of the first attached device?
 
 The bridge physical address is the minimum of all the attached devices.
 This is done because the STP standard requires it.  You can reset it
 to be the same as any of the attached devices. This will not cause a
 problem unless using STP.

You can in fact use any MAC address.  The STP standard recommends using
the minimum address, as that is deterministic, and so it doesn't depend
on the order in which you enslave subdevices.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/6] d80211: fix classify_1d() priority selection

2006-12-15 Thread Jiri Benc
On Thu, 14 Dec 2006 12:02:27 +0800, Zhu Yi wrote:
 I don't see any reason why packets with DSCP=0x40 should have lower IEEE
 802.1D priority than packets with DSCP=0x20. Spare  Background. No?

Applied to my tree, thanks.

I also applied the following patch on top of it:

--
Subject: [PATCH] d80211: simplify classify_1d

The switch in classify_1d can be simplified to a bit operation.

Signed-off-by: Jiri Benc [EMAIL PROTECTED]

---
 net/d80211/wme.c |   19 ++-
 1 files changed, 2 insertions(+), 17 deletions(-)

--- dscape.orig/net/d80211/wme.c
+++ dscape/net/d80211/wme.c
@@ -129,24 +129,9 @@ static inline unsigned classify_1d(struc
ip = (struct iphdr *) (skb-data + offset);
 
dscp = ip-tos  0xfc;
-   switch (dscp) {
-   case 0x20:
-   return 1;
-   case 0x40:
-   return 2;
-   case 0x60:
-   return 3;
-   case 0x80:
-   return 4;
-   case 0xa0:
-   return 5;
-   case 0xc0:
-   return 6;
-   case 0xe0:
-   return 7;
-   default:
+   if (dscp  0x1c)
return 0;
-   }
+   return dscp  5;
 }
 

-- 
Jiri Benc
SUSE Labs
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 00/14] E1000 bugfix series for 2.6.20

2006-12-15 Thread Jeff Garzik

Arjan van de Ven wrote:

Jeff Garzik wrote:

Arjan van de Ven wrote:

Hi,

this patch series contains critical bugfixes to the e1000 driver for
2.6.20 (and 3 very low intrusive features that help in testing). Without
these patches e1000 is totally unusable on my test machine.


Didn't Auke just submit these, and have them ACKd/NAKd as appropriate?



they're not in 2.6.20-rc1 so I suspect they didn't go anywhere...
(and Auke is on holiday for a bit afaik)


They didn't get applied because the patches need the revisions I requested.

Jeff



-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 00/14] E1000 bugfix series for 2.6.20

2006-12-15 Thread Arjan van de Ven

Jeff Garzik wrote:

Arjan van de Ven wrote:

Hi,

this patch series contains critical bugfixes to the e1000 driver for
2.6.20 (and 3 very low intrusive features that help in testing). Without
these patches e1000 is totally unusable on my test machine.


Didn't Auke just submit these, and have them ACKd/NAKd as appropriate?



they're not in 2.6.20-rc1 so I suspect they didn't go anywhere...
(and Auke is on holiday for a bit afaik)
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 00/14] E1000 bugfix series for 2.6.20

2006-12-15 Thread Arjan van de Ven

Jeff Garzik wrote:


They didn't get applied because the patches need the revisions I requested.


the patches I posted are cleaned up subset...
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 03/14] e1000: omit stats for broken counter in 82543

2006-12-15 Thread Jeff Garzik

Arjan van de Ven wrote:

Subject: e1000: omit stats for broken counter in 82543
From: Jesse Brandeburg [EMAIL PROTECTED]

The 82543 chip does not count tx_carrier_errors properly in FD mode;
report zeros instead of garbage.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000_main.c |5 +
 1 file changed, 5 insertions(+), 0 deletion(-)

Index: linux-2.6/drivers/net/e1000/e1000_main.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -3580,7 +3580,12 @@ e1000_update_stats(struct e1000_adapter 
 	adapter-net_stats.tx_errors = adapter-stats.txerrc;

adapter-net_stats.tx_aborted_errors = adapter-stats.ecol;
adapter-net_stats.tx_window_errors = adapter-stats.latecol;
adapter-net_stats.tx_carrier_errors = adapter-stats.tncrs;
+   if (adapter-hw.mac_type == e1000_82543 
+   adapter-link_duplex == FULL_DUPLEX) {
+   adapter-net_stats.tx_carrier_errors = 0;
+   adapter-stats.tncrs = 0;
+   }


Needs to use an i have broken stats feature flag, rather than adding 
yet another mac_type test into the code.  This testing of MAC type 
rather than feature flags is a major e1000 problem, and it bloats the 
driver quite a bit.  Intel has been told for /months/ this is a problem, 
yet I still see patches like this.


This is one of the comments I sent to Auke.

Jeff



-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 05/14] e1000: Fix Wake-on-Lan with forced gigabit speed

2006-12-15 Thread Jeff Garzik

Arjan van de Ven wrote:

Subject: e1000: Fix Wake-on-Lan with forced gigabit speed
From: Jesse Brandeburg [EMAIL PROTECTED]

If the user has forced gigabit speed, phy power management must be disabled;
otherwise the NIC would try to negotiate to a linkspeed of 10/100 mbit on
shutdown, which would lead to a total loss of link. This loss of link breaks
Wake-on-Lan and IPMI.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000_main.c |   14 ++
 1 file changed, 14 insertions(+)

Index: linux-2.6/drivers/net/e1000/e1000_main.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -732,6 +732,20 @@ e1000_reset(struct e1000_adapter *adapte
if (e1000_init_hw(adapter-hw))
DPRINTK(PROBE, ERR, Hardware Error\n);
e1000_update_mng_vlan(adapter);
+
+   /* if (adapter-hwflags  HWFLAGS_PHY_PWR_BIT) { */
+   if (adapter-hw.mac_type = e1000_82544 
+   adapter-hw.mac_type = e1000_82547_rev_2 
+   adapter-hw.autoneg == 1 
+   adapter-hw.autoneg_advertised == ADVERTISE_1000_FULL) {
+   uint32_t ctrl = E1000_READ_REG(adapter-hw, CTRL);
+   /* clear phy power management bit if we are in gig only mode,
+* which if enabled will attempt negotiation to 100Mb, which
+* can cause a loss of link at power off or driver unload */
+   ctrl = ~E1000_CTRL_SWDPIN3;
+   E1000_WRITE_REG(adapter-hw, CTRL, ctrl);


NAK, for same reason as other patches.

I have been telling Intel this for months, yet keep seeing the same patches.


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 06/14] e1000: disable TSO on the 82544 with slab debugging

2006-12-15 Thread Jeff Garzik

Arjan van de Ven wrote:

Subject: e1000: disable TSO on the 82544 with slab debugging
From: Jesse Brandeburg [EMAIL PROTECTED]

CONFIG_DEBUG_SLAB changes alignments of the data structures the slab
allocators return. These break certain workarounds for TSO on the 82544.
Since DEBUG_SLAB is relatively rare and not used for performance sensitive
cases, the simplest fix is to disable TSO in this special situation.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000_main.c |6 ++
 1 file changed, 6 insertions(+)

Index: linux-2.6/drivers/net/e1000/e1000_main.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -911,6 +911,12 @@ e1000_probe(struct pci_dev *pdev,
   (adapter-hw.mac_type != e1000_82547))
netdev-features |= NETIF_F_TSO;
 
+#ifdef CONFIG_DEBUG_SLAB

+   /* 82544's work arounds do not play nicely with DEBUG SLAB */
+   if (adapter-hw.mac_type == e1000_82544)
+   netdev-features = ~NETIF_F_TSO;
+#endif


NAK, same reason as the others


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 04/14] e1000: consolidate managability enabling/disabling

2006-12-15 Thread Jeff Garzik

Arjan van de Ven wrote:

+static void
+e1000_init_manageability(struct e1000_adapter *adapter)
+{
+   if (adapter-en_mng_pt) {
+   uint32_t manc2h = E1000_READ_REG(adapter-hw, MANC2H);
+   uint32_t manc = E1000_READ_REG(adapter-hw, MANC);
+
+   /* disable hardware interception of ARP */
+   manc = ~(E1000_MANC_ARP_EN);
+
+   /* enable receiving management packets to the host */
+   /* this will probably generate destination unreachable messages
+* from the host OS, but the packets will be handled on SMBUS */
+   if (adapter-hw.mac_type = e1000_82571) {
+   manc |= E1000_MANC_EN_MNG2HOST;
+#define E1000_MNG2HOST_PORT_623 (1  5)
+#define E1000_MNG2HOST_PORT_664 (1  6)
+   manc2h |= E1000_MNG2HOST_PORT_623;
+   manc2h |= E1000_MNG2HOST_PORT_664;
+   E1000_WRITE_REG(adapter-hw, MANC2H, manc2h);
+   }
+
+   E1000_WRITE_REG(adapter-hw, MANC, manc);
+   }
+}
+
+static void
+e1000_release_manageability(struct e1000_adapter *adapter)
+{
+   if (adapter-en_mng_pt) {
+   uint32_t manc = E1000_READ_REG(adapter-hw, MANC);
+
+   /* re-enable hardware interception of ARP */
+   manc |= E1000_MANC_ARP_EN;
+
+   if (adapter-hw.mac_type = e1000_82571)
+   manc = ~E1000_MANC_EN_MNG2HOST;
+
+   /* don't explicitly have to mess with MANC2H since
+* MANC has an enable disable that gates MANC2H */
+
+   E1000_WRITE_REG(adapter-hw, MANC, manc);
+   }
+}


This patch adds more error-probe mac_type tests, rather than a simple 
and tough-to-screw-up E1000_HAS_MGMT feature bit.




+   /* If the controller is 82573 and f/w is AMT, do not set
+* DRV_LOAD until the interface is up.  For all other cases,
+* let the f/w know that the h/w is now under the control
+* of the driver. */
+   if (adapter-hw.mac_type != e1000_82573 ||
+   !e1000_check_mng_mode(adapter-hw))
+   e1000_get_hw_control(adapter);
 
-	if (netif_running(netdev))

-   mod_timer(adapter-watchdog_timer, jiffies);


ditto

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 09/14] e1000: fix ethtool reported bus type for older adapters

2006-12-15 Thread Jeff Garzik

Arjan van de Ven wrote:

Subject: e1000: fix ethtool reported bus type for older adapters
From: Jeff Kirsher [EMAIL PROTECTED]

For older adapters we know that they are of the PCI bus type, so we can
just set this.

Signed-off-by: Jeff Kirsher [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]


ACK patches 1-2, 8-9


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 07/14] e1000: workaround for the ESB2 NIC RX unit issue

2006-12-15 Thread Jeff Garzik

Arjan van de Ven wrote:

Subject: e1000: workaround for the ESB2 NIC RX unit issue
From: Jesse Brandeburg [EMAIL PROTECTED]

In rare occasions, ESB2 systems would end up started without the RX
unit being turned on. Add a check that runs post-init to work around this
issue.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000_main.c |7 +++
 1 file changed, 7 insertions(+)

Index: linux-2.6/drivers/net/e1000/e1000_main.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -2579,6 +2579,13 @@ e1000_watchdog(unsigned long data)
netif_wake_queue(netdev);
mod_timer(adapter-phy_info_timer, jiffies + 2 * HZ);
adapter-smartspeed = 0;
+   } else {
+   /* make sure the receive unit is started */
+   if (adapter-hw.mac_type == e1000_80003es2lan) {
+   struct e1000_hw *hw = adapter-hw;
+   uint32_t rctl = E1000_READ_REG(hw, RCTL);
+   E1000_WRITE_REG(hw, RCTL, rctl | E1000_RCTL_EN);
+   }


NAK, ditto


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 10/14] e1000: narrow down the scope of the tipg timer tweak

2006-12-15 Thread Jeff Garzik

Arjan van de Ven wrote:

Subject: e1000: narrow down the scope of the tipg timer tweak
From: Jesse Brandeburg [EMAIL PROTECTED]

the driver has (ancient) code for messing with TIPG from the 82542 days.
Unfortunately this code was running on our current adapters and setting
TIPG for fiber to be +1 over the copper value.  This caused 1.45Mpps
to be sent instead of 1.487Mpps.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000_main.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/net/e1000/e1000_main.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -1582,9 +1582,9 @@ e1000_configure_tx(struct e1000_adapter 
 	}
 
 	/* Set the default values for the Tx Inter Packet Gap timer */

-
-   if (hw-media_type == e1000_media_type_fiber ||
-   hw-media_type == e1000_media_type_internal_serdes)
+   if (adapter-hw.mac_type = e1000_82547_rev_2 
+   (hw-media_type == e1000_media_type_fiber ||
+hw-media_type == e1000_media_type_internal_serdes))
tipg = DEFAULT_82543_TIPG_IPGT_FIBER;
else
tipg = DEFAULT_82543_TIPG_IPGT_COPPER;


NAK, ditto


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 12/14] e1000: Make the copybreak value a module parameter

2006-12-15 Thread Jeff Garzik

Arjan van de Ven wrote:

Subject: e1000: Make the copybreak value a module parameter
From: Jesse Brandeburg [EMAIL PROTECTED]

Allow the user to vary the size that copybreak works. Currently cb is enabled
for packets  256 bytes, but various tests indicate that this should be
configurable for specific use cases. In addition, this parameter allows us
to force never/always during testing to get full and predictable coverage of 
both code paths.


Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]


ACK patches 11-12


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 13/14] e1000: 3 new driver stats for managability testing

2006-12-15 Thread Jeff Garzik

Arjan van de Ven wrote:

Subject: e1000: 3 new driver stats for managability testing
From: Jesse Brandeburg [EMAIL PROTECTED]

Add 3 extra packet redirect counters for tracking purposes to make sure we
can test that all packets arrive properly.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000_ethtool.c |3 +++
 drivers/net/e1000/e1000_main.c|7 +++
 2 files changed, 10 insertions(+)

Index: linux-2.6/drivers/net/e1000/e1000_ethtool.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_ethtool.c
+++ linux-2.6/drivers/net/e1000/e1000_ethtool.c
@@ -100,6 +100,9 @@ static const struct e1000_stats e1000_gs
{ rx_csum_offload_errors, E1000_STAT(hw_csum_err) },
{ rx_header_split, E1000_STAT(rx_hdr_split) },
{ alloc_rx_buff_failed, E1000_STAT(alloc_rx_buff_failed) },
+   { tx_smbus, E1000_STAT(stats.mgptc) },
+   { rx_smbus, E1000_STAT(stats.mgprc) },
+   { dropped_smbus, E1000_STAT(stats.mgpdc) },
 };
 
 #define E1000_QUEUE_STATS_LEN 0

Index: linux-2.6/drivers/net/e1000/e1000_main.c
===
--- linux-2.6.orig/drivers/net/e1000/e1000_main.c
+++ linux-2.6/drivers/net/e1000/e1000_main.c
@@ -3633,6 +3633,13 @@ e1000_update_stats(struct e1000_adapter 
 			adapter-phy_stats.receive_errors += phy_tmp;

}
 
+	/* Management Stats */

+   if (adapter-hw.mac_type  e1000_82544) {
+   adapter-stats.mgptc += E1000_READ_REG(hw, MGTPTC);
+   adapter-stats.mgprc += E1000_READ_REG(hw, MGTPRC);
+   adapter-stats.mgpdc += E1000_READ_REG(hw, MGTPDC);
+   }
+


NAK, ditto


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 14/14] e1000: No-delay link detection at interface up

2006-12-15 Thread Jeff Garzik

Arjan van de Ven wrote:

Subject: e1000: No-delay link detection at interface up
From: Jesse Brandeburg [EMAIL PROTECTED]

Currently after an interface up, the link state is detected 2 seconds later
when the first watchdog timer runs. This patch changes that by triggering
the hardware to generate a link-change interrupt from the up() function
instead. This has the result that the link state gets detected immediately
and without races. This has the potential to speed up booting since a normal
distribution boot process waits for a link before DHCP is attempted.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]


ACK, though you can also just schedule the timer to run immediately, or 
even run it yourself inside spin_lock_bh()


Jeff



-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 14/14] e1000: No-delay link detection at interface up

2006-12-15 Thread Arjan van de Ven

Jeff Garzik wrote:
ACK, though you can also just schedule the timer to run immediately, or 
even run it yourself inside spin_lock_bh()


sure but this is very simple, clean and obvious ;)
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 03/14] e1000: omit stats for broken counter in 82543

2006-12-15 Thread Arjan van de Ven

Jeff Garzik wrote:
Needs to use an i have broken stats feature flag, rather than adding 
yet another mac_type test into the code.  This testing of MAC type 
rather than feature flags is a major e1000 problem, and it bloats the 
driver quite a bit.  Intel has been told for /months/ this is a problem, 
yet I still see patches like this.


it is nice that you say this, and Intel is working on a flags 
based driver. However that is, as you state yourself here, a major 
invasive change, and thus not suitable for 2.6.20 inclusion. Yet these 
fixes are important bugfixes; I don't think it's fair to hold these 
hostage..


Greetings,
  Arjan van de Ven
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 03/14] e1000: omit stats for broken counter in 82543

2006-12-15 Thread Jeff Garzik

Arjan van de Ven wrote:

Jeff Garzik wrote:
Needs to use an i have broken stats feature flag, rather than adding 
yet another mac_type test into the code.  This testing of MAC type 
rather than feature flags is a major e1000 problem, and it bloats the 
driver quite a bit.  Intel has been told for /months/ this is a 
problem, yet I still see patches like this.


it is nice that you say this, and Intel is working on a flags based 
driver. However that is, as you state yourself here, a major invasive 
change, and thus not suitable for 2.6.20 inclusion. Yet these fixes are 
important bugfixes; I don't think it's fair to hold these hostage..


Completely false.  I /never/ said it was a major invasive change.

The following is obviously /not/ an invasive change, but rather a simple 
incremental approach:


1) Define unsigned long flags in your adapter struct
(only has to be done once)

2) For the management patch (patch #3?), define a flag 
E1000_FLG_I_HAVE_MGMT.


3) Set this flag everywhere patch #3 does a mac_type test.  Appears to 
be 2-4 locations TOUCHED BY THE PATCH ANYWAY.


4) Watch the patch get applied.

Shall I do this for Intel, since this has been explained multiple times 
without success?  This is not an invasive approach, it only touches what 
code you were touching anyway.



A WORD OF WARNING:  I am also highly suspicious of impending driver 
rewrites.  Such massive events inevitably break 'git bisect'.  A far 
better approach is the Al Viro equivalent-transformation approach, which 
does not break 'git bisect' and can be easily verified by a human.


Jeff



-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 14/14] e1000: No-delay link detection at interface up

2006-12-15 Thread Jeff Garzik

Arjan van de Ven wrote:

Jeff Garzik wrote:
ACK, though you can also just schedule the timer to run immediately, 
or even run it yourself inside spin_lock_bh()


sure but this is very simple, clean and obvious ;)


Hence the ACK...

Jeff



-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] d80211: add missing \n in skb queue warning

2006-12-15 Thread Johannes Berg
This just adds a missing \n I noticed when I got the warning (see my
other mail)

Signed-off-by: Johannes Berg [EMAIL PROTECTED]

--- wireless-dev.orig/net/d80211/ieee80211.c2006-12-14 20:14:50.150611855 
+0100
+++ wireless-dev/net/d80211/ieee80211.c 2006-12-14 20:14:55.118611855 +0100
@@ -4709,7 +4709,7 @@ void ieee80211_unregister_hw(struct ieee
 
if (skb_queue_len(local-skb_queue)
|| skb_queue_len(local-skb_queue_unreliable))
-   printk(KERN_WARNING %s: skb_queue not empty,
+   printk(KERN_WARNING %s: skb_queue not empty\n,
   local-mdev-name);
skb_queue_purge(local-skb_queue);
skb_queue_purge(local-skb_queue_unreliable);


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/6] d80211: add IEEE802.11e/WMM Traffic Stream (TS) Management support

2006-12-15 Thread Johannes Berg
Some comments...

In these cases 
 
 + init_timer(ifsta-admit_timer);
 + ifsta-admit_timer.data = (unsigned long) dev;
 + ifsta-admit_timer.function = ieee80211_admit_refresh;

 +void ieee80211_send_addts(struct net_device *dev,
 + struct ieee802_11_elem_tspec *tspec)

 +void wmm_send_addts(struct net_device *dev, struct ieee802_11_elem_tspec 
 *tspec)

 +void ieee80211_send_delts(struct net_device *dev, u8 tsid, u8 direction,
 + u32 medium_time)

 +void wmm_send_delts(struct net_device *dev, u8 tsid, u8 direction,
 +   u32 medium_time)

please don't use the device as the argument but rather the sdata. Using
the device only to unwrap it to the sdata again isn't really nice.

 + mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24);
 + memset(mgmt, 0, 24);
 + memcpy(mgmt-da, ifsta-bssid, ETH_ALEN);
 + memcpy(mgmt-sa, dev-dev_addr, ETH_ALEN);
 + memcpy(mgmt-bssid, ifsta-bssid, ETH_ALEN);

No need to zero out the structure if you set all fields anyway.

 + mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24);
 + memset(mgmt, 0, 24);
 + memcpy(mgmt-da, ifsta-bssid, ETH_ALEN);
 + memcpy(mgmt-sa, dev-dev_addr, ETH_ALEN);
 + memcpy(mgmt-bssid, ifsta-bssid, ETH_ALEN);
 + mgmt-frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT,
 +IEEE80211_STYPE_ACTION);

same here.

 + mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24);
 + memset(mgmt, 0, 24);

and here, and in a few more places. 
 
 +static u32 calculate_mpdu_exchange_time(struct ieee802_11_elem_tspec *tspec)
 +{
 + /*
 +  * MPDUExchangeTime = duration(Nominal MSDU Size, Min PHY Rate) +
 +  *SIFS + ACK duration
 +  */
 + return 5000;
 +}

Is this correct? Aren't some of those things variable?

 + printk(KERN_DEBUG Dialog_token: %d, TID: %u, Direction: %u, PSB: %d, 
 +UP: %d\n, mgmt-u.action.u.wme_action.dialog_token,
 +tspec-ts_info.tsid, tspec-ts_info.direction,
 +tspec-ts_info.apsd, tspec-ts_info.up);

Can we have those printks optional?

 +static void ieee80211_rx_mgmt_action(struct net_device *dev,

 + if (len  24 + 1) {
 + printk(KERN_DEBUG %s: too short (%zd) action frame 
 +received from  MAC_FMT  - ignored\n,
 +dev-name, len, MAC_ARG(mgmt-sa));
 + return;
 + }

Do we really want this if in all possibilities where we use the data it
needs to be 24+4 long?

 + case WLAN_CATEGORY_DLS:
 + case WLAN_CATEGORY_BACK:
 + default:
 + printk(KERN_ERR %s: unsupported action category %d\n,
 +dev-name, mgmt-u.action.category);
 + break;

I don't think these are KERN_ERR. 
 
johannes


signature.asc
Description: This is a digitally signed message part


d80211 oops with bcm43xx-d80211

2006-12-15 Thread Johannes Berg
Turns out I was right, current bcm43xx-d80211 oopses when rmmod'ed in
use... However, it looks like d80211 is to blame.

the instruction c003030c is in the middle of tasklet_action and it's a
free-after-use type of thing as you can see from accessing 0x6b6b6b73,
in fact, the code in question is:

c003030c:   80 0b 00 08 lwz r0,8(r11)

and you can see that r11 is 6b6b6b6b so obviously some tasklet is freed
while being scheduled, then the tasklet handler comes along and oopses
trying to execute it.

The skb_queue not empty message would indicate that it's probably
tx_pending_tasklet, but I haven't really been able to come up with a fix
or even an explanation of why this happens... The queue should be empty
at that point, otherwise we leak SKBs too! 

Here's the full backtrace, it's a bit confusing because mutex debugging
comes in as well, we'll have to see if that is a separate problem. 

[  148.056722] bcm43xx_d80211: DMA-32 0x02A0 (TX) max used slots: 0/128
[  148.057799] bcm43xx_d80211: DMA-32 0x0280 (TX) max used slots: 0/128
[  148.058845] bcm43xx_d80211: DMA-32 0x0260 (TX) max used slots: 0/128
[  148.059912] bcm43xx_d80211: DMA-32 0x0240 (TX) max used slots: 0/128
[  148.060978] bcm43xx_d80211: DMA-32 0x0220 (TX) max used slots: 2/128
[  148.062045] bcm43xx_d80211: DMA-32 0x0200 (TX) max used slots: 0/128
[  148.063159] bcm43xx_d80211: Virtual interface removed (type: 0x0002, ID: 
7, MAC: 00:11:24:91:07:4d)
[  148.513009] wmaster0: skb_queue not empty1Unable to handle kernel paging 
request for data at address 0x6b6b6b73
[  148.519927] Faulting instruction address: 0xc003030c
[  148.520615] Badness in __mutex_lock_common at kernel/mutex.c:132
[  148.521329] Call Trace:
[  148.521914] [C11BBB80] [C0009048] show_stack+0x3c/0x194 (unreliable)
[  148.522762] [C110] [C000FE64] program_check_exception+0x47c/0x598
[  148.523561] [C11BBC00] [C001153C] ret_from_except_full+0x0/0x4c
[  148.524336] --- Exception: 700 at __mutex_lock_slowpath+0x168/0x170
[  148.525104] LR = __mutex_lock_slowpath+0x160/0x170
[  148.525785] [C11BBCC0] [C0221398] kfree_skbmem+0x70/0xf4 (unreliable)
[  148.526613] [C11BBD10] [C000F3DC] die+0x54/0x1b4
[  148.527329] [C11BBD30] [C0014ECC] bad_page_fault+0xbc/0xd4
[  148.528063] [C11BBD40] [C001137C] handle_page_fault+0x7c/0x80
[  148.528813] --- Exception: 300 at tasklet_action+0x84/0xe8
[  148.529559] LR = __do_softirq+0x80/0xf4
[  148.530211] [C11BBE00] [C007E058] cache_alloc_debugcheck_after+0x1a8/0x1e8 
(unreliable)
[  148.531068] [C11BBE20] [C00304D8] __do_softirq+0x80/0xf4
[  148.531812] [C11BBE50] [C00069DC] do_softirq+0x58/0x5c
[  148.532537] [C11BBE60] [C00301A8] local_bh_enable+0x6c/0x94
[  148.533279] [C11BBE70] [C021D2F0] lock_sock+0xa0/0xb4
[  148.534024] [C11BBEB0] [C021A610] sock_fasync+0x40/0x130
[  148.534768] [C11BBEE0] [C021C378] sock_close+0x2c/0x68
[  148.535489] [C11BBEF0] [C00843AC] __fput+0xc8/0x1e0
[  148.536235] [C11BBF10] [C0080DF8] filp_close+0x64/0xa0
[  148.536977] [C11BBF30] [C0080ECC] sys_close+0x98/0xc4
[  148.537718] [C11BBF40] [C0010EE0] ret_from_syscall+0x0/0x38
[  148.538469] --- Exception: c01 at 0xff22a24
[  148.539184] LR = 0x1000bd78
[  148.539798] Oops: Kernel access of bad area, sig: 11 [#1]
[  148.540479] 
[  148.541035] Modules linked in: af_packet arc4 rc80211_simple snd_powermac 
configfs nls_utf8 hfsplus nls_base dm_snapshot dm_mirror sha256 eth1394 joydev 
appletouch usbhid ssb 80211 snd_aoa_codec_tas snd_aoa_fabric_layout snd_aoa 
pcmcia firmware_class ieee80211softmac ieee80211 ieee80211_crypt ohci1394 
ieee1394 snd_aoa_i2sbus snd_pcm snd_timer snd_page_alloc snd soundcore 
snd_aoa_soundbus ehci_hcd ohci_hcd yenta_socket usbcore uninorth_agp 
rsrc_nonstatic pcmcia_core agpgart evdev unix
[  148.546406] NIP: C003030C LR: C00304D8 CTR: C0030288
[  148.547084] REGS: c11bbd50 TRAP: 0300   Not tainted  (2.6.19-rc6)
[  148.547786] MSR: 9032 EE,ME,IR,DR  CR: 44002484  XER: 2000
[  148.548756] DAR: 6B6B6B73, DSISR: 4000
[  148.549406] TASK = c1dd7300[1816] 'udevd' THREAD: c11ba000
[  148.549606] GPR00: 9032 C11BBE00 C1DD7300 C077FA48 05FC 05FC 
  
[  148.550703] GPR08: CFD997AC   6B6B6B6B 84000488 1002714C 
28204422  
[  148.551805] GPR16: 100FB7A8 100D 100B 100D 0007 000E 
100210CC 10021147 
[  148.552926] GPR24: C078  C0781458 0001 C078 C058 
0001 6B6B6B6B 
[  148.554530] NIP [C003030C] tasklet_action+0x84/0xe8
[  148.555245] LR [C00304D8] __do_softirq+0x80/0xf4
[  148.555942] Call Trace:
[  148.556518] [C11BBE00] [C007E058] cache_alloc_debugcheck_after+0x1a8/0x1e8 
(unreliable)
[  148.557404] [C11BBE20] [C00304D8] __do_softirq+0x80/0xf4
[  148.558127] [C11BBE50] [C00069DC] do_softirq+0x58/0x5c
[  148.558851] [C11BBE60] [C00301A8] local_bh_enable+0x6c/0x94
[  148.559611] [C11BBE70] [C021D2F0] lock_sock+0xa0/0xb4
[  148.560346] [C11BBEB0] [C021A610] sock_fasync+0x40/0x130
[  148.561076] [C11BBEE0] 

Re: [patch 00/14] E1000 bugfix series for 2.6.20

2006-12-15 Thread Jeff Garzik

Arjan van de Ven wrote:

Hi,

this patch series contains critical bugfixes to the e1000 driver for
2.6.20 (and 3 very low intrusive features that help in testing). Without
these patches e1000 is totally unusable on my test machine.


Didn't Auke just submit these, and have them ACKd/NAKd as appropriate?

Jeff



-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: d80211 oops with bcm43xx-d80211

2006-12-15 Thread Michael Buesch
On Friday 15 December 2006 15:56, Johannes Berg wrote:
 Turns out I was right, current bcm43xx-d80211 oopses when rmmod'ed in
 use... However, it looks like d80211 is to blame.

It turns out to oops only sometimes for me.
And if, then with some very strange looking oopses.

 the instruction c003030c is in the middle of tasklet_action and it's a
 free-after-use type of thing as you can see from accessing 0x6b6b6b73,

use-after-free?

 in fact, the code in question is:
 
 c003030c:   80 0b 00 08 lwz r0,8(r11)
 
 and you can see that r11 is 6b6b6b6b so obviously some tasklet is freed
 while being scheduled, then the tasklet handler comes along and oopses
 trying to execute it.
 
 The skb_queue not empty message would indicate that it's probably
 tx_pending_tasklet, but I haven't really been able to come up with a fix
 or even an explanation of why this happens... The queue should be empty
 at that point, otherwise we leak SKBs too! 
 
 Here's the full backtrace, it's a bit confusing because mutex debugging
 comes in as well, we'll have to see if that is a separate problem. 
 
 [  148.056722] bcm43xx_d80211: DMA-32 0x02A0 (TX) max used slots: 0/128
 [  148.057799] bcm43xx_d80211: DMA-32 0x0280 (TX) max used slots: 0/128
 [  148.058845] bcm43xx_d80211: DMA-32 0x0260 (TX) max used slots: 0/128
 [  148.059912] bcm43xx_d80211: DMA-32 0x0240 (TX) max used slots: 0/128
 [  148.060978] bcm43xx_d80211: DMA-32 0x0220 (TX) max used slots: 2/128
 [  148.062045] bcm43xx_d80211: DMA-32 0x0200 (TX) max used slots: 0/128
 [  148.063159] bcm43xx_d80211: Virtual interface removed (type: 0x0002, 
 ID: 7, MAC: 00:11:24:91:07:4d)
 [  148.513009] wmaster0: skb_queue not empty1Unable to handle kernel paging 
 request for data at address 0x6b6b6b73
 [  148.519927] Faulting instruction address: 0xc003030c
 [  148.520615] Badness in __mutex_lock_common at kernel/mutex.c:132
 [  148.521329] Call Trace:
 [  148.521914] [C11BBB80] [C0009048] show_stack+0x3c/0x194 (unreliable)
 [  148.522762] [C110] [C000FE64] program_check_exception+0x47c/0x598
 [  148.523561] [C11BBC00] [C001153C] ret_from_except_full+0x0/0x4c
 [  148.524336] --- Exception: 700 at __mutex_lock_slowpath+0x168/0x170
 [  148.525104] LR = __mutex_lock_slowpath+0x160/0x170
 [  148.525785] [C11BBCC0] [C0221398] kfree_skbmem+0x70/0xf4 (unreliable)
 [  148.526613] [C11BBD10] [C000F3DC] die+0x54/0x1b4
 [  148.527329] [C11BBD30] [C0014ECC] bad_page_fault+0xbc/0xd4
 [  148.528063] [C11BBD40] [C001137C] handle_page_fault+0x7c/0x80
 [  148.528813] --- Exception: 300 at tasklet_action+0x84/0xe8
 [  148.529559] LR = __do_softirq+0x80/0xf4
 [  148.530211] [C11BBE00] [C007E058] cache_alloc_debugcheck_after+0x1a8/0x1e8 
 (unreliable)
 [  148.531068] [C11BBE20] [C00304D8] __do_softirq+0x80/0xf4
 [  148.531812] [C11BBE50] [C00069DC] do_softirq+0x58/0x5c
 [  148.532537] [C11BBE60] [C00301A8] local_bh_enable+0x6c/0x94
 [  148.533279] [C11BBE70] [C021D2F0] lock_sock+0xa0/0xb4
 [  148.534024] [C11BBEB0] [C021A610] sock_fasync+0x40/0x130
 [  148.534768] [C11BBEE0] [C021C378] sock_close+0x2c/0x68
 [  148.535489] [C11BBEF0] [C00843AC] __fput+0xc8/0x1e0
 [  148.536235] [C11BBF10] [C0080DF8] filp_close+0x64/0xa0
 [  148.536977] [C11BBF30] [C0080ECC] sys_close+0x98/0xc4
 [  148.537718] [C11BBF40] [C0010EE0] ret_from_syscall+0x0/0x38
 [  148.538469] --- Exception: c01 at 0xff22a24
 [  148.539184] LR = 0x1000bd78
 [  148.539798] Oops: Kernel access of bad area, sig: 11 [#1]
 [  148.540479] 
 [  148.541035] Modules linked in: af_packet arc4 rc80211_simple snd_powermac 
 configfs nls_utf8 hfsplus nls_base dm_snapshot dm_mirror sha256 eth1394 
 joydev appletouch usbhid ssb 80211 snd_aoa_codec_tas snd_aoa_fabric_layout 
 snd_aoa pcmcia firmware_class ieee80211softmac ieee80211 ieee80211_crypt 
 ohci1394 ieee1394 snd_aoa_i2sbus snd_pcm snd_timer snd_page_alloc snd 
 soundcore snd_aoa_soundbus ehci_hcd ohci_hcd yenta_socket usbcore 
 uninorth_agp rsrc_nonstatic pcmcia_core agpgart evdev unix
 [  148.546406] NIP: C003030C LR: C00304D8 CTR: C0030288
 [  148.547084] REGS: c11bbd50 TRAP: 0300   Not tainted  (2.6.19-rc6)
 [  148.547786] MSR: 9032 EE,ME,IR,DR  CR: 44002484  XER: 2000
 [  148.548756] DAR: 6B6B6B73, DSISR: 4000
 [  148.549406] TASK = c1dd7300[1816] 'udevd' THREAD: c11ba000
 [  148.549606] GPR00: 9032 C11BBE00 C1DD7300 C077FA48 05FC 05FC 
   
 [  148.550703] GPR08: CFD997AC   6B6B6B6B 84000488 1002714C 
 28204422  
 [  148.551805] GPR16: 100FB7A8 100D 100B 100D 0007 000E 
 100210CC 10021147 
 [  148.552926] GPR24: C078  C0781458 0001 C078 C058 
 0001 6B6B6B6B 
 [  148.554530] NIP [C003030C] tasklet_action+0x84/0xe8
 [  148.555245] LR [C00304D8] __do_softirq+0x80/0xf4
 [  148.555942] Call Trace:
 [  148.556518] [C11BBE00] [C007E058] cache_alloc_debugcheck_after+0x1a8/0x1e8 
 (unreliable)
 [  148.557404] [C11BBE20] [C00304D8] __do_softirq+0x80/0xf4
 [  

Re: d80211 oops with bcm43xx-d80211

2006-12-15 Thread Johannes Berg
On Fri, 2006-12-15 at 16:23 +0100, Michael Buesch wrote:

 It turns out to oops only sometimes for me.
 And if, then with some very strange looking oopses.

Yeah but that's probably because most of the stacktrace is from whatever
was running when the softirq was run...

  the instruction c003030c is in the middle of tasklet_action and it's a
  free-after-use type of thing as you can see from accessing 0x6b6b6b73,
 
 use-after-free?

yes, but the use is trying to run tasklet

johannes


signature.asc
Description: This is a digitally signed message part


Re: [patch 03/14] e1000: omit stats for broken counter in 82543

2006-12-15 Thread Jeff Garzik

Arjan van de Ven wrote:

Subject: e1000: omit stats for broken counter in 82543
From: Jesse Brandeburg [EMAIL PROTECTED]

The 82543 chip does not count tx_carrier_errors properly in FD mode;
report zeros instead of garbage.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]


I rewrote your patch #3 into the attached patch.  Man, that was hard. 
It was a MAJOR REVISION, trust me.


See attached.  (e1000 even ALREADY HAS some feature flags for this sort 
of thing)


Jeff


diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 0201ca5..7376609 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -442,6 +442,9 @@ e1000_set_mac_type(struct e1000_hw *hw)
break;
}
 
+   if (hw-mac_type == e1000_82543)
+   hw-bad_tx_carr_stats_fd = TRUE;
+
return E1000_SUCCESS;
 }
 
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index 28cdfe3..fef1f7b 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -1460,6 +1460,7 @@ struct e1000_hw {
boolean_t   mng_reg_access_disabled;
boolean_t   leave_av_bit_off;
boolean_t   kmrn_lock_loss_workaround_disabled;
+   boolean_t   bad_tx_carr_stats_fd;
 };
 
 
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 62ef267..0816de2 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3581,6 +3581,11 @@ e1000_update_stats(struct e1000_adapter *adapter)
adapter-net_stats.tx_aborted_errors = adapter-stats.ecol;
adapter-net_stats.tx_window_errors = adapter-stats.latecol;
adapter-net_stats.tx_carrier_errors = adapter-stats.tncrs;
+   if (adapter-hw.bad_tx_carr_stats_fd 
+   adapter-link_duplex == FULL_DUPLEX) {
+   adapter-net_stats.tx_carrier_errors = 0;
+   adapter-stats.tncrs = 0;
+   }
 
/* Tx Dropped needs to be maintained elsewhere */
 


Re: [Bridge] Bridge it's MAC address question

2006-12-15 Thread Stephen Hemminger
On Fri, 15 Dec 2006 14:19:08 +0100
Lennert Buytenhek [EMAIL PROTECTED] wrote:

 On Mon, Oct 30, 2006 at 07:28:37AM -0800, Stephen Hemminger wrote:
 
   Could somebody explain, why bridge uses minimal MAC of the attached 
   devices?
   It makes this address instable, variable during bridge life-cycle, which 
   is 
   not good for DHCP. For example, I want to attach multiple virtual devices 
   to 
   one physical. Then, I need to make sure that after each virtual device 
   addition, bridge addr is not changed and still addr of the physical 
   device.  
   Why not to use MAC of the first attached device?
  
  The bridge physical address is the minimum of all the attached devices.
  This is done because the STP standard requires it.  You can reset it
  to be the same as any of the attached devices. This will not cause a
  problem unless using STP.
 
 You can in fact use any MAC address.  The STP standard recommends using
 the minimum address, as that is deterministic, and so it doesn't depend
 on the order in which you enslave subdevices.

So should restriction be lifted?
Please update wiki page FAQ, or I'll do it
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] netxen: remove private ioctl

2006-12-15 Thread Stephen Hemminger
The netxen driver includes a private ioctl that provides access
to functionality that is already available in other ways. The PCI
layer has application access hooks (see setpci), and the statistics
are available in ethtool/netstats.

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]
---
 drivers/net/netxen/netxen_nic.h |   11 -
 drivers/net/netxen/netxen_nic_ethtool.c |5 -
 drivers/net/netxen/netxen_nic_hw.c  |  294 ---
 drivers/net/netxen/netxen_nic_init.c|  237 -
 drivers/net/netxen/netxen_nic_ioctl.h   |   77 
 drivers/net/netxen/netxen_nic_main.c|   45 -
 6 files changed, 1 insertions(+), 668 deletions(-)

diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index b5410be..b4c4fc0 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -1027,14 +1027,6 @@ int netxen_nic_hw_read_wx(struct netxen_
  int len);
 int netxen_nic_hw_write_wx(struct netxen_adapter *adapter, u64 off, void *data,
   int len);
-int netxen_nic_hw_read_ioctl(struct netxen_adapter *adapter, u64 off,
-void *data, int len);
-int netxen_nic_hw_write_ioctl(struct netxen_adapter *adapter, u64 off,
- void *data, int len);
-int netxen_nic_pci_mem_write_ioctl(struct netxen_adapter *adapter,
-  u64 off, void *data, int size);
-int netxen_nic_pci_mem_read_ioctl(struct netxen_adapter *adapter,
- u64 off, void *data, int size);
 void netxen_crb_writelit_adapter(struct netxen_adapter *adapter,
 unsigned long off, int data);
 
@@ -1067,9 +1059,6 @@ void netxen_tso_check(struct netxen_adap
  struct cmd_desc_type0 *desc, struct sk_buff *skb);
 int netxen_nic_hw_resources(struct netxen_adapter *adapter);
 void netxen_nic_clear_stats(struct netxen_adapter *adapter);
-int
-netxen_nic_do_ioctl(struct netxen_adapter *adapter, void *u_data,
-   struct netxen_port *port);
 int netxen_nic_rx_has_work(struct netxen_adapter *adapter);
 int netxen_nic_tx_has_work(struct netxen_adapter *adapter);
 void netxen_watchdog_task(struct work_struct *work);
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c 
b/drivers/net/netxen/netxen_nic_ethtool.c
index 2ab4885..3404461 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -42,7 +42,6 @@ #include linux/version.h
 #include netxen_nic_hw.h
 #include netxen_nic.h
 #include netxen_nic_phan_reg.h
-#include netxen_nic_ioctl.h
 
 struct netxen_nic_stats {
char stat_string[ETH_GSTRING_LEN];
@@ -79,8 +78,7 @@ static const struct netxen_nic_stats net
{tx_bytes, NETXEN_NIC_STAT(stats.txbytes)},
 };
 
-#define NETXEN_NIC_STATS_LEN   \
-   sizeof(netxen_nic_gstrings_stats) / sizeof(struct netxen_nic_stats)
+#define NETXEN_NIC_STATS_LEN   ARRAY_SIZE(netxen_nic_gstrings_stats)
 
 static const char netxen_nic_gstrings_test[][ETH_GSTRING_LEN] = {
Register_Test_offline, EEPROM_Test_offline,
@@ -711,7 +709,6 @@ netxen_nic_get_ethtool_stats(struct net_
(netxen_nic_gstrings_stats[index].sizeof_stat ==
 sizeof(u64)) ? *(u64 *) p : *(u32 *) p;
}
-
 }
 
 struct ethtool_ops netxen_nic_ethtool_ops = {
diff --git a/drivers/net/netxen/netxen_nic_hw.c 
b/drivers/net/netxen/netxen_nic_hw.c
index 9147b60..5dac50c 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -997,297 +997,3 @@ void netxen_nic_flash_print(struct netxe
   fw_major, fw_minor);
 }
 
-int netxen_crb_read_val(struct netxen_adapter *adapter, unsigned long off)
-{
-   int data;
-   netxen_nic_hw_read_wx(adapter, off, data, 4);
-   return data;
-}
-
-int netxen_nic_hw_write_ioctl(struct netxen_adapter *adapter, u64 off,
- void *data, int len)
-{
-   void *addr;
-   u64 offset = off;
-   u8 *mem_ptr = NULL;
-   unsigned long mem_base;
-   unsigned long mem_page;
-
-   if (ADDR_IN_WINDOW1(off)) {
-   addr = NETXEN_CRB_NORMALIZE(adapter, off);
-   if (!addr) {
-   mem_base = pci_resource_start(adapter-ahw.pdev, 0);
-   offset = NETXEN_CRB_NORMAL(off);
-   mem_page = offset  PAGE_MASK;
-   if (mem_page != ((offset + len - 1)  PAGE_MASK))
-   mem_ptr =
-   ioremap(mem_base + mem_page, PAGE_SIZE * 2);
-   else
-   mem_ptr =
-   ioremap(mem_base + mem_page, PAGE_SIZE);
-   if (mem_ptr == 0UL) {
-   return 1;
-   }
-   addr = mem_ptr;
-  

Re: [patch 04/14] e1000: consolidate managability enabling/disabling

2006-12-15 Thread Jeff Garzik

Arjan van de Ven wrote:

Subject: e1000: consolidate managability enabling/disabling
From: Jesse Brandeburg [EMAIL PROTECTED]

Several bugs existed in how we handle manageability issues all over the driver.
This patch consolidates all the managability release and init code in two single
functions and call them from appropriate locations. This fixes several
BMC packet redirect issues and powerup/down hiccups.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]


The revisions for this patch were major revisions, as you had warned. 
 See attached.


Jeff


commit fa359ae5b1c4ddbd5a5ba3bc72d4276efbc6654a
Author: Jeff Garzik [EMAIL PROTECTED]
Date:   Fri Dec 15 10:56:10 2006 -0500

e1000: consolidate managability enabling/disabling

Several bugs existed in how we handle manageability issues all
over the driver.  This patch consolidates all the managability
release and init code in two single functions and call them from
appropriate locations. This fixes several BMC packet redirect issues
and powerup/down hiccups.

Originally from Jesse Brandeburg [EMAIL PROTECTED], rewritten
to use feature flags by me.

Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

fa359ae5b1c4ddbd5a5ba3bc72d4276efbc6654a
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index ce82eb5..1ea556e 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -448,6 +448,10 @@ e1000_set_mac_type(struct e1000_hw *hw)
if (hw-mac_type == e1000_82543)
hw-bad_tx_carr_stats_fd = TRUE;
 
+   /* capable of receiving management packets to the host */
+   if (hw-mac_type = e1000_82571)
+   hw-has_manc2h = TRUE;
+
return E1000_SUCCESS;
 }
 
@@ -7823,9 +7827,8 @@ e1000_enable_mng_pass_thru(struct e1000_hw *hw)
 fwsm = E1000_READ_REG(hw, FWSM);
 factps = E1000_READ_REG(hw, FACTPS);
 
-if (((fwsm  E1000_FWSM_MODE_MASK) ==
-(e1000_mng_mode_pt  E1000_FWSM_MODE_SHIFT)) 
-(factps  E1000_FACTPS_MNGCG))
+if fwsm  E1000_FWSM_MODE_MASK)  E1000_FWSM_MODE_SHIFT) ==
+   e1000_mng_mode_pt)  !(factps  E1000_FACTPS_MNGCG))
 return TRUE;
 } else
 if ((manc  E1000_MANC_SMBUS_EN)  !(manc  E1000_MANC_ASF_EN))
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index fef1f7b..18a4ae4 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -1301,6 +1301,7 @@ struct e1000_ffvt_entry {
 #define E1000_82542_RSSIR   E1000_RSSIR
 #define E1000_82542_KUMCTRLSTA E1000_KUMCTRLSTA
 #define E1000_82542_SW_FW_SYNC E1000_SW_FW_SYNC
+#define E1000_82542_MANC2H  E1000_MANC2H
 
 /* Statistics counters collected by the MAC */
 struct e1000_hw_stats {
@@ -1461,6 +1462,7 @@ struct e1000_hw {
boolean_t   leave_av_bit_off;
boolean_t   kmrn_lock_loss_workaround_disabled;
boolean_t   bad_tx_carr_stats_fd;
+   boolean_t   has_manc2h;
 };
 
 
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 0816de2..7a51283 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -464,6 +464,52 @@ e1000_get_hw_control(struct e1000_adapter *adapter)
}
 }
 
+static void
+e1000_init_manageability(struct e1000_adapter *adapter)
+{
+   if (adapter-en_mng_pt) {
+   uint32_t manc = E1000_READ_REG(adapter-hw, MANC);
+
+   /* disable hardware interception of ARP */
+   manc = ~(E1000_MANC_ARP_EN);
+
+   /* enable receiving management packets to the host */
+   /* this will probably generate destination unreachable messages
+* from the host OS, but the packets will be handled on SMBUS */
+   if (adapter-hw.has_manc2h) {
+   uint32_t manc2h = E1000_READ_REG(adapter-hw, MANC2H);
+
+   manc |= E1000_MANC_EN_MNG2HOST;
+#define E1000_MNG2HOST_PORT_623 (1  5)
+#define E1000_MNG2HOST_PORT_664 (1  6)
+   manc2h |= E1000_MNG2HOST_PORT_623;
+   manc2h |= E1000_MNG2HOST_PORT_664;
+   E1000_WRITE_REG(adapter-hw, MANC2H, manc2h);
+   }
+
+   E1000_WRITE_REG(adapter-hw, MANC, manc);
+   }
+}
+
+static void
+e1000_release_manageability(struct e1000_adapter *adapter)
+{
+   if (adapter-en_mng_pt) {
+   uint32_t manc = E1000_READ_REG(adapter-hw, MANC);
+
+   /* re-enable hardware interception of ARP */
+   manc |= E1000_MANC_ARP_EN;
+
+   if (adapter-hw.has_manc2h)
+   manc = ~E1000_MANC_EN_MNG2HOST;
+
+   /* don't explicitly have to mess with MANC2H since
+* MANC has 

Re: [patch 05/14] e1000: Fix Wake-on-Lan with forced gigabit speed

2006-12-15 Thread Jeff Garzik

Arjan van de Ven wrote:

Subject: e1000: Fix Wake-on-Lan with forced gigabit speed
From: Jesse Brandeburg [EMAIL PROTECTED]

If the user has forced gigabit speed, phy power management must be disabled;
otherwise the NIC would try to negotiate to a linkspeed of 10/100 mbit on
shutdown, which would lead to a total loss of link. This loss of link breaks
Wake-on-Lan and IPMI.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]


ACK patches 5 and 6


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] netxen: remove private ioctl

2006-12-15 Thread Christoph Hellwig
On Fri, Dec 15, 2006 at 07:57:08AM -0800, Stephen Hemminger wrote:
 The netxen driver includes a private ioctl that provides access
 to functionality that is already available in other ways. The PCI
 layer has application access hooks (see setpci), and the statistics
 are available in ethtool/netstats.


ACK. The removed code is full of bugs aswell.

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Bridge] Bridge it's MAC address question

2006-12-15 Thread Lennert Buytenhek
[ dropped subscriber-only openvz.org list ]

On Fri, Dec 15, 2006 at 07:52:36AM -0800, Stephen Hemminger wrote:

   The bridge physical address is the minimum of all the attached devices.
   This is done because the STP standard requires it.  You can reset it
   to be the same as any of the attached devices. This will not cause a
   problem unless using STP.
  
  You can in fact use any MAC address.  The STP standard recommends using
  the minimum address, as that is deterministic, and so it doesn't depend
  on the order in which you enslave subdevices.
 
 So should restriction be lifted?

We should definitely allow users to override the MAC address of a
bridge interface.


 Please update wiki page FAQ, or I'll do it

Please do.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 12/14] e1000: Make the copybreak value a module parameter

2006-12-15 Thread Jeff Garzik

Arjan van de Ven wrote:

Subject: e1000: Make the copybreak value a module parameter
From: Jesse Brandeburg [EMAIL PROTECTED]

Allow the user to vary the size that copybreak works. Currently cb is enabled
for packets  256 bytes, but various tests indicate that this should be
configurable for specific use cases. In addition, this parameter allows us
to force never/always during testing to get full and predictable coverage of 
both code paths.


Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]


ACK 8-12


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 13/14] e1000: 3 new driver stats for managability testing

2006-12-15 Thread Jeff Garzik

Arjan van de Ven wrote:

Subject: e1000: 3 new driver stats for managability testing
From: Jesse Brandeburg [EMAIL PROTECTED]

Add 3 extra packet redirect counters for tracking purposes to make sure we
can test that all packets arrive properly.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]


as revised...

commit 979b575f7666d12157d8b975f022bf8fb6d23c64
Author: Jeff Garzik [EMAIL PROTECTED]
Date:   Fri Dec 15 11:16:33 2006 -0500

e1000: 3 new driver stats for managability testing

Add 3 extra packet redirect counters for tracking purposes to make sure
we can test that all packets arrive properly.

Originally from Jesse Brandeburg [EMAIL PROTECTED],
rewritten to use feature flags by me.

Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

979b575f7666d12157d8b975f022bf8fb6d23c64
diff --git a/drivers/net/e1000/e1000_ethtool.c 
b/drivers/net/e1000/e1000_ethtool.c
index da459f7..fb96c87 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -100,6 +100,9 @@ static const struct e1000_stats e1000_gstrings_stats[] = {
{ rx_csum_offload_errors, E1000_STAT(hw_csum_err) },
{ rx_header_split, E1000_STAT(rx_hdr_split) },
{ alloc_rx_buff_failed, E1000_STAT(alloc_rx_buff_failed) },
+   { tx_smbus, E1000_STAT(stats.mgptc) },
+   { rx_smbus, E1000_STAT(stats.mgprc) },
+   { dropped_smbus, E1000_STAT(stats.mgpdc) },
 };
 
 #define E1000_QUEUE_STATS_LEN 0
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 5a6a61e..9be4469 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -458,6 +458,9 @@ e1000_set_mac_type(struct e1000_hw *hw)
if (hw-mac_type == e1000_80003es2lan)
hw-rx_needs_kicking = TRUE;
 
+   if (hw-mac_type  e1000_82544)
+   hw-has_smbus = TRUE;
+
return E1000_SUCCESS;
 }
 
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index 15b8625..d671058 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -1464,6 +1464,7 @@ struct e1000_hw {
boolean_t   bad_tx_carr_stats_fd;
boolean_t   has_manc2h;
boolean_t   rx_needs_kicking;
+   boolean_t   has_smbus;
 };
 
 
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 3f40a90..b06b51a 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3743,6 +3743,13 @@ e1000_update_stats(struct e1000_adapter *adapter)
adapter-phy_stats.receive_errors += phy_tmp;
}
 
+   /* Management Stats */
+   if (adapter-hw.has_smbus) {
+   adapter-stats.mgptc += E1000_READ_REG(hw, MGTPTC);
+   adapter-stats.mgprc += E1000_READ_REG(hw, MGTPRC);
+   adapter-stats.mgpdc += E1000_READ_REG(hw, MGTPDC);
+   }
+
spin_unlock_irqrestore(adapter-stats_lock, flags);
 }
 #ifdef CONFIG_PCI_MSI


Re: [PATCH 1/2] d80211: Turn PHYmode list from an array into a linked list

2006-12-15 Thread Jiri Benc
On Thu, 14 Dec 2006 19:20:11 +0100, Michael Buesch wrote:
 This turns the PHY-modes list into a linked list.
 The advantage is that drivers can add modes dynamically, as they probe
 them and don't have to settle to a given arraysize at the beginning
 of probing.

ACK.

 @@ -198,8 +200,7 @@ static int ieee80211_ioctl_scan(struct n
   param-u.scan.last_rx = local-scan.rx_packets;
   local-scan.rx_packets = -1;
   }
 - param-u.scan.channel = local-hw.modes[local-scan.mode_idx].
 - channels[local-scan.chan_idx].chan;
 + param-u.scan.channel = 
 local-scan.mode-channels[local-scan.chan_idx].chan;
  
   return 0;
  }

The patch is malformed. Fixed and applied to my tree.

Thanks,

 Jiri

-- 
Jiri Benc
SUSE Labs
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] chelsio: more receive cleanup

2006-12-15 Thread Stephen Hemminger
Cleanup receive processing some more:
   * do the reserve padding of skb during setup
   * don't pass constants to get_packet
   * do smart prefetch of skb
   * make copybreak a module parameter

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]

---
 drivers/net/chelsio/sge.c |   81 +++---
 1 file changed, 42 insertions(+), 39 deletions(-)

--- linux-2.6.20-rc1.orig/drivers/net/chelsio/sge.c
+++ linux-2.6.20-rc1/drivers/net/chelsio/sge.c
@@ -71,12 +71,9 @@
 #define SGE_FREEL_REFILL_THRESH16
 #define SGE_RESPQ_E_N  1024
 #define SGE_INTRTIMER_NRES 1000
-#define SGE_RX_COPY_THRES  256
 #define SGE_RX_SM_BUF_SIZE 1536
 #define SGE_TX_DESC_MAX_PLEN   16384
 
-# define SGE_RX_DROP_THRES 2
-
 #define SGE_RESPQ_REPLENISH_THRES (SGE_RESPQ_E_N / 4)
 
 /*
@@ -862,6 +859,8 @@ static void refill_free_list(struct sge 
skb_reserve(skb, q-dma_offset);
mapping = pci_map_single(pdev, skb-data, dma_len,
 PCI_DMA_FROMDEVICE);
+   skb_reserve(skb, sge-rx_pkt_pad);
+
ce-skb = skb;
pci_unmap_addr_set(ce, dma_addr, mapping);
pci_unmap_len_set(ce, dma_len, dma_len);
@@ -1041,6 +1040,10 @@ static void recycle_fl_buf(struct freelQ
}
 }
 
+static int copybreak __read_mostly = 256;
+module_param(copybreak, int, 0);
+MODULE_PARM_DESC(copybreak, Receive copy threshold);
+
 /**
  * get_packet - return the next ingress packet buffer
  * @pdev: the PCI device that received the packet
@@ -1059,37 +1062,33 @@ static void recycle_fl_buf(struct freelQ
  * threshold and the packet is too big to copy, or (b) the packet should
  * be copied but there is no memory for the copy.
  */
-static inline struct sk_buff *get_packet(struct pci_dev *pdev,
-struct freelQ *fl, unsigned int len,
-int dma_pad, int skb_pad,
-unsigned int copy_thres,
-unsigned int drop_thres)
+static inline struct sk_buff *get_packet(struct pci_dev *pdev, struct freelQ 
*fl,
+unsigned int len)
 {
struct sk_buff *skb;
-   struct freelQ_ce *ce = fl-centries[fl-cidx];
+   const struct freelQ_ce *ce = fl-centries[fl-cidx];
+
+   if (len  copybreak) {
+   skb = alloc_skb(len + 2, GFP_ATOMIC);
+   if (!skb)
+   goto use_orig_buf;
 
-   if (len  copy_thres) {
-   skb = alloc_skb(len + skb_pad, GFP_ATOMIC);
-   if (likely(skb != NULL)) {
-   skb_reserve(skb, skb_pad);
-   skb_put(skb, len);
-   pci_dma_sync_single_for_cpu(pdev,
+   skb_reserve(skb, 2);/* align IP header */
+   skb_put(skb, len);
+   pci_dma_sync_single_for_cpu(pdev,
pci_unmap_addr(ce, dma_addr),
pci_unmap_len(ce, dma_len),
PCI_DMA_FROMDEVICE);
-   memcpy(skb-data, ce-skb-data + dma_pad, len);
-   pci_dma_sync_single_for_device(pdev,
+   memcpy(skb-data, ce-skb-data, len);
+   pci_dma_sync_single_for_device(pdev,
pci_unmap_addr(ce, dma_addr),
pci_unmap_len(ce, dma_len),
PCI_DMA_FROMDEVICE);
-   } else if (!drop_thres)
-   goto use_orig_buf;
-
recycle_fl_buf(fl, fl-cidx);
return skb;
}
 
-   if (fl-credits  drop_thres) {
+   if (fl-credits  2) {
recycle_fl_buf(fl, fl-cidx);
return NULL;
}
@@ -1098,7 +1097,8 @@ use_orig_buf:
pci_unmap_single(pdev, pci_unmap_addr(ce, dma_addr),
 pci_unmap_len(ce, dma_len), PCI_DMA_FROMDEVICE);
skb = ce-skb;
-   skb_reserve(skb, dma_pad);
+   prefetch(skb-data);
+
skb_put(skb, len);
return skb;
 }
@@ -1375,27 +1375,25 @@ static void restart_sched(unsigned long 
  *
  * Process an ingress ethernet pakcet and deliver it to the stack.
  */
-static int sge_rx(struct sge *sge, struct freelQ *fl, unsigned int len)
+static void sge_rx(struct sge *sge, struct freelQ *fl, unsigned int len)
 {
struct sk_buff *skb;
-   struct cpl_rx_pkt *p;
+   const struct cpl_rx_pkt *p;
struct adapter *adapter = sge-adapter;
struct sge_port_stats *st;
 
-   skb = get_packet(adapter-pdev, fl, len - sge-rx_pkt_pad,
-sge-rx_pkt_pad, 2, SGE_RX_COPY_THRES,
-SGE_RX_DROP_THRES);
+   skb = get_packet(adapter-pdev, fl, len - 

[PATCH 1/3] chelsio: fix error path

2006-12-15 Thread Stephen Hemminger
Fix handling of allocation failure.

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]

--- linux-2.6.20-rc1.orig/drivers/net/chelsio/my3126.c
+++ linux-2.6.20-rc1/drivers/net/chelsio/my3126.c
@@ -170,13 +170,14 @@ static struct cphy *my3126_phy_create(ad
 {
struct cphy *cphy = kzalloc(sizeof (*cphy), GFP_KERNEL);
 
-   if (cphy)
-   cphy_init(cphy, adapter, phy_addr, my3126_ops, mdio_ops);
+   if (!cphy)
+   return NULL;
 
+   cphy_init(cphy, adapter, phy_addr, my3126_ops, mdio_ops);
INIT_DELAYED_WORK(cphy-phy_update, my3216_poll);
cphy-bmsr = 0;
 
-   return (cphy);
+   return cphy;
 }
 
 /* Chip Reset */

-- 

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/3] chelsio driver changes

2006-12-15 Thread Stephen Hemminger
One error path bug fix, and a couple of changes to improve
receive performance.  The performance is now up to 5+ Gbits/sec
which is about the limit of the memory/bus on the test systems.


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] chelsio: NAPI speed improvement

2006-12-15 Thread Stephen Hemminger
Speedup and cleanup the receive processing by eliminating the
mmio read and a lock round trip.

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]

---
 drivers/net/chelsio/sge.c |   82 --
 1 file changed, 37 insertions(+), 45 deletions(-)

--- linux-2.6.20-rc1.orig/drivers/net/chelsio/sge.c
+++ linux-2.6.20-rc1/drivers/net/chelsio/sge.c
@@ -1576,6 +1576,14 @@ static int process_responses(struct adap
return budget;
 }
 
+static inline int responses_pending(const struct adapter *adapter)
+{
+   const struct respQ *Q = adapter-sge-respQ;
+   const struct respQ_e *e = Q-entries[Q-cidx];
+
+   return (e-GenerationBit == Q-genbit);
+}
+
 #ifdef CONFIG_CHELSIO_T1_NAPI
 /*
  * A simpler version of process_responses() that handles only pure (i.e.,
@@ -1585,13 +1593,16 @@ static int process_responses(struct adap
  * which the caller must ensure is a valid pure response.  Returns 1 if it
  * encounters a valid data-carrying response, 0 otherwise.
  */
-static int process_pure_responses(struct adapter *adapter, struct respQ_e *e)
+static int process_pure_responses(struct adapter *adapter)
 {
struct sge *sge = adapter-sge;
struct respQ *q = sge-respQ;
+   struct respQ_e *e = q-entries[q-cidx];
unsigned int flags = 0;
unsigned int cmdq_processed[SGE_CMDQ_N] = {0, 0};
 
+   if (e-DataValid)
+   return 1;
do {
flags |= e-Qsleeping;
 
@@ -1627,22 +1638,17 @@ static int process_pure_responses(struct
 int t1_poll(struct net_device *dev, int *budget)
 {
struct adapter *adapter = dev-priv;
-   int effective_budget = min(*budget, dev-quota);
-   int work_done = process_responses(adapter, effective_budget);
+   int work_done;
 
+   work_done = process_responses(adapter, min(*budget, dev-quota));
*budget -= work_done;
dev-quota -= work_done;
 
-   if (work_done = effective_budget)
+   if (unlikely(responses_pending(adapter)))
return 1;
 
-   spin_lock_irq(adapter-async_lock);
-   __netif_rx_complete(dev);
+   netif_rx_complete(dev);
writel(adapter-sge-respQ.cidx, adapter-regs + A_SG_SLEEPING);
-   writel(adapter-slow_intr_mask | F_PL_INTR_SGE_DATA,
-  adapter-regs + A_PL_ENABLE);
-   spin_unlock_irq(adapter-async_lock);
-
return 0;
 }
 
@@ -1652,44 +1658,34 @@ int t1_poll(struct net_device *dev, int 
 irqreturn_t t1_interrupt(int irq, void *data)
 {
struct adapter *adapter = data;
-   struct net_device *dev = adapter-sge-netdev;
struct sge *sge = adapter-sge;
-   u32 cause;
-   int handled = 0;
+   int handled;
 
-   cause = readl(adapter-regs + A_PL_CAUSE);
-   if (cause == 0 || cause == ~0)
-   return IRQ_NONE;
+   if (likely(responses_pending(adapter))) {
+   struct net_device *dev = sge-netdev;
 
-   spin_lock(adapter-async_lock);
-   if (cause  F_PL_INTR_SGE_DATA) {
-   struct respQ *q = adapter-sge-respQ;
-   struct respQ_e *e = q-entries[q-cidx];
-
-   handled = 1;
-   writel(F_PL_INTR_SGE_DATA, adapter-regs + A_PL_CAUSE);
-
-   if (e-GenerationBit == q-genbit 
-   __netif_rx_schedule_prep(dev)) {
-   if (e-DataValid || process_pure_responses(adapter, e)) 
{
-   /* mask off data IRQ */
-   writel(adapter-slow_intr_mask,
-  adapter-regs + A_PL_ENABLE);
-   __netif_rx_schedule(sge-netdev);
-   goto unlock;
-   }
-   /* no data, no NAPI needed */
-   netif_poll_enable(dev);
+   writel(F_PL_INTR_SGE_DATA, adapter-regs + A_PL_CAUSE);
 
+   if (__netif_rx_schedule_prep(dev)) {
+   if (process_pure_responses(adapter)) {
+   __netif_rx_schedule(dev);
+   } else {
+   /* no data, no NAPI needed */
+   writel(sge-respQ.cidx,
+  adapter-regs + A_SG_SLEEPING);
+   netif_poll_enable(dev); /* undo schedule_prep */
+   }
}
-   writel(q-cidx, adapter-regs + A_SG_SLEEPING);
-   } else
-   handled = t1_slow_intr_handler(adapter);
+   return IRQ_HANDLED;
+   }
+
+   spin_lock(adapter-async_lock);
+   handled = t1_slow_intr_handler(adapter);
+   spin_unlock(adapter-async_lock);
 
if (!handled)
sge-stats.unhandled_irqs++;
-unlock:
-   spin_unlock(adapter-async_lock);
+
return IRQ_RETVAL(handled != 0);
 }
 
@@ -1712,17 +1708,13 @@ unlock:
 irqreturn_t t1_interrupt(int irq, void *cookie)
 {

[PATCH] rt2x00: Fix PKT_PROBE_RESP breakage

2006-12-15 Thread Michael Buesch
Fix breakage from removal of PKT_PROBE_RESP.

Signed-off-by: Michael Buesch [EMAIL PROTECTED]


Index: jbenc-dscape/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
===
--- jbenc-dscape.orig/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
2006-12-15 19:43:04.0 +0100
+++ jbenc-dscape/drivers/net/wireless/d80211/rt2x00/rt2400pci.c 2006-12-15 
19:43:14.0 +0100
@@ -1427,8 +1427,11 @@ static void rt2400pci_write_tx_desc(stru
 * Beacons and probe responses require the tsf timestamp
 * to be inserted into the frame.
 */
-   req_timestamp = !!(control-queue == IEEE80211_TX_QUEUE_BEACON ||
-  control-pkt_type == PKT_PROBE_RESP);
+   if (control-queue == IEEE80211_TX_QUEUE_BEACON)
+   req_timestamp = 1;
+   if ((frame_control  IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT 
+   (frame_control  IEEE80211_FCTL_STYPE) == 
IEEE80211_STYPE_PROBE_RESP)
+   req_timestamp = 1;
 
/*
 * Determine with what IFS priority this frame should be send.
Index: jbenc-dscape/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
===
--- jbenc-dscape.orig/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
2006-12-15 19:43:04.0 +0100
+++ jbenc-dscape/drivers/net/wireless/d80211/rt2x00/rt2500pci.c 2006-12-15 
19:43:14.0 +0100
@@ -1568,8 +1568,11 @@ static void rt2500pci_write_tx_desc(stru
 * Beacons and probe responses require the tsf timestamp
 * to be inserted into the frame.
 */
-   req_timestamp = !!(control-queue == IEEE80211_TX_QUEUE_BEACON ||
-  control-pkt_type == PKT_PROBE_RESP);
+   if (control-queue == IEEE80211_TX_QUEUE_BEACON)
+   req_timestamp = 1;
+   if ((frame_control  IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT 
+   (frame_control  IEEE80211_FCTL_STYPE) == 
IEEE80211_STYPE_PROBE_RESP)
+   req_timestamp = 1;
 
/*
 * Determine with what IFS priority this frame should be send.
Index: jbenc-dscape/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
===
--- jbenc-dscape.orig/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
2006-12-15 19:43:04.0 +0100
+++ jbenc-dscape/drivers/net/wireless/d80211/rt2x00/rt2500usb.c 2006-12-15 
19:43:14.0 +0100
@@ -1539,8 +1539,11 @@ static void rt2500usb_write_tx_desc(stru
 * Beacons and probe responses require the tsf timestamp
 * to be inserted into the frame.
 */
-   req_timestamp = !!(control-queue == IEEE80211_TX_QUEUE_BEACON ||
-  control-pkt_type == PKT_PROBE_RESP);
+   if (control-queue == IEEE80211_TX_QUEUE_BEACON)
+   req_timestamp = 1;
+   if ((frame_control  IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT 
+   (frame_control  IEEE80211_FCTL_STYPE) == 
IEEE80211_STYPE_PROBE_RESP)
+   req_timestamp = 1;
 
/*
 * Determine with what IFS priority this frame should be send.
Index: jbenc-dscape/drivers/net/wireless/d80211/rt2x00/rt61pci.c
===
--- jbenc-dscape.orig/drivers/net/wireless/d80211/rt2x00/rt61pci.c  
2006-12-15 15:58:04.0 +0100
+++ jbenc-dscape/drivers/net/wireless/d80211/rt2x00/rt61pci.c   2006-12-15 
19:44:13.0 +0100
@@ -2023,8 +2023,11 @@ static void rt61pci_write_tx_desc(struct
 * Beacons and probe responses require the tsf timestamp
 * to be inserted into the frame.
 */
-   req_timestamp = !!(control-queue == IEEE80211_TX_QUEUE_BEACON ||
-  control-pkt_type == PKT_PROBE_RESP);
+   if (control-queue == IEEE80211_TX_QUEUE_BEACON)
+   req_timestamp = 1;
+   if ((frame_control  IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT 
+   (frame_control  IEEE80211_FCTL_STYPE) == 
IEEE80211_STYPE_PROBE_RESP)
+   req_timestamp = 1;
 
/*
 * Determine with what IFS priority this frame should be send.
Index: jbenc-dscape/drivers/net/wireless/d80211/rt2x00/rt73usb.c
===
--- jbenc-dscape.orig/drivers/net/wireless/d80211/rt2x00/rt73usb.c  
2006-12-15 15:58:04.0 +0100
+++ jbenc-dscape/drivers/net/wireless/d80211/rt2x00/rt73usb.c   2006-12-15 
19:46:11.0 +0100
@@ -1802,8 +1802,11 @@ static void rt73usb_write_tx_desc(struct
 * Beacons and probe responses require the tsf timestamp
 * to be inserted into the frame.
 */
-   req_timestamp = !!(control-queue == IEEE80211_TX_QUEUE_BEACON ||
-  control-pkt_type == PKT_PROBE_RESP);
+   if (control-queue == IEEE80211_TX_QUEUE_BEACON)
+   req_timestamp = 1;
+   if 

[PATCH] rt2x00: Fix compilation for d80211 hwmode API change

2006-12-15 Thread Michael Buesch
This fixes compilation for the d80211 hwmode API change.

Signed-off-by: Michael Buesch [EMAIL PROTECTED]


Index: jbenc-dscape/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
===
--- jbenc-dscape.orig/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
2006-12-15 19:43:14.0 +0100
+++ jbenc-dscape/drivers/net/wireless/d80211/rt2x00/rt2400pci.c 2006-12-15 
19:46:23.0 +0100
@@ -590,8 +590,8 @@ static void rt2400pci_config_phymode(str
if (rt2x00dev-rx_params.phymode == phymode)
return;
 
-   rate = rt2x00dev-hw-modes[0].rates[
-   rt2x00dev-hw-modes[0].num_rates - 1];
+   rate = rt2x00dev-hwmodes[0].rates[
+   rt2x00dev-hwmodes[0].num_rates - 1];
 
rt2400pci_config_rate(rt2x00dev, rate-val2);
 
@@ -1140,9 +1140,9 @@ static int rt2400pci_init_channel_time(s
 */
jiffies_start = jiffies;
rt2400pci_config_channel(rt2x00dev,
-   rt2x00dev-hw-modes[0].channels[0].val,
-   rt2x00dev-hw-modes[0].channels[0].chan,
-   rt2x00dev-hw-modes[0].channels[0].freq);
+   rt2x00dev-hwmodes[0].channels[0].val,
+   rt2x00dev-hwmodes[0].channels[0].chan,
+   rt2x00dev-hwmodes[0].channels[0].freq);
jiffies_end = jiffies;
 
rt2x00dev-hw-channel_change_time =
@@ -1562,7 +1562,7 @@ static void rt2400pci_rxdone(void *data)
size);
 
rt2x00dev-rx_params.rate = device_signal_to_rate(
-   rt2x00dev-hw-modes[0],
+   rt2x00dev-hwmodes[0],
rt2x00_get_field32(word2, RXD_W2_SIGNAL),
0);
 
@@ -2579,47 +2579,43 @@ static void rt2400pci_init_hw_rates(stru
 
 static int rt2400pci_init_hw_modes(struct rt2x00_dev *rt2x00dev)
 {
-   struct ieee80211_hw *hw = rt2x00dev-hw;
-
/*
 * RT2400 only supports 802.11b.
 * Allocate memory for 14 OFDM channels and 4 CCK rates.
 */
-   hw-num_modes = 1;
-   hw-modes =
-   kzalloc(sizeof(struct ieee80211_hw_modes), GFP_KERNEL);
-   if (!hw-modes)
+   rt2x00dev-hwmodes =
+   kzalloc(sizeof(struct ieee80211_hw_mode), GFP_KERNEL);
+   if (!rt2x00dev-hwmodes)
goto exit;
 
-   hw-modes-num_channels = 14;
-   hw-modes-channels =
+   rt2x00dev-hwmodes[0].num_channels = 14;
+   rt2x00dev-hwmodes[0].channels =
kzalloc(sizeof(struct ieee80211_channel) * 14, GFP_KERNEL);
-   if (!hw-modes-channels)
+   if (!rt2x00dev-hwmodes[0].channels)
goto exit_free_modes;
 
-   hw-modes-num_rates = 4;
-   hw-modes-rates =
+   rt2x00dev-hwmodes[0].num_rates = 4;
+   rt2x00dev-hwmodes[0].rates =
kzalloc(sizeof(struct ieee80211_rate) * 4, GFP_KERNEL);
-   if (!hw-modes-rates)
+   if (!rt2x00dev-hwmodes[0].rates)
goto exit_free_channels;
 
/*
 * Initialize modes.
 */
-   hw-modes-mode = MODE_IEEE80211B;
+   rt2x00dev-hwmodes[0].mode = MODE_IEEE80211B;
 
-   rt2400pci_init_hw_channels(rt2x00dev, hw-modes-channels);
-   rt2400pci_init_hw_rates(rt2x00dev, hw-modes-rates);
+   rt2400pci_init_hw_channels(rt2x00dev, rt2x00dev-hwmodes[0].channels);
+   rt2400pci_init_hw_rates(rt2x00dev, rt2x00dev-hwmodes[0].rates);
 
-   return ieee80211_update_hw(hw);
+   return 0;
 
 exit_free_channels:
-   kfree(hw-modes-channels);
-   hw-modes-channels = NULL;
+   kfree(rt2x00dev-hwmodes[0].channels);
+   rt2x00dev-hwmodes[0].channels = NULL;
 
 exit_free_modes:
-   kfree(hw-modes);
-   hw-modes = NULL;
+   kfree(rt2x00dev-hwmodes);
 
 exit:
ERROR(Allocation ieee80211 modes failed.\n);
@@ -2628,6 +2624,7 @@ exit:
 
 static int rt2400pci_init_hw(struct rt2x00_dev *rt2x00dev)
 {
+   int err;
int status;
 
if (GET_FLAG(rt2x00dev, DEVICE_INITIALIZED_HW))
@@ -2661,6 +2658,11 @@ static int rt2400pci_init_hw(struct rt2x
 
if (ieee80211_register_hw(rt2x00dev-hw))
return -EIO;
+   err = ieee80211_register_hwmode(rt2x00dev-hw, rt2x00dev-hwmodes[0]);
+   if (err) {
+   ieee80211_unregister_hw(rt2x00dev-hw);
+   return err;
+   }
 
SET_FLAG(rt2x00dev, DEVICE_INITIALIZED_HW);
 
@@ -2699,11 +2701,10 @@ static void rt2400pci_free_dev(struct rt
/*
 * Free ieee80211_hw memory.
 */
-   if (likely(rt2x00dev-hw-modes)) {
-   kfree(rt2x00dev-hw-modes-channels);
-   kfree(rt2x00dev-hw-modes-rates);
-   kfree(rt2x00dev-hw-modes);
-   rt2x00dev-hw-modes = NULL;
+   if (likely(rt2x00dev-hwmodes)) {
+   kfree(rt2x00dev-hwmodes[0].channels);
+   kfree(rt2x00dev-hwmodes[0].rates);
+   

[PATCH] adm8211: Fix compilation for d80211 hwmode API change

2006-12-15 Thread Michael Buesch
This fixes compilation for the d80211 hwmode API change.

Signed-off-by: Michael Buesch [EMAIL PROTECTED]


Index: jbenc-dscape/drivers/net/wireless/d80211/adm8211/adm8211.c
===
--- jbenc-dscape.orig/drivers/net/wireless/d80211/adm8211/adm8211.c 
2006-12-15 15:58:04.0 +0100
+++ jbenc-dscape/drivers/net/wireless/d80211/adm8211/adm8211.c  2006-12-15 
18:50:44.0 +0100
@@ -2034,8 +2034,6 @@ static int __devinit adm8211_probe(struc
dev-channel_change_time = 1000;
dev-maxssi = ADM8211_RX_MAX_SSI;// FIXME - This is an approximation
 
-   dev-num_modes = 1;
-   dev-modes = priv-modes;
priv-modes[0].mode = MODE_IEEE80211B;
/* channel info filled in by adm8211_read_eeprom */
memcpy(priv-rates, adm8211_rates, sizeof(adm8211_rates));
@@ -2073,12 +2071,20 @@ static int __devinit adm8211_probe(struc
printk(KERN_ERR %s (adm8211): Cannot register hardware\n, 
pci_name(pdev));
goto err_free_desc;
}
+   err = ieee80211_register_hwmode(dev, priv-modes[0]);
+   if (err) {
+   printk(KERN_ERR %s (adm8211): Cannot register hwmode\n, 
pci_name(pdev));
+   goto err_unreg_hw;
+   }
 
printk(KERN_INFO wiphy%d: hwaddr  MAC_FMT , Rev 0x%02x\n,
   dev-index, MAC_ARG(dev-perm_addr), priv-revid);
 
return 0;
 
+ err_unreg_hw:
+   ieee80211_unregister_hw(dev);
+
  err_free_desc:
pci_free_consistent(pdev,
sizeof(struct adm8211_desc) * priv-rx_ring_size +
Index: jbenc-dscape/drivers/net/wireless/d80211/adm8211/adm8211.h
===
--- jbenc-dscape.orig/drivers/net/wireless/d80211/adm8211/adm8211.h 
2006-12-15 15:58:04.0 +0100
+++ jbenc-dscape/drivers/net/wireless/d80211/adm8211/adm8211.h  2006-12-15 
18:43:57.0 +0100
@@ -532,7 +532,7 @@ struct adm8211_priv {
unsigned cur_tx, dirty_tx, cur_rx;
 
struct ieee80211_low_level_stats stats;
-   struct ieee80211_hw_modes modes[1];
+   struct ieee80211_hw_mode modes[1];
struct ieee80211_rate rates[ARRAY_SIZE(adm8211_rates)];
int mode;
 

-- 
Greetings Michael.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] p54: Fix compilation for d80211 hwmode API change

2006-12-15 Thread Michael Buesch
This fixes compilation for the d80211 hwmode API change.

Signed-off-by: Michael Buesch [EMAIL PROTECTED]


Index: jbenc-dscape/drivers/net/wireless/d80211/p54/prism54.h
===
--- jbenc-dscape.orig/drivers/net/wireless/d80211/p54/prism54.h 2006-12-15 
15:58:04.0 +0100
+++ jbenc-dscape/drivers/net/wireless/d80211/p54/prism54.h  2006-12-15 
18:52:50.0 +0100
@@ -64,7 +64,7 @@ struct p54_common {
/* FIXME: this channels/modes/rates stuff sucks */
struct ieee80211_channel channels[14];
struct ieee80211_rate rates[12];
-   struct ieee80211_hw_modes modes[2];
+   struct ieee80211_hw_mode modes[2];
 };
 
 int p54_rx(struct ieee80211_hw *dev, struct sk_buff *skb);
Index: jbenc-dscape/drivers/net/wireless/d80211/p54/prism54common.c
===
--- jbenc-dscape.orig/drivers/net/wireless/d80211/p54/prism54common.c   
2006-12-15 15:58:04.0 +0100
+++ jbenc-dscape/drivers/net/wireless/d80211/p54/prism54common.c
2006-12-15 18:53:42.0 +0100
@@ -742,9 +742,6 @@ struct ieee80211_hw *p54_init_common(siz
dev-channel_change_time = 1000;/* TODO: find actual value */
dev-maxssi = 100; // just to avoid dividing by zero
 
-   dev-num_modes = 2;
-   dev-modes = priv-modes;
-
dev-queues = 1;
dev-extra_tx_headroom = sizeof(struct p54_control_hdr) + 4 +
 sizeof(struct p54_tx_control_allocdata);
Index: jbenc-dscape/drivers/net/wireless/d80211/p54/prism54pci.c
===
--- jbenc-dscape.orig/drivers/net/wireless/d80211/p54/prism54pci.c  
2006-12-15 15:58:04.0 +0100
+++ jbenc-dscape/drivers/net/wireless/d80211/p54/prism54pci.c   2006-12-15 
18:59:33.0 +0100
@@ -505,7 +505,7 @@ static int __devinit p54p_probe(struct p
struct p54p_priv *priv;
struct ieee80211_hw *dev;
unsigned long mem_addr, mem_len;
-   int err;
+   int i, err;
 
err = pci_enable_device(pdev);
if (err) {
@@ -596,12 +596,23 @@ static int __devinit p54p_probe(struct p
   pci_name(pdev));
goto err_free_desc;
}
+   for (i = 0; i  2; i++) {
+   err = ieee80211_register_hwmode(dev, priv-common.modes[i]);
+   if (err) {
+   printk(KERN_ERR %s (prism54pci): Cannot register 
hwmode\n,
+   pci_name(pdev));
+   goto err_unreg_hw;
+   }
+   }
 
printk(KERN_INFO wiphy%d: hwaddr  MAC_FMT , isl38%02x\n,
   dev-index, MAC_ARG(dev-perm_addr), priv-common.version);
 
return 0;
 
+ err_unreg_hw:
+   ieee80211_unregister_hw(dev);
+
  err_free_desc:
p54_free_common(dev);
pci_free_consistent(pdev, sizeof(*priv-ring_control),
Index: jbenc-dscape/drivers/net/wireless/d80211/p54/prism54usb.c
===
--- jbenc-dscape.orig/drivers/net/wireless/d80211/p54/prism54usb.c  
2006-12-15 15:58:04.0 +0100
+++ jbenc-dscape/drivers/net/wireless/d80211/p54/prism54usb.c   2006-12-15 
19:00:39.0 +0100
@@ -893,12 +893,22 @@ static int __devinit p54u_probe(struct u
printk(KERN_ERR prism54usb: Cannot register netdevice\n);
goto err_free_dev;
}
+   for (i = 0; i  2; i++) {
+   err = ieee80211_register_hwmode(dev, priv-common.modes[i]);
+   if (err) {
+   printk(KERN_ERR prism54usb: Cannot register hwmode\n);
+   goto err_unreg_hw;
+   }
+   }
 
printk(KERN_INFO wiphy%d: hwaddr  MAC_FMT , isl38%02x\n,
   dev-index, MAC_ARG(dev-perm_addr), priv-common.version);
 
return 0;
 
+ err_unreg_hw:
+   ieee80211_unregister_hw(dev);
+
  err_free_dev:
ieee80211_free_hw(dev);
usb_set_intfdata(intf, NULL);

-- 
Greetings Michael.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] zd1211: Fix compilation for d80211 hwmode API change

2006-12-15 Thread Michael Buesch
This fixes compilation for the d80211 hwmode API change.

Signed-off-by: Michael Buesch [EMAIL PROTECTED]


Index: jbenc-dscape/drivers/net/wireless/d80211/zd1211rw/zd_mac.c
===
--- jbenc-dscape.orig/drivers/net/wireless/d80211/zd1211rw/zd_mac.c 
2006-12-15 15:58:04.0 +0100
+++ jbenc-dscape/drivers/net/wireless/d80211/zd1211rw/zd_mac.c  2006-12-15 
20:27:38.0 +0100
@@ -521,9 +521,6 @@ struct ieee80211_hw *zd_mac_alloc(struct
 IEEE80211_HW_WEP_INCLUDE_IV;
dev-maxssi = 100;
 
-   dev-num_modes = 2;
-   dev-modes = mac-modes;
-
dev-queues = 1;
dev-extra_tx_headroom = sizeof(struct zd_ctrlset);
 
Index: jbenc-dscape/drivers/net/wireless/d80211/zd1211rw/zd_mac.h
===
--- jbenc-dscape.orig/drivers/net/wireless/d80211/zd1211rw/zd_mac.h 
2006-12-15 15:58:04.0 +0100
+++ jbenc-dscape/drivers/net/wireless/d80211/zd1211rw/zd_mac.h  2006-12-15 
20:26:58.0 +0100
@@ -137,7 +137,7 @@ struct zd_mac {
u8 *hwaddr;
struct ieee80211_channel channels[14];
struct ieee80211_rate rates[12];
-   struct ieee80211_hw_modes modes[2];
+   struct ieee80211_hw_mode modes[2];
 };
 
 static inline struct zd_mac *zd_dev_mac(struct ieee80211_hw *dev)
Index: jbenc-dscape/drivers/net/wireless/d80211/zd1211rw/zd_usb.c
===
--- jbenc-dscape.orig/drivers/net/wireless/d80211/zd1211rw/zd_usb.c 
2006-12-15 15:58:04.0 +0100
+++ jbenc-dscape/drivers/net/wireless/d80211/zd1211rw/zd_usb.c  2006-12-15 
20:34:49.0 +0100
@@ -1006,7 +1006,7 @@ static int eject_installer(struct usb_in
 
 static int probe(struct usb_interface *intf, const struct usb_device_id *id)
 {
-   int r;
+   int i, r;
struct usb_device *udev = interface_to_usbdev(intf);
struct ieee80211_hw *dev = NULL;
 
@@ -1064,10 +1064,20 @@ static int probe(struct usb_interface *i
 couldn't register device. Error number %d\n, r);
goto error;
}
+   for (i = 0; i  2; i++) {
+   struct zd_mac *mac = zd_dev_mac(dev);
+   r = ieee80211_register_hwmode(dev,
+ mac-modes[i]);
+   if (r)
+   goto error_unreg_hw;
+   }
 
dev_dbg_f(intf-dev, successful\n);
dev_info(intf-dev,wiphy%d\n, dev-index);
return 0;
+
+error_unreg_hw:
+   ieee80211_unregister_hw(dev);
 error:
usb_reset_device(interface_to_usbdev(intf));
if (dev) {

-- 
Greetings Michael.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Rt2400-devel] [PATCH] rt2x00: Fix compilation for d80211 hwmode API change

2006-12-15 Thread Ivo van Doorn
Hi,

 This fixes compilation for the d80211 hwmode API change.

I haven't had time yet to look closely at more of the benefits
of the new hwmode API change, but this patch looks good.

Thanks!

 Signed-off-by: Michael Buesch [EMAIL PROTECTED]

Signed-off-by: Ivo van Doorn [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Rt2400-devel] [PATCH] rt2x00: Fix PKT_PROBE_RESP breakage

2006-12-15 Thread Ivo van Doorn
Hi,

On Friday 15 December 2006 20:39, Michael Buesch wrote:
 Fix breakage from removal of PKT_PROBE_RESP.

Jiri had already send a patch to the netdev list to cover this breakage.
([PATCH 1/2] rt2x00: fix breakage after pkt_type field was removed)
And I personally favour the patch from Jiri.

Ivo
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Rt2400-devel] [PATCH] rt2x00: Fix PKT_PROBE_RESP breakage

2006-12-15 Thread Michael Buesch
On Friday 15 December 2006 20:50, Ivo van Doorn wrote:
 Hi,
 
 On Friday 15 December 2006 20:39, Michael Buesch wrote:
  Fix breakage from removal of PKT_PROBE_RESP.
 
 Jiri had already send a patch to the netdev list to cover this breakage.
 ([PATCH 1/2] rt2x00: fix breakage after pkt_type field was removed)
 And I personally favour the patch from Jiri.

Ah, well. I don't care. I had to fix this to get my other patch done. ;)

-- 
Greetings Michael.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] chelsio: more receive cleanup

2006-12-15 Thread Francois Romieu
Stephen Hemminger [EMAIL PROTECTED] :
[...]
 --- linux-2.6.20-rc1.orig/drivers/net/chelsio/sge.c
 +++ linux-2.6.20-rc1/drivers/net/chelsio/sge.c
[...]
 @@ -1059,37 +1062,33 @@ static void recycle_fl_buf(struct freelQ
   *   threshold and the packet is too big to copy, or (b) the packet should
   *   be copied but there is no memory for the copy.
   */
 -static inline struct sk_buff *get_packet(struct pci_dev *pdev,
 -  struct freelQ *fl, unsigned int len,
 -  int dma_pad, int skb_pad,
 -  unsigned int copy_thres,
 -  unsigned int drop_thres)
 +static inline struct sk_buff *get_packet(struct pci_dev *pdev, struct freelQ 
 *fl,
 +  unsigned int len)
  {
   struct sk_buff *skb;
 - struct freelQ_ce *ce = fl-centries[fl-cidx];
 + const struct freelQ_ce *ce = fl-centries[fl-cidx];
 +
 + if (len  copybreak) {

If you are into cleanups, maybe add likely/unlikely (and remove the inline) ?

 + skb = alloc_skb(len + 2, GFP_ATOMIC);
 + if (!skb)
 + goto use_orig_buf;
  
 - if (len  copy_thres) {
 - skb = alloc_skb(len + skb_pad, GFP_ATOMIC);
 - if (likely(skb != NULL)) {
 - skb_reserve(skb, skb_pad);
 - skb_put(skb, len);
 - pci_dma_sync_single_for_cpu(pdev,
 + skb_reserve(skb, 2);/* align IP header */

s/2/NET_IP_ALIGN/

Btw, since the driver supports netpoll, its blind enabling of interrupts
in t1_poll() seems old-fashoined (see thread starting at
http://lkml.org/lkml/2006/12/12/86)

-- 
Ueimor
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Update Prism54 MAINTAINERS entry

2006-12-15 Thread Michael Buesch
[EMAIL PROTECTED] bounces with

SMTP error from remote mailer after RCPT TO:[EMAIL PROTECTED]:
host mx1.tuxfamily.net [212.85.158.8]: 550 unknown user

[EMAIL PROTECTED] seems to be the new mailing list.

Signed-off-by: Michael Buesch [EMAIL PROTECTED]


Index: wireless-2.6/MAINTAINERS
===
--- wireless-2.6.orig/MAINTAINERS   2006-12-15 21:19:19.0 +0100
+++ wireless-2.6/MAINTAINERS2006-12-15 21:30:15.0 +0100
@@ -2452,7 +2452,7 @@ S:Supported
 
 PRISM54 WIRELESS DRIVER
 P: Prism54 Development Team
-M: [EMAIL PROTECTED]
+M: [EMAIL PROTECTED]
 L: netdev@vger.kernel.org
 W: http://prism54.org
 S: Maintained

-- 
Greetings Michael.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Update Prism54 MAINTAINERS entry

2006-12-15 Thread Michael Buesch
Ah, damn crap!

On Friday 15 December 2006 21:38, [EMAIL PROTECTED] wrote:
 Sorry, this list is for subscribers only. We previously held incoming
 mail by non-subscribers for manual approval, but due to the increase
 in spam this is no longer feasible.
 
 If you are seriously attempting to send mail to the islsm developers
 list, please subscribe to the list and re-send.
 
 Kind regards, Chris
 
 

So simply remove it entirely, or what?



On Friday 15 December 2006 21:32, Michael Buesch wrote:
 [EMAIL PROTECTED] bounces with
 
 SMTP error from remote mailer after RCPT TO:[EMAIL PROTECTED]:
 host mx1.tuxfamily.net [212.85.158.8]: 550 unknown user
 
 [EMAIL PROTECTED] seems to be the new mailing list.
 
 Signed-off-by: Michael Buesch [EMAIL PROTECTED]
 
 
 Index: wireless-2.6/MAINTAINERS
 ===
 --- wireless-2.6.orig/MAINTAINERS 2006-12-15 21:19:19.0 +0100
 +++ wireless-2.6/MAINTAINERS  2006-12-15 21:30:15.0 +0100
 @@ -2452,7 +2452,7 @@ S:  Supported
  
  PRISM54 WIRELESS DRIVER
  P:   Prism54 Development Team
 -M:   [EMAIL PROTECTED]
 +M:   [EMAIL PROTECTED]
  L:   netdev@vger.kernel.org
  W:   http://prism54.org
  S:   Maintained
 

-- 
Greetings Michael.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] adm8211: Fix compilation for d80211 hwmode API change

2006-12-15 Thread Michael Wu
On Friday 15 December 2006 14:44, Michael Buesch wrote:
 This fixes compilation for the d80211 hwmode API change.

 Signed-off-by: Michael Buesch [EMAIL PROTECTED]

ACK, looks good to me.

-Michael Wu


pgpxYbqaiCNCw.pgp
Description: PGP signature


Re: [PATCH] p54: Fix compilation for d80211 hwmode API change

2006-12-15 Thread Michael Wu
On Friday 15 December 2006 14:45, Michael Buesch wrote:
 This fixes compilation for the d80211 hwmode API change.

 Signed-off-by: Michael Buesch [EMAIL PROTECTED]

We can't specify modes before device registration now? There would be less 
duplicated code here if we could.

-Michael Wu


pgpsOOJjoLRM9.pgp
Description: PGP signature


[PATCH 2/2] NetLabel: correctly fill in unused CIPSOv4 level and category mappings

2006-12-15 Thread paul . moore
From: Paul Moore [EMAIL PROTECTED]

Back when the original NetLabel patches were being changed to use Netlink
attributes correctly some code was accidentially dropped which set all of the
undefined CIPSOv4 level and category mappings to a sentinel value.  The result
is the mappings data in the kernel contains bogus mappings which always map to
zero.  This patch restores the old/correct behavior by initializing the mapping
data to the correct sentinel value.

Signed-off-by: Paul Moore [EMAIL PROTECTED]
---
 net/netlabel/netlabel_cipso_v4.c |9 +
 1 files changed, 9 insertions(+)

Index: net-2.6.20_bugfix/net/netlabel/netlabel_cipso_v4.c
===
--- net-2.6.20_bugfix.orig/net/netlabel/netlabel_cipso_v4.c
+++ net-2.6.20_bugfix/net/netlabel/netlabel_cipso_v4.c
@@ -162,6 +162,7 @@ static int netlbl_cipsov4_add_std(struct
struct nlattr *nla_b;
int nla_a_rem;
int nla_b_rem;
+   u32 iter;
 
if (!info-attrs[NLBL_CIPSOV4_A_TAGLST] ||
!info-attrs[NLBL_CIPSOV4_A_MLSLVLLST])
@@ -231,6 +232,10 @@ static int netlbl_cipsov4_add_std(struct
ret_val = -ENOMEM;
goto add_std_failure;
}
+   for (iter = 0; iter  doi_def-map.std-lvl.local_size; iter++)
+   doi_def-map.std-lvl.local[iter] = CIPSO_V4_INV_LVL;
+   for (iter = 0; iter  doi_def-map.std-lvl.cipso_size; iter++)
+   doi_def-map.std-lvl.cipso[iter] = CIPSO_V4_INV_LVL;
nla_for_each_nested(nla_a,
info-attrs[NLBL_CIPSOV4_A_MLSLVLLST],
nla_a_rem)
@@ -302,6 +307,10 @@ static int netlbl_cipsov4_add_std(struct
ret_val = -ENOMEM;
goto add_std_failure;
}
+   for (iter = 0; iter  doi_def-map.std-cat.local_size; iter++)
+   doi_def-map.std-cat.local[iter] = CIPSO_V4_INV_CAT;
+   for (iter = 0; iter  doi_def-map.std-cat.cipso_size; iter++)
+   doi_def-map.std-cat.cipso[iter] = CIPSO_V4_INV_CAT;
nla_for_each_nested(nla_a,
info-attrs[NLBL_CIPSOV4_A_MLSCATLST],
nla_a_rem)

--
paul moore
linux security @ hp
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] A bugfix patchset for NetLabel

2006-12-15 Thread paul . moore
This patch set fixes two bugs that were found recently when adding new CIPSOv4
DOI definitions.  These patches are pretty small and have been tested by a few
different people on several different platforms.

Please apply these for 2.6.20 and they should probably be pushed to the 2.6.19
stable tree as well; is there anything special I need to do for that?

--
paul moore
linux security @ hp
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] NetLabel: perform input validation earlier on CIPSOv4 DOI add ops

2006-12-15 Thread paul . moore
From: Paul Moore [EMAIL PROTECTED]

There are a couple of cases where the user input for a CIPSOv4 DOI add
operation was not being done soon enough; the result was unexpected behavior
which was resulting in oops/panics/lockups on some platforms.  This patch moves
the existing input validation code earlier in the code path to protect against
bogus user input.

Signed-off-by: Paul Moore [EMAIL PROTECTED]
---
 net/netlabel/netlabel_cipso_v4.c |   28 +---
 1 files changed, 17 insertions(+), 11 deletions(-)

Index: net-2.6.20_bugfix/net/netlabel/netlabel_cipso_v4.c
===
--- net-2.6.20_bugfix.orig/net/netlabel/netlabel_cipso_v4.c
+++ net-2.6.20_bugfix/net/netlabel/netlabel_cipso_v4.c
@@ -185,20 +185,31 @@ static int netlbl_cipsov4_add_std(struct
ret_val = netlbl_cipsov4_add_common(info, doi_def);
if (ret_val != 0)
goto add_std_failure;
+   ret_val = -EINVAL;
 
nla_for_each_nested(nla_a,
info-attrs[NLBL_CIPSOV4_A_MLSLVLLST],
nla_a_rem)
if (nla_a-nla_type == NLBL_CIPSOV4_A_MLSLVL) {
+   if (nla_validate_nested(nla_a,
+   NLBL_CIPSOV4_A_MAX,
+   netlbl_cipsov4_genl_policy) != 0)
+   goto add_std_failure;
nla_for_each_nested(nla_b, nla_a, nla_b_rem)
switch (nla_b-nla_type) {
case NLBL_CIPSOV4_A_MLSLVLLOC:
+   if (nla_get_u32(nla_b) 
+   CIPSO_V4_MAX_LOC_LVLS)
+   goto add_std_failure;
if (nla_get_u32(nla_b) =
doi_def-map.std-lvl.local_size)
 doi_def-map.std-lvl.local_size =
 nla_get_u32(nla_b) + 1;
break;
case NLBL_CIPSOV4_A_MLSLVLREM:
+   if (nla_get_u32(nla_b) 
+   CIPSO_V4_MAX_REM_LVLS)
+   goto add_std_failure;
if (nla_get_u32(nla_b) =
doi_def-map.std-lvl.cipso_size)
 doi_def-map.std-lvl.cipso_size =
@@ -206,9 +217,6 @@ static int netlbl_cipsov4_add_std(struct
break;
}
}
-   if (doi_def-map.std-lvl.local_size  CIPSO_V4_MAX_LOC_LVLS ||
-   doi_def-map.std-lvl.cipso_size  CIPSO_V4_MAX_REM_LVLS)
-   goto add_std_failure;
doi_def-map.std-lvl.local = kcalloc(doi_def-map.std-lvl.local_size,
  sizeof(u32),
  GFP_KERNEL);
@@ -230,11 +238,6 @@ static int netlbl_cipsov4_add_std(struct
struct nlattr *lvl_loc;
struct nlattr *lvl_rem;
 
-   if (nla_validate_nested(nla_a,
- NLBL_CIPSOV4_A_MAX,
- netlbl_cipsov4_genl_policy) != 0)
-   goto add_std_failure;
-
lvl_loc = nla_find_nested(nla_a,
  NLBL_CIPSOV4_A_MLSLVLLOC);
lvl_rem = nla_find_nested(nla_a,
@@ -264,12 +267,18 @@ static int netlbl_cipsov4_add_std(struct
nla_for_each_nested(nla_b, nla_a, nla_b_rem)
switch (nla_b-nla_type) {
case NLBL_CIPSOV4_A_MLSCATLOC:
+   if (nla_get_u32(nla_b) 
+   CIPSO_V4_MAX_LOC_CATS)
+   goto add_std_failure;
if (nla_get_u32(nla_b) =
  doi_def-map.std-cat.local_size)
 doi_def-map.std-cat.local_size =
 nla_get_u32(nla_b) + 1;
break;
case NLBL_CIPSOV4_A_MLSCATREM:
+   if (nla_get_u32(nla_b) 
+   CIPSO_V4_MAX_REM_CATS)
+   goto add_std_failure;
   

Re: [PATCH] p54: Fix compilation for d80211 hwmode API change

2006-12-15 Thread Michael Buesch
On Friday 15 December 2006 22:38, Michael Wu wrote:
 On Friday 15 December 2006 14:45, Michael Buesch wrote:
  This fixes compilation for the d80211 hwmode API change.
 
  Signed-off-by: Michael Buesch [EMAIL PROTECTED]
 
 We can't specify modes before device registration now? There would be less 
 duplicated code here if we could.

Well, actually, rt2x00 driver called update_hw before
register_hw (which is not required, but it did it).
So I think we can also call register_hwmode before
register_hw now, as register_hwmode basically does
nothing more than update_hw.

So, I think it should also work, if you call register_hwmode
before register_hw. Jiri?

-- 
Greetings Michael.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] chelsio: more receive cleanup

2006-12-15 Thread Stephen Hemminger
On Fri, 15 Dec 2006 21:10:19 +0100
Francois Romieu [EMAIL PROTECTED] wrote:

 Stephen Hemminger [EMAIL PROTECTED] :
 [...]
  --- linux-2.6.20-rc1.orig/drivers/net/chelsio/sge.c
  +++ linux-2.6.20-rc1/drivers/net/chelsio/sge.c
 [...]
  @@ -1059,37 +1062,33 @@ static void recycle_fl_buf(struct freelQ
* threshold and the packet is too big to copy, or (b) the packet should
* be copied but there is no memory for the copy.
*/
  -static inline struct sk_buff *get_packet(struct pci_dev *pdev,
  -struct freelQ *fl, unsigned int len,
  -int dma_pad, int skb_pad,
  -unsigned int copy_thres,
  -unsigned int drop_thres)
  +static inline struct sk_buff *get_packet(struct pci_dev *pdev, struct 
  freelQ *fl,
  +unsigned int len)
   {
  struct sk_buff *skb;
  -   struct freelQ_ce *ce = fl-centries[fl-cidx];
  +   const struct freelQ_ce *ce = fl-centries[fl-cidx];
  +
  +   if (len  copybreak) {
 
 If you are into cleanups, maybe add likely/unlikely (and remove the inline) ?

Why, you can't predict copybreak on off

 
  +   skb = alloc_skb(len + 2, GFP_ATOMIC);
  +   if (!skb)
  +   goto use_orig_buf;
   
  -   if (len  copy_thres) {
  -   skb = alloc_skb(len + skb_pad, GFP_ATOMIC);
  -   if (likely(skb != NULL)) {
  -   skb_reserve(skb, skb_pad);
  -   skb_put(skb, len);
  -   pci_dma_sync_single_for_cpu(pdev,
  +   skb_reserve(skb, 2);/* align IP header */
 
 s/2/NET_IP_ALIGN/

This is wrong, NET_IP_ALIGN is for DMA buffers only. It is defined
as 0 for those platforms where DMA alignment is important. In this
case we are copying, so we want to force 2.

 Btw, since the driver supports netpoll, its blind enabling of interrupts
 in t1_poll() seems old-fashoined (see thread starting at
 http://lkml.org/lkml/2006/12/12/86)
 


-- 
Stephen Hemminger [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Marvell Libertas 8388 802.11b/g USB driver

2006-12-15 Thread Marcelo Tosatti
Hi, 

Marvell released a GPL driver for their 8388 wireless chip for USB
interface back in April.

The 8388 is the device being used by the OLPC laptop.

We have been working on cleaning it up for mainline inclusion. I think
the moment for wider review has arrived.

Since the diff is pretty large (700K) I've put it on the web at:
http://dev.laptop.org/~marcelo/libertas-8388-15122006.patch

And its GIT tree resides at:
http://git.infradead.org/?p=libertas-2.6.git;a=log

Comments are welcome

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] chelsio: more receive cleanup

2006-12-15 Thread Francois Romieu
Stephen Hemminger [EMAIL PROTECTED] :
 Francois Romieu [EMAIL PROTECTED] wrote:
[...]
 Why, you can't predict copybreak on off

Plain gut feeling. I'd rather spend extra cycles on small packets (whose
allocation is already optimized) and keep the normal packets less expensive
on a 10Gb/s network card.

[...]
 This is wrong, NET_IP_ALIGN is for DMA buffers only. It is defined
 as 0 for those platforms where DMA alignment is important. In this
 case we are copying, so we want to force 2.

Ok, ok.

-- 
Ueimor
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 06/14] e1000: disable TSO on the 82544 with slab debugging

2006-12-15 Thread Herbert Xu
Jeff Garzik [EMAIL PROTECTED] wrote:
  
 +#ifdef CONFIG_DEBUG_SLAB
 + /* 82544's work arounds do not play nicely with DEBUG SLAB */
 + if (adapter-hw.mac_type == e1000_82544)
 + netdev-features = ~NETIF_F_TSO;
 +#endif
 
 NAK, same reason as the others

Any chance you could apply this patch instead? I've verified that this
does resolve the problem on 82544.

[NETDRV] e1000: Do not truncate TSO TCP header with 82544 workaround

The e1000 driver has a workaround for 82544 on PCI-X where if the
terminating byte of a buffer is at addresses 0-3 mod 8, then 4 bytes
are shaved off it and defered to a new segment.  This is due to an
erratum that could otherwise cause TX hangs.

Unfortunately this breaks TSO because it may cause the TCP header to
be split over two segments which itself causes TX hangs.  The solution
is to pull 4 bytes of data up from the next segment rather than pushing
4 bytes off.  This ensures the TCP header remains in one piece and
works around the PCI-X hang.

This patch is based on one from Jesse Brandeburg.

This bug has been trigered by both CONFIG_DEBUG_SLAB as well as Xen.

Note that the only reason we don't see this normally is because the
TCP stack starts writing from the end, i.e., it writes the TCP header
first then slaps on the IP header, etc.  So the end of the TCP header
(skb-tail - 1 here) is always aligned correctly.

Had we made the start of the IP header (e.g., IPv6) 8-byte aligned
instead, this would happen for normal TCP traffic as well.

Signed-off-by: Herbert Xu [EMAIL PROTECTED]

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 73f3a85..2c6ba42 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3168,6 +3168,16 @@ #ifdef NETIF_F_TSO
if (skb-data_len  (hdr_len == (skb-len - skb-data_len))) {
switch (adapter-hw.mac_type) {
unsigned int pull_size;
+   case e1000_82544:
+   /* Make sure we have room to chop off 4 bytes,
+* and that the end alignment will work out to
+* this hardware's requirements
+* NOTE: this is a TSO only workaround
+* if end byte alignment not correct move us
+* into the next dword */
+   if ((unsigned long)(skb-tail - 1)  4)
+   break;
+   /* fall through */
case e1000_82571:
case e1000_82572:
case e1000_82573:
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: 2.6.20-rc1 sky2 problems (regression?)

2006-12-15 Thread Stephen Hemminger
On Thu, 14 Dec 2006 19:53:45 -0800
Alex Romosan [EMAIL PROTECTED] wrote:

 Stephen Hemminger [EMAIL PROTECTED] writes:
 
  I have a fixed up version of the vendor driver, I'll repackage it tomorrow.
 
 as per the include file, i ended up replacing all the CHECKSUM_HW with
 CHECkSUM_PARTIAL since the functions in questions had to do with
 transmit. seems to be working so far without any lockups. we'll see
 how long this lasts.
 
 --alex--
 

I fixed a bunch of stuff (see ChangeLog) and made a 2.6.19 or later
version see:
http://developer.osdl.org/shemminger/prototypes/sk98lin-8.41.tar.gz

It is too noisy in the console log, because it shows how many times
the driver dope slaps itself senseless...  Basically every 250ms when
it is idle it resets, sorry it's the kind of code you right to make it work
and ship it which is why vendor drivers suck.

-- 
Stephen Hemminger [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2] A bugfix patchset for NetLabel

2006-12-15 Thread James Morris
On Fri, 15 Dec 2006, [EMAIL PROTECTED] wrote:

 This patch set fixes two bugs that were found recently when adding new CIPSOv4
 DOI definitions.  These patches are pretty small and have been tested by a few
 different people on several different platforms.

Applied to git://git.infradead.org/~jmorris/selinux-2.6#fixes

 Please apply these for 2.6.20 and they should probably be pushed to the 2.6.19
 stable tree as well; is there anything special I need to do for that?

I'm not sure that they qualify.

The first is a privileged operation, right?

For the second, what are the implications of mapping to zero?


Also review Documentation/stable_kernel_rules.txt.





-- 
James Morris
[EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] chelsio: more receive cleanup

2006-12-15 Thread Stephen Hemminger
On Sat, 16 Dec 2006 01:26:04 +0100
Francois Romieu [EMAIL PROTECTED] wrote:

 Stephen Hemminger [EMAIL PROTECTED] :
  Francois Romieu [EMAIL PROTECTED] wrote:
 [...]
  Why, you can't predict copybreak on off
 
 Plain gut feeling. I'd rather spend extra cycles on small packets (whose
 allocation is already optimized) and keep the normal packets less expensive
 on a 10Gb/s network card.


Likely/unlikely is an optimization that doesn't make a big difference and
I would rather the compiler choose unless it is something obvious like
an error path or external interrupt (like PHY).

There was some discussion on LKML, which I mostly forgot, that hinted that
on some architectures using likely/unlikely incorrectly could have a major
hit.


-- 
Stephen Hemminger [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: 2.6.20-rc1 sky2 problems (regression?)

2006-12-15 Thread Alex Romosan
Stephen Hemminger [EMAIL PROTECTED] writes:

 I fixed a bunch of stuff (see ChangeLog) and made a 2.6.19 or later
 version see:
   http://developer.osdl.org/shemminger/prototypes/sk98lin-8.41.tar.gz

 It is too noisy in the console log, because it shows how many times
 the driver dope slaps itself senseless...  Basically every 250ms when
 it is idle it resets, sorry it's the kind of code you right to make it work
 and ship it which is why vendor drivers suck.

i'll give it a try on monday when i go back to work. in the meantime
i've been running with my fixed version of the vendor driver and so
far it's been working without any problems (i've been transferring
lots of data in and out of the computer the whole day). if there is
anything i can do to help debug the kernel sky2 driver let me know.

--alex--

-- 
| I believe the moment is at hand when, by a paranoiac and active |
|  advance of the mind, it will be possible (simultaneously with  |
|  automatism and other passive states) to systematize confusion  |
|  and thus to help to discredit completely the world of reality. |
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Marvell Libertas 8388 802.11b/g USB driver

2006-12-15 Thread David Young
On Fri, Dec 15, 2006 at 09:52:20PM -0500, Michael Wu wrote:
 On Friday 15 December 2006 17:51, Marcelo Tosatti wrote:
 --- a/include/net/ieee80211_radiotap.h
 +++ b/include/net/ieee80211_radiotap.h
 @@ -168,6 +168,23 @@ struct ieee80211_radiotap_header {
   *  Unitless indication of the Rx/Tx antenna for this packet.
   *  The first antenna is antenna 0.
   *
 + * IEEE80211_RADIOTAP_RX_FLAGS  u_int16_t   bitmap
 + *
 + * Properties of received frames. See flags defined below.
 + *
 + * IEEE80211_RADIOTAP_TX_FLAGS  u_int16_t   bitmap
 + *
 + * Properties of transmitted frames. See flags defined below.
 + *
 + * IEEE80211_RADIOTAP_RTS_RETRIES   u_int8_tdata
 + *
 + * Number of rts retries a transmitted frame used.
 + *
 + * IEEE80211_RADIOTAP_DATA_RETRIES  u_int8_tdata
 + *
 + * Number of unicast retries a transmitted frame used.
 + *
 + *
   * IEEE80211_RADIOTAP_FCS  u32   data
   *
   * FCS from frame in network byte order.
 @@ -187,7 +204,11 @@ enum ieee80211_radiotap_type {
 IEEE80211_RADIOTAP_ANTENNA = 11,
 IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12,
 IEEE80211_RADIOTAP_DB_ANTNOISE = 13,
 -   IEEE80211_RADIOTAP_EXT = 31,
 +   IEEE80211_RADIOTAP_RX_FLAGS = 14,
 +   IEEE80211_RADIOTAP_TX_FLAGS = 15,
 +   IEEE80211_RADIOTAP_RTS_RETRIES = 16,
 +   IEEE80211_RADIOTAP_DATA_RETRIES = 17,
 +   IEEE80211_RADIOTAP_EXT = 31
  };
 
  /* Channel flags. */
 Did you send this part to netbsd also? We really don't want to fork 
 radiotap. ;) Also, this should be in a separate patch, but I'm guessing it's 
 all rolled together for convenience.

No, especially since NetBSD is where I keep the authoritative definitions.

How have you defined RX_FLAGS and TX_FLAGS?

BTW, IEEE80211_RADIOTAP_FCS (above) never made it into radiotap.  No bit
is reserved.

Dave

-- 
David Young OJC Technologies
[EMAIL PROTECTED]  Urbana, IL * (217) 278-3933
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Marvell Libertas 8388 802.11b/g USB driver

2006-12-15 Thread Michael Wu
On Friday 15 December 2006 17:51, Marcelo Tosatti wrote:
--- a/include/net/ieee80211_radiotap.h
+++ b/include/net/ieee80211_radiotap.h
@@ -168,6 +168,23 @@ struct ieee80211_radiotap_header {
  *  Unitless indication of the Rx/Tx antenna for this packet.
  *  The first antenna is antenna 0.
  *
+ * IEEE80211_RADIOTAP_RX_FLAGS  u_int16_t   bitmap
+ *
+ * Properties of received frames. See flags defined below.
+ *
+ * IEEE80211_RADIOTAP_TX_FLAGS  u_int16_t   bitmap
+ *
+ * Properties of transmitted frames. See flags defined below.
+ *
+ * IEEE80211_RADIOTAP_RTS_RETRIES   u_int8_tdata
+ *
+ * Number of rts retries a transmitted frame used.
+ *
+ * IEEE80211_RADIOTAP_DATA_RETRIES  u_int8_tdata
+ *
+ * Number of unicast retries a transmitted frame used.
+ *
+ *
  * IEEE80211_RADIOTAP_FCS  u32   data
  *
  * FCS from frame in network byte order.
@@ -187,7 +204,11 @@ enum ieee80211_radiotap_type {
IEEE80211_RADIOTAP_ANTENNA = 11,
IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12,
IEEE80211_RADIOTAP_DB_ANTNOISE = 13,
-   IEEE80211_RADIOTAP_EXT = 31,
+   IEEE80211_RADIOTAP_RX_FLAGS = 14,
+   IEEE80211_RADIOTAP_TX_FLAGS = 15,
+   IEEE80211_RADIOTAP_RTS_RETRIES = 16,
+   IEEE80211_RADIOTAP_DATA_RETRIES = 17,
+   IEEE80211_RADIOTAP_EXT = 31
 };

 /* Channel flags. */
Did you send this part to netbsd also? We really don't want to fork 
radiotap. ;) Also, this should be in a separate patch, but I'm guessing it's 
all rolled together for convenience.

-Michael Wu


pgpnuZGgLuAbT.pgp
Description: PGP signature


Re: [PATCH 1/2] d80211: Turn PHYmode list from an array into a linked list

2006-12-15 Thread Michael Buesch
On Friday 15 December 2006 14:48, Jiri Benc wrote:
 On Thu, 14 Dec 2006 19:20:11 +0100, Michael Buesch wrote:
  This turns the PHY-modes list into a linked list.
  The advantage is that drivers can add modes dynamically, as they probe
  them and don't have to settle to a given arraysize at the beginning
  of probing.
 
 ACK.

Thanks. Will submit fixes for the other drivers, too.

  @@ -198,8 +200,7 @@ static int ieee80211_ioctl_scan(struct n
  param-u.scan.last_rx = local-scan.rx_packets;
  local-scan.rx_packets = -1;
  }
  -   param-u.scan.channel = local-hw.modes[local-scan.mode_idx].
  -   channels[local-scan.chan_idx].chan;
  +   param-u.scan.channel = 
  local-scan.mode-channels[local-scan.chan_idx].chan;
   
  return 0;
   }
 
 The patch is malformed. Fixed and applied to my tree.

I'm sorry. Forgot to remove the wrap at ~80chars option in my mailer.

Can you also apply the bcm43xx fix for this to your tree?
I think that should be easiest and prevent long-living breakage.

-- 
Greetings Michael.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] d80211: Turn PHYmode list from an array into a linked list

2006-12-15 Thread Jiri Benc
On Fri, 15 Dec 2006 14:54:55 +0100, Michael Buesch wrote:
 Can you also apply the bcm43xx fix for this to your tree?
 I think that should be easiest and prevent long-living breakage.

It doesn't apply :-( It's probably easy to fix but I'd rather leave it
to you to not make any damage.

Thanks,

 Jiri

-- 
Jiri Benc
SUSE Labs
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] d80211: Turn PHYmode list from an array into a linked list

2006-12-15 Thread Michael Buesch
On Friday 15 December 2006 15:06, Jiri Benc wrote:
 On Fri, 15 Dec 2006 14:54:55 +0100, Michael Buesch wrote:
  Can you also apply the bcm43xx fix for this to your tree?
  I think that should be easiest and prevent long-living breakage.
 
 It doesn't apply :-( It's probably easy to fix but I'd rather leave it
 to you to not make any damage.

Uh, yeah. Possible. It's diffed against my tree. Forgot that
I have some other changes in there.
I will resend a fixed fix :)

-- 
Greetings Michael.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] d80211: Turn PHYmode list from an array into a linked list

2006-12-15 Thread Michael Buesch
On Friday 15 December 2006 15:06, Jiri Benc wrote:
 On Fri, 15 Dec 2006 14:54:55 +0100, Michael Buesch wrote:
  Can you also apply the bcm43xx fix for this to your tree?
  I think that should be easiest and prevent long-living breakage.
 
 It doesn't apply :-( It's probably easy to fix but I'd rather leave it
 to you to not make any damage.

Here's the fixed patch diffed against your tree.

Still Signed-off-by: Michael Buesch [EMAIL PROTECTED]

Index: jbenc-dscape/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h
===
--- jbenc-dscape.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h 
2006-12-15 15:58:04.0 +0100
+++ jbenc-dscape/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h  2006-12-15 
16:17:30.0 +0100
@@ -503,6 +503,8 @@ struct bcm43xx_phyinfo {
enum bcm43xx_firmware_compat fw;
/* The TX header length. This depends on the firmware. */
size_t txhdr_size;
+
+   struct ieee80211_hw_mode hwmode;
 };
 
 
Index: jbenc-dscape/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c
===
--- jbenc-dscape.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c
2006-12-15 15:58:04.0 +0100
+++ jbenc-dscape/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c 
2006-12-15 16:30:55.0 +0100
@@ -2845,19 +2845,25 @@ static void bcm43xx_chipset_detach(struc
 
 static void bcm43xx_free_modes(struct bcm43xx_private *bcm)
 {
-   struct ieee80211_hw *hw = bcm-ieee;
+   struct ssb_core *core;
+   struct bcm43xx_corepriv_80211 *wlpriv;
+   struct bcm43xx_phyinfo *phy;
int i;
 
-   for (i = 0; i  hw-num_modes; i++) {
-   kfree(hw-modes[i].channels);
-   kfree(hw-modes[i].rates);
+   for (i = 0; i  bcm-nr_80211_available; i++) {
+   core = bcm-wlcores[i];
+   wlpriv = core-priv;
+   phy = wlpriv-phy;
+
+   kfree(phy-hwmode.channels);
+   phy-hwmode.channels = NULL;
+   kfree(phy-hwmode.rates);
+   phy-hwmode.rates = NULL;
}
-   kfree(hw-modes);
-   hw-modes = NULL;
-   hw-num_modes = 0;
 }
 
-static int bcm43xx_append_mode(struct ieee80211_hw *hw,
+static int bcm43xx_append_mode(struct bcm43xx_private *bcm,
+  struct bcm43xx_phyinfo *phy,
   int mode_id,
   int nr_channels,
   const struct ieee80211_channel *channels,
@@ -2866,10 +2872,10 @@ static int bcm43xx_append_mode(struct ie
   int nr_rates2,
   const struct ieee80211_rate *rates2)
 {
-   struct ieee80211_hw_modes *mode;
+   struct ieee80211_hw_mode *mode;
int err = -ENOMEM;
 
-   mode = (hw-modes[hw-num_modes]);
+   mode = phy-hwmode;
 
mode-mode = mode_id;
mode-num_channels = nr_channels;
@@ -2890,11 +2896,14 @@ static int bcm43xx_append_mode(struct ie
   sizeof(*rates2) * nr_rates2);
}
 
-   hw-num_modes++;
-   err = 0;
+   err = ieee80211_register_hwmode(bcm-ieee, mode);
+   if (err)
+   goto err_free_rates;
 out:
return err;
 
+err_free_rates:
+   kfree(mode-rates);
 err_free_channels:
kfree(mode-channels);
goto out;
@@ -2903,17 +2912,9 @@ err_free_channels:
 static int bcm43xx_setup_modes(struct bcm43xx_private *bcm)
 {
int err = -ENOMEM;
-   struct ieee80211_hw *hw = bcm-ieee;
struct ssb_core *core;
struct bcm43xx_corepriv_80211 *wlpriv;
-   int i, nr_modes;
-
-   nr_modes = bcm-nr_80211_available;
-   hw-modes = kzalloc(sizeof(*(hw-modes)) * nr_modes,
- GFP_KERNEL);
-   if (!hw-modes)
-   goto out;
-   hw-num_modes = 0;
+   int i;
 
for (i = 0; i  bcm-nr_80211_available; i++) {
core = bcm-wlcores[i];
@@ -2921,7 +2922,7 @@ static int bcm43xx_setup_modes(struct bc
 
switch (wlpriv-phy.type) {
case BCM43xx_PHYTYPE_A:
-   err = bcm43xx_append_mode(bcm-ieee, MODE_IEEE80211A,
+   err = bcm43xx_append_mode(bcm, wlpriv-phy, 
MODE_IEEE80211A,
  
ARRAY_SIZE(bcm43xx_a_chantable),
  bcm43xx_a_chantable,
  
ARRAY_SIZE(bcm43xx_ofdm_ratetable),
@@ -2929,7 +2930,7 @@ static int bcm43xx_setup_modes(struct bc
  0, NULL);
break;
case BCM43xx_PHYTYPE_B:
-   err = bcm43xx_append_mode(bcm-ieee, MODE_IEEE80211B,
+   err = bcm43xx_append_mode(bcm, wlpriv-phy, 
MODE_IEEE80211B,
  

Re: [PATCH] Marvell Libertas 8388 802.11b/g USB driver

2006-12-15 Thread Sam Leffler
David Young wrote:
 On Fri, Dec 15, 2006 at 09:52:20PM -0500, Michael Wu wrote:
 On Friday 15 December 2006 17:51, Marcelo Tosatti wrote:
 --- a/include/net/ieee80211_radiotap.h
 +++ b/include/net/ieee80211_radiotap.h
 @@ -168,6 +168,23 @@ struct ieee80211_radiotap_header {
  *  Unitless indication of the Rx/Tx antenna for this packet.
  *  The first antenna is antenna 0.
  *
 + * IEEE80211_RADIOTAP_RX_FLAGS  u_int16_t   bitmap
 + *
 + * Properties of received frames. See flags defined below.
 + *
 + * IEEE80211_RADIOTAP_TX_FLAGS  u_int16_t   bitmap
 + *
 + * Properties of transmitted frames. See flags defined below.
 + *
 + * IEEE80211_RADIOTAP_RTS_RETRIES   u_int8_tdata
 + *
 + * Number of rts retries a transmitted frame used.
 + *
 + * IEEE80211_RADIOTAP_DATA_RETRIES  u_int8_tdata
 + *
 + * Number of unicast retries a transmitted frame used.
 + *
 + *
  * IEEE80211_RADIOTAP_FCS  u32   data
  *
  * FCS from frame in network byte order.
 @@ -187,7 +204,11 @@ enum ieee80211_radiotap_type {
IEEE80211_RADIOTAP_ANTENNA = 11,
IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12,
IEEE80211_RADIOTAP_DB_ANTNOISE = 13,
 -   IEEE80211_RADIOTAP_EXT = 31,
 +   IEEE80211_RADIOTAP_RX_FLAGS = 14,
 +   IEEE80211_RADIOTAP_TX_FLAGS = 15,
 +   IEEE80211_RADIOTAP_RTS_RETRIES = 16,
 +   IEEE80211_RADIOTAP_DATA_RETRIES = 17,
 +   IEEE80211_RADIOTAP_EXT = 31
 };

 /* Channel flags. */
 Did you send this part to netbsd also? We really don't want to fork 
 radiotap. ;) Also, this should be in a separate patch, but I'm guessing it's 
 all rolled together for convenience.
 
 No, especially since NetBSD is where I keep the authoritative definitions.
 
 How have you defined RX_FLAGS and TX_FLAGS?
 
 BTW, IEEE80211_RADIOTAP_FCS (above) never made it into radiotap.  No bit
 is reserved.

Tell that to everyone that implements it.

Sam
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Marvell Libertas 8388 802.11b/g USB driver

2006-12-15 Thread Sam Leffler
Sam Leffler wrote:
 David Young wrote:
 On Fri, Dec 15, 2006 at 09:52:20PM -0500, Michael Wu wrote:
 On Friday 15 December 2006 17:51, Marcelo Tosatti wrote:
 --- a/include/net/ieee80211_radiotap.h
 +++ b/include/net/ieee80211_radiotap.h
 @@ -168,6 +168,23 @@ struct ieee80211_radiotap_header {
  *  Unitless indication of the Rx/Tx antenna for this packet.
  *  The first antenna is antenna 0.
  *
 + * IEEE80211_RADIOTAP_RX_FLAGS  u_int16_t   bitmap
 + *
 + * Properties of received frames. See flags defined below.
 + *
 + * IEEE80211_RADIOTAP_TX_FLAGS  u_int16_t   bitmap
 + *
 + * Properties of transmitted frames. See flags defined below.
 + *
 + * IEEE80211_RADIOTAP_RTS_RETRIES   u_int8_tdata
 + *
 + * Number of rts retries a transmitted frame used.
 + *
 + * IEEE80211_RADIOTAP_DATA_RETRIES  u_int8_tdata
 + *
 + * Number of unicast retries a transmitted frame used.
 + *
 + *
  * IEEE80211_RADIOTAP_FCS  u32   data
  *
  * FCS from frame in network byte order.
 @@ -187,7 +204,11 @@ enum ieee80211_radiotap_type {
IEEE80211_RADIOTAP_ANTENNA = 11,
IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12,
IEEE80211_RADIOTAP_DB_ANTNOISE = 13,
 -   IEEE80211_RADIOTAP_EXT = 31,
 +   IEEE80211_RADIOTAP_RX_FLAGS = 14,
 +   IEEE80211_RADIOTAP_TX_FLAGS = 15,
 +   IEEE80211_RADIOTAP_RTS_RETRIES = 16,
 +   IEEE80211_RADIOTAP_DATA_RETRIES = 17,
 +   IEEE80211_RADIOTAP_EXT = 31
 };

 /* Channel flags. */
 Did you send this part to netbsd also? We really don't want to fork 
 radiotap. ;) Also, this should be in a separate patch, but I'm guessing 
 it's 
 all rolled together for convenience.
 No, especially since NetBSD is where I keep the authoritative definitions.

 How have you defined RX_FLAGS and TX_FLAGS?

 BTW, IEEE80211_RADIOTAP_FCS (above) never made it into radiotap.  No bit
 is reserved.
 
 Tell that to everyone that implements it.
 

My mistake.  David pointed out correctly that the mechanism for adding
the FCS out-of-line (IEEE80211_RADIOTAP_FCS) was not used.  Instead
there is a flag bit that tells whether or not FCS is present (inline) in
the data.  This flag bit is what I was thinking of--it's honored by
ethereal (aka wireshark), kismet, tcpdump, etc.

Sam
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/4][TG3]: Assign tp-link_config.orig_* values.

2006-12-15 Thread Michael Chan
[TG3]: Assign tp-link_config.orig_* values.

tp-link_config.orig_* values must be assigned during
tg3_set_settings() because these values will be used to setup the
link speed during tg3_open().  Without these assignments, the link
speed settings will be all messed by if tg3_set_settings() is called
when the device is down.

Signed-off-by: Michael Chan [EMAIL PROTECTED]

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 571320a..d01538e 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -7981,6 +7981,10 @@ static int tg3_set_settings(struct net_d
tp-link_config.duplex = cmd-duplex;
}
 
+   tp-link_config.orig_speed = tp-link_config.speed;
+   tp-link_config.orig_duplex = tp-link_config.duplex;
+   tp-link_config.orig_autoneg = tp-link_config.autoneg;
+
if (netif_running(dev))
tg3_setup_phy(tp, 1);
 


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4][TG3]: Fix race condition when calling register_netdev().

2006-12-15 Thread Michael Chan
[TG3]: Fix race condition when calling register_netdev().

Hot-plug scripts can call tg3_open() as soon as register_netdev() is
called in tg3_init_one().  We need to call pci_set_drvdata() before
register_netdev(), and netif_carrier_off() needs to be moved to
tg3_open() to avoid race conditions.

Signed-off-by: Michael Chan [EMAIL PROTECTED]

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index d01538e..6804489 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -6988,6 +6988,8 @@ static int tg3_open(struct net_device *d
struct tg3 *tp = netdev_priv(dev);
int err;
 
+   netif_carrier_off(tp-dev);
+
tg3_full_lock(tp, 0);
 
err = tg3_set_power_state(tp, PCI_D0);
@@ -11927,6 +11929,8 @@ static int __devinit tg3_init_one(struct
 */
pci_save_state(tp-pdev);
 
+   pci_set_drvdata(pdev, dev);
+
err = register_netdev(dev);
if (err) {
printk(KERN_ERR PFX Cannot register net device, 
@@ -11934,8 +11938,6 @@ static int __devinit tg3_init_one(struct
goto err_out_iounmap;
}
 
-   pci_set_drvdata(pdev, dev);
-
printk(KERN_INFO %s: Tigon3 [partno(%s) rev %04x PHY(%s)] (%s) %s 
Ethernet ,
   dev-name,
   tp-board_part_number,
@@ -11966,8 +11968,6 @@ static int __devinit tg3_init_one(struct
   (pdev-dma_mask == DMA_32BIT_MASK) ? 32 :
(((u64) pdev-dma_mask == DMA_40BIT_MASK) ? 40 : 64));
 
-   netif_carrier_off(tp-dev);
-
return 0;
 
 err_out_iounmap:


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4][TG3]: Power down/up 5906 PHY correctly.

2006-12-15 Thread Michael Chan
[TG3]: Power down/up 5906 PHY correctly.

The 5906 PHY requires a special register bit to power down and up the
PHY.

Signed-off-by: Michael Chan [EMAIL PROTECTED]

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 6804489..6ee399c 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -959,6 +959,13 @@ static int tg3_phy_reset(struct tg3 *tp)
u32 phy_status;
int err;
 
+   if (GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5906) {
+   u32 val;
+
+   val = tr32(GRC_MISC_CFG);
+   tw32_f(GRC_MISC_CFG, val  ~GRC_MISC_CFG_EPHY_IDDQ);
+   udelay(40);
+   }
err  = tg3_readphy(tp, MII_BMSR, phy_status);
err |= tg3_readphy(tp, MII_BMSR, phy_status);
if (err != 0)
@@ -1170,7 +1177,15 @@ static void tg3_power_down_phy(struct tg
if (tp-tg3_flags2  TG3_FLG2_PHY_SERDES)
return;
 
-   if (GET_ASIC_REV(tp-pci_chip_rev_id) != ASIC_REV_5906) {
+   if (GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5906) {
+   u32 val;
+
+   tg3_bmcr_reset(tp);
+   val = tr32(GRC_MISC_CFG);
+   tw32_f(GRC_MISC_CFG, val | GRC_MISC_CFG_EPHY_IDDQ);
+   udelay(40);
+   return;
+   } else {
tg3_writephy(tp, MII_TG3_EXT_CTRL,
 MII_TG3_EXT_CTRL_FORCE_LED_OFF);
tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x01b2);
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index dfaf4ed..cf78a7e 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -1350,6 +1350,7 @@
 #define  GRC_MISC_CFG_BOARD_ID_57880x0001
 #define  GRC_MISC_CFG_BOARD_ID_5788M   0x00018000
 #define  GRC_MISC_CFG_BOARD_ID_AC91002A1 0x00018000
+#define  GRC_MISC_CFG_EPHY_IDDQ0x0020
 #define  GRC_MISC_CFG_KEEP_GPHY_POWER  0x0400
 #define GRC_LOCAL_CTRL 0x6808
 #define  GRC_LCLCTRL_INT_ACTIVE0x0001


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/4][TG3]: Update version and reldate.

2006-12-15 Thread Michael Chan
[TG3]: Update version and reldate.

Update version to 3.71.

Signed-off-by: Michael Chan [EMAIL PROTECTED]

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 6ee399c..cfdbca2 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -68,8 +68,8 @@
 
 #define DRV_MODULE_NAMEtg3
 #define PFX DRV_MODULE_NAME: 
-#define DRV_MODULE_VERSION 3.70
-#define DRV_MODULE_RELDATE December 1, 2006
+#define DRV_MODULE_VERSION 3.71
+#define DRV_MODULE_RELDATE December 15, 2006
 
 #define TG3_DEF_MAC_MODE   0
 #define TG3_DEF_RX_MODE0


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] d80211: Turn PHYmode list from an array into a linked list

2006-12-15 Thread Michael Wu
On Thursday 14 December 2006 13:20, Michael Buesch wrote:
 -int ieee80211_update_hw(struct ieee80211_hw *hw)
 +int ieee80211_register_hwmode(struct ieee80211_hw *hw,
 +   struct ieee80211_hw_mode *mode)
Looks like this function never returns nonzero now. Can it return void 
instead? This would simplify the fixes for drivers a bit.

-Michael Wu


pgpbs9yM7GdbU.pgp
Description: PGP signature


[PATCH] smc911x: fix netpoll compilation faliure

2006-12-15 Thread Vitaly Wool
Hello folks,

the trivial patch below fixes the compilation failure for smc911x.c when 
NET_POLL_CONTROLLER is set.

 drivers/net/smc911x.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Signed-off-by: Vitaly Wool [EMAIL PROTECTED]

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 2c43433..797ab91 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -1331,7 +1331,7 @@ smc911x_rx_dma_irq(int dma, void *data)
 static void smc911x_poll_controller(struct net_device *dev)
 {
disable_irq(dev-irq);
-   smc911x_interrupt(dev-irq, dev, NULL);
+   smc911x_interrupt(dev-irq, dev);
enable_irq(dev-irq);
 }
 #endif
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/10] cxgb3: Chelsio T3 1G/10G ethernet device driver

2006-12-15 Thread Steve Wise
Hey Jeff,

Is this driver in your queue for merging?  The Chelsio T3 RDMA driver
that depends on the T3 Ethernet driver is also ready to be merged.

I was just wondering if its in queue, or if there is something else we
need to do.

Thanks,

Steve.


On Wed, 2006-12-13 at 21:40 -0800, Divy Le Ray wrote:
 Jeff,
 
 I resubmit the patch supporting the latest Chelsio T3 adapter.
 It incorporates the last feedbacks for code cleanup.
 It is built gainst Linus'tree.
 
 We think the driver is now ready to be merged.
 Can you please advise on the next steps for inclusion in 2.6.20 ?
 
 A corresponding monolithic patch is posted at the following URL:
 http://service.chelsio.com/kernel.org/cxgb3.patch.bz2
 
 This driver is required by the Chelsio T3 RDMA driver
 which was updated on 12/10/2006.
 
 Cheers,
 Divy
 
 -
 To unsubscribe from this list: send the line unsubscribe netdev in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/10] cxgb3: Chelsio T3 1G/10G ethernet device driver

2006-12-15 Thread Jeff Garzik

Steve Wise wrote:

Hey Jeff,

Is this driver in your queue for merging?  The Chelsio T3 RDMA driver
that depends on the T3 Ethernet driver is also ready to be merged.

I was just wondering if its in queue, or if there is something else we
need to do.


I have mainly been waiting for feedback from other developers on it, and 
letting the driver settle down.  When its being revised on a daily 
basis, I usually just delete the driver and wait for the next revision :)


Jeff



-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/10] cxgb3: Chelsio T3 1G/10G ethernet device driver

2006-12-15 Thread Steve Wise
On Fri, 2006-12-15 at 12:06 -0500, Jeff Garzik wrote:
 Steve Wise wrote:
  Hey Jeff,
  
  Is this driver in your queue for merging?  The Chelsio T3 RDMA driver
  that depends on the T3 Ethernet driver is also ready to be merged.
  
  I was just wondering if its in queue, or if there is something else we
  need to do.
 
 I have mainly been waiting for feedback from other developers on it, and 
 letting the driver settle down.  When its being revised on a daily 
 basis, I usually just delete the driver and wait for the next revision :)
 
   Jeff

Ok, fair enough.
  
I do believe all issues/comments have been addressed for both drivers,
and the last review round only had minimal feedback.  Perhaps they're
ready now?

Steve.


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] smc911x: fix netpoll compilation faliure

2006-12-15 Thread Andrew Morton
On Fri, 15 Dec 2006 16:13:28 +0300
Vitaly Wool [EMAIL PROTECTED] wrote:

 Hello folks,
 
 the trivial patch below fixes the compilation failure for smc911x.c when 
 NET_POLL_CONTROLLER is set.
 
  drivers/net/smc911x.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 Signed-off-by: Vitaly Wool [EMAIL PROTECTED]
 
 diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
 index 2c43433..797ab91 100644
 --- a/drivers/net/smc911x.c
 +++ b/drivers/net/smc911x.c
 @@ -1331,7 +1331,7 @@ smc911x_rx_dma_irq(int dma, void *data)
  static void smc911x_poll_controller(struct net_device *dev)
  {
   disable_irq(dev-irq);
 - smc911x_interrupt(dev-irq, dev, NULL);
 + smc911x_interrupt(dev-irq, dev);
   enable_irq(dev-irq);
  }
  #endif

That's a 2.6.19 fix, yes?

It looks like this driver needs a 2.6.20 fix also...

From: Andrew Morton [EMAIL PROTECTED]

Teach this driver about the workqueue changes.

Cc: Vitaly Wool [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/smc911x.c |   21 ++---
 1 files changed, 14 insertions(+), 7 deletions(-)

diff -puN drivers/net/smc911x.c~smc911-workqueue-fixes drivers/net/smc911x.c
--- a/drivers/net/smc911x.c~smc911-workqueue-fixes
+++ a/drivers/net/smc911x.c
@@ -148,6 +148,8 @@ struct smc911x_local {
int tx_throttle;
spinlock_t lock;
 
+   struct net_device *netdev;
+
 #ifdef SMC_USE_DMA
/* DMA needs the physical address of the chip */
u_long physaddr;
@@ -948,10 +950,11 @@ static void smc911x_phy_check_media(stru
  * of autonegotiation.)  If the RPC ANEG bit is cleared, the selection
  * is controlled by the RPC SPEED and RPC DPLX bits.
  */
-static void smc911x_phy_configure(void *data)
+static void smc911x_phy_configure(struct work_struct *work)
 {
-   struct net_device *dev = data;
-   struct smc911x_local *lp = netdev_priv(dev);
+   struct smc911x_local *lp = container_of(work, struct smc911x_local,
+   phy_configure);
+   struct net_device *dev = lp-netdev;
unsigned long ioaddr = dev-base_addr;
int phyaddr = lp-mii.phy_id;
int my_phy_caps; /* My PHY capabilities */
@@ -1495,6 +1498,8 @@ static void smc911x_set_multicast_list(s
 static int
 smc911x_open(struct net_device *dev)
 {
+   struct smc911x_local *lp = netdev_priv(dev);
+
DBG(SMC_DEBUG_FUNC, %s: -- %s\n, dev-name, __FUNCTION__);
 
/*
@@ -1511,7 +1516,7 @@ smc911x_open(struct net_device *dev)
smc911x_reset(dev);
 
/* Configure the PHY, initialize the link state */
-   smc911x_phy_configure(dev);
+   smc911x_phy_configure(lp-phy_configure);
 
/* Turn on Tx + Rx */
smc911x_enable(dev);
@@ -2060,7 +2065,7 @@ static int __init smc911x_probe(struct n
dev-poll_controller = smc911x_poll_controller;
 #endif
 
-   INIT_WORK(lp-phy_configure, smc911x_phy_configure, dev);
+   INIT_WORK(lp-phy_configure, smc911x_phy_configure);
lp-mii.phy_id_mask = 0x1f;
lp-mii.reg_num_mask = 0x1f;
lp-mii.force_media = 0;
@@ -2154,6 +2159,7 @@ static int smc911x_drv_probe(struct plat
 {
struct net_device *ndev;
struct resource *res;
+   struct smc911x_local *lp;
unsigned int *addr;
int ret;
 
@@ -2183,6 +2189,8 @@ static int smc911x_drv_probe(struct plat
 
ndev-dma = (unsigned char)-1;
ndev-irq = platform_get_irq(pdev, 0);
+   lp = netdev_priv(ndev);
+   lp-netdev = ndev;
 
addr = ioremap(res-start, SMC911X_IO_EXTENT);
if (!addr) {
@@ -2204,7 +2212,6 @@ out:
}
 #ifdef SMC_USE_DMA
else {
-   struct smc911x_local *lp = netdev_priv(ndev);
lp-physaddr = res-start;
lp-dev = pdev-dev;
}
@@ -2275,7 +2282,7 @@ static int smc911x_drv_resume(struct pla
smc911x_reset(ndev);
smc911x_enable(ndev);
if (lp-phy_type != 0)
-   smc911x_phy_configure(ndev);
+   smc911x_phy_configure(lp-phy_configure);
netif_device_attach(ndev);
}
}
_

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


acx-20060215 for etch

2006-12-15 Thread jeffery

pci.c needed a fix for etch..

I added the includes for utsrelease.h as they were needed for the 
declaration of UTS_RELEASE in debian etch...


as the acx tarball downloaded into debian etch:
~

debian:/usr/src/acx-20060215# make -C /lib/modules/`uname -r`/build M=`pwd`
make: Entering directory `/usr/src/linux-headers-2.6.18-3-686'
CC [M] /usr/src/acx-20060215/pci.o
In file included from /usr/src/acx-20060215/acx.h:2,
from /usr/src/acx-20060215/pci.c:55:
/usr/src/acx-20060215/wlan_compat.h:246: warning: ‘packed’ attribute 
ignored for field of type ‘u8[6]’
/usr/src/acx-20060215/wlan_compat.h:247: warning: ‘packed’ attribute 
ignored for field of type ‘u8[6]’
/usr/src/acx-20060215/wlan_compat.h:253: warning: ‘packed’ attribute 
ignored for field of type ‘u8’



snip

/usr/src/acx-20060215/pci.c: In function ‘acxpci_e_probe’:
/usr/src/acx-20060215/pci.c:1653: error: ‘UTS_RELEASE’ undeclared (first 
use in this function)
/usr/src/acx-20060215/pci.c:1653: error: (Each undeclared identifier is 
reported only once

/usr/src/acx-20060215/pci.c:1653: error: for each function it appears in.)
make[1]: *** [/usr/src/acx-20060215/pci.o] Error 1
make: *** [_module_/usr/src/acx-20060215] Error 2
make: Leaving directory `/usr/src/linux-headers-2.6.18-3-686'
debian:/usr/src/acx-20060215#

~~~

after researching and discovering these declarations had been put into 
separate includes.h for etch,

I entered pci.c and in the includes header added the line

#include linux/utsrelease.h

and it compiled beautifully.
I haven't touched source code for over 12 years.
Totally made my day.



...jeffery
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html