Re: [PATCH 0/4] atl1: Revised Attansic L1 ethernet driver

2006-11-19 Thread Alan
Would be nice if it used atl_ not at_ so its less likely to cause
namespace clashes.

You have various macros for swaps that are pretty ugly - we have
cpu_to and le/be_to_cpu functions for most swapping cases and these are
generally optimised assembler (eg bswap on x86)

AT_DESC_USED/UNUSED would be better as inline functions but thats not a
serious concern.

Be careful with :1 bitfields when working with hardware - the compiler
has more than one choice about how to pack them.

The irq enable/disable use for locking on vlan appears unsafe. PCI
interrupt delivery is asynchronous which means you can get this happen


card sends PCI interrupt
We call irq_disable
We take lock
We poke bits
We drop lock

PCI interrupt arrives


This really does happen, typically its nasty to debug as well because you
usually only get it on PIII boards on the one in n-zillion times a
message collides and is retransmitted on the APIC bus.

skb->len is unsigned so <= 0 can be == 0. More importantly the subtraction
before the test will wrap and is completely unsafe (see at_xmit_frame)


Alan
-
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: [take24 0/6] kevent: Generic event handling mechanism.

2006-11-19 Thread Ulrich Drepper

Evgeniy Polyakov wrote:

Possible solution:

a) it would be possible to have a "used" flag in each ring buffer entry.
   That's too expensive, I guess.

b) kevent_wait needs another parameter which specifies the which is the
   last (i.e., least recently added) entry in the ring buffer.
   Everything between this entry and the current head (in ->kidx) is
   occupied.  If multiple threads arrive in kevent_wait the highest idx
   (with wrap around possibly lowest) is used.

   kevent_wait will not try to move more entries into the ring buffer
   if ->kidx and the higest index passed in to any kevent_wait call
   is equal (i.e., the ring buffer is full).

   There is one issue, though, and that is that a system call is needed
   to signal to the kernel that more entries in the ring buffer are
   processed and that they can be refilled.  This goes against the
   kernel filling the ring buffer automatically (see below)


If thread calls kevent_wait() it means it has processed previous entries, 
one can call kevent_wait() with $num parameter as zero, which

means that thread does not want any new events, so nothing will be
copied.


This doesn't solve the problem.  You could only request new events when 
all previously reported events are processed.  Plus: how do you report 
events if the you don't allow get_event pass them on?




Writable ring buffer does not sound too good to me - what if one thread
will overwrite the whole ring buffer so kernel's indexes can be screwed?


Agreed, there are problems.  This is why I suggested the ring buffer can 
be a structured.  Parts of it might be read-only, other parts 
read/write.  I don't necessarily think the 'used' flag is the right way. 
 And front/tail pointer solution seems to be better.




Ring buffer processed not in FIFO order is wrong idea


Not necessarily, see my comments about CPU affinity in the previous mail.



- ring buffer can
be potentially very big and searching there for the entry, which was
been marked as 'free' by userspace is not a solution at all - userspace
in that case must provide ukevent so fast tree search would be used,
(and although it is already possible) it requires userspace to make
additional syscalls which is not what we want.


It is not necessary.  I've proposed to only have a fron and tail 
pointer.  The tail pointer is maintained by the application and passed 
to the kernel explicitly or via shared memory.  The kernel maintains the 
front pointer.  No tree needed.




As a solution I can create folowing scheme:
there are two syscalls (or one with a switch) which get events and
commits them.

kevent_wait() becomes a syscall which waits until number of events or
one of them becomes ready and just copies them into ring buffer and
returns. kevent_wait() will fail with special error code when ring
buffer is full.

kevent_commit() frees requested number of events _from the beginning_,
i.e. from special index, visible from userspace. Userspace can create
special counters for events (and even put them into read-only ring 
buffer overwriting some fields of kevent, especially if we will increase

it's size) and only call kevent_commit() when all events have zero usage
counter.


Right, that's basically the front/tail pointer implementation.  That 
would work.  You just have to make sure that the kevent_wait() call 
takes the current front pointer/index as a parameter.  This way if the 
buffer gets filled between the thread checking the ring buffer (and 
finding it empty) and the syscall being handled the thread is not suspended.




I disagree that having possibility to have holes in the ring buffer is a
good idea at all - it requires much more complex protocol, which will
fill and reuse that holes, and the main disavantge - it requires to
transfer much more information from userspace to kernelspace to free the
ring entry in the hole - in that case it is already possible just to
call kevent_ctl(KEVENT_REMOVE) and do not wash the brain with new
approach at all.


Well, it would require more data transport of we'd use writable shared 
memory.  But I agree, it's far too complicated and might not scale with 
growing ring buffer sizes.




- implementing the kevent_wait syscall the proposed way means we are
  missing out on one possible optimization.  The ring buffer is
  currently only filled on kevent_wait calls.  I expect that in really
  high traffic situations requests are coming in at a higher rate than
  the can be processed.  At least for periods of time.  If such
  situations it would be nice to not have to call into the kernel at
  all.  If the kernel would deliver into the ring buffer on its own
  this would be possible.


Well, it can be done on behalf of workqueue or dedicated thread which
will bring up appropriate mm context,


I think it should be done.  It's potentially a huge advantage.



although it means that userspace
can not handle the load it requested, which is a bad sign...


I don't understand.  What is not supposed t

Re: [PATCH 3/4] atl1: Main C file for Attansic L1 driver

2006-11-19 Thread Arnd Bergmann
On Sunday 19 November 2006 21:30, Jay Cliburn wrote:
> This patch contains the main C file for the Attansic L1 gigabit ethernet
> adapter driver.

Just a few style comments:

> + /* PCI config space info */
> + hw->vendor_id = pdev->vendor;
> + hw->device_id = pdev->device;
> + hw->subsystem_vendor_id = pdev->subsystem_vendor;
> + hw->subsystem_id = pdev->subsystem_device;

Do you actually need the copies of these fields? I guess you can
always access the data from pdev.

> + size = sizeof(struct at_buffer) * (tpd_ring->count + rfd_ring->count);
> + tpd_ring->buffer_info = kmalloc(size, GFP_KERNEL);
> + if (unlikely(!tpd_ring->buffer_info)) {
> + printk(KERN_WARNING "%s: kmalloc failed , size = D%d\n", 
> + at_driver_name, size);
> + return -ENOMEM;
> + }
> + rfd_ring->buffer_info =
> + (struct at_buffer *)(tpd_ring->buffer_info + tpd_ring->count);
> +
> + memset(tpd_ring->buffer_info, 0, size);

Use kzalloc or kcalloc here.

> + ring_header->desc =
> + pci_alloc_consistent(pdev, ring_header->size, &ring_header->dma);
> + if (unlikely(!ring_header->desc)) {
> + kfree(tpd_ring->buffer_info);
> + printk(KERN_WARNING 
> + "%s: pci_alloc_consistent failed, size = D%d\n", 
> + at_driver_name, size);
> + return -ENOMEM;
> + }

Your cleanup path gets simpler if you use goto, and only one
instance of kfree at the end, instead of multiple return statements
in this function.


> + while (!buffer_info->alloced && !next_info->alloced) {
> + if (NULL != buffer_info->skb) {
> + buffer_info->alloced = 1;
> + goto next;
> + }

Instead of 'if (NULL != buffer_info->skb)', you should write
'if (buffer_info->skb)', like you do elsewhere.

> +   next:
> + rfd_next_to_use = next_next;
> + if (unlikely(++next_next == rfd_ring->count))
> + next_next = 0;

Labels go to the start of a line.

> +#ifdef NETIF_F_HW_VLAN_TX
> + if (adapter->vlgrp && (rrd->pkt_flg & PACKET_FLAG_VLAN_INS)) {
> + u16 vlan_tag = (rrd->vlan_tag >> 4) |
> + ((rrd->vlan_tag & 7) << 13) | 
> + ((rrd->vlan_tag & 8) << 9);
> + vlan_hwaccel_rx(skb, adapter->vlgrp, vlan_tag);
> + } else
> +#endif

No need for the #ifdef when submitting the driver for inclusion.
In this kernel version, NETIF_F_HW_VLAN_TX is always defined.

> +static int at_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int 
> cmd)
> +{
> + struct at_adapter *adapter = netdev_priv(netdev);
> +/*   struct mii_ioctl_data *data = (struct mii_ioctl_data *)&ifr->ifr_data;*/
> + struct mii_ioctl_data *data = if_mii(ifr);
> + unsigned long flags;
> +
> + switch (cmd) {
> + case SIOCGMIIPHY:
> + data->phy_id = 0;
> + break;
> + case SIOCGMIIREG:
> + if (!capable(CAP_NET_ADMIN))
> + return -EPERM;
> + spin_lock_irqsave(&adapter->stats_lock, flags);
> + if (at_read_phy_reg
> + (&adapter->hw, data->reg_num & 0x1F, &data->val_out)) {
> + spin_unlock_irqrestore(&adapter->stats_lock, flags);
> + return -EIO;
> + }
> + spin_unlock_irqrestore(&adapter->stats_lock, flags);
> + break;
> + case SIOCSMIIREG:
> + if (!capable(CAP_NET_ADMIN))
> + return -EPERM;
> + if (data->reg_num & ~(0x1F))
> + return -EFAULT;
> + spin_lock_irqsave(&adapter->stats_lock, flags);
> + printk(KERN_DEBUG "%s: at_mii_ioctl write %x %x\n", 
> + at_driver_name, data->reg_num,
> +   data->val_in);
> + if (at_write_phy_reg(&adapter->hw, data->reg_num, 
> data->val_in)) {
> + spin_unlock_irqrestore(&adapter->stats_lock, flags);
> + return -EIO;
> + }
> + spin_unlock_irqrestore(&adapter->stats_lock, flags);
> + break;
> + default:
> + return -EOPNOTSUPP;
> + }
> + return AT_SUCCESS;
> +}
> +#endif   /* SIOCGMIIPHY */

Any reason why you can't use generic_mii_ioctl?

> +  err_init_hw:
> +  err_reset:
> +  err_register:
> +  err_sw_init:
> +  err_eeprom:
> + iounmap(adapter->hw.hw_addr);
> +  err_ioremap:
> + free_netdev(netdev);
> +  err_alloc_etherdev:
> + pci_release_regions(pdev);
> + return err;

It's more common to have a single label with multiple gotos instead
of multiple labels that all go to one statement.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of

Re: d80211: RFC: divide by zero when hw->maxssi not set

2006-11-19 Thread Dan Williams
On Fri, 2006-11-17 at 15:51 -0800, David Kimdon wrote:
> Hi,
> 
> commit 448bf25bc9e3d70a211fdf235426472089371c43 added
> ieee80211_get_wireless_stats in net/d80211/ieee80211_ioctl.c.  At
> present we get a divide by zero (oops) if the low level driver does
> not set the new hw->maxssi field.  Perhaps:
> 
> - reject registration of devices which do not set maxssi
> - do not attempt to report link quality for drivers which do not 
>   set maxssi
> - other ideas? 

#1 could be too draconian, but has the benefit of making driver writers
put _something_ there.  Either way, it's pretty obvious to anyone that
the driver is broken for quality reporting.  But at least #1 forces the
issue to making quality somewhat work.

Dan

> -David
> -
> 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 07/30] bcm43xx: Drain TX status before starting IRQs

2006-11-19 Thread Dan Williams
On Sat, 2006-11-18 at 13:06 -0600, Larry Finger wrote:
> Chris Wright wrote:
> > -stable review patch.  If anyone has any objections, please let us know.
> > --
> > 
> > From: Michael Buesch <[EMAIL PROTECTED]>
> > 
> > Drain the Microcode TX-status-FIFO before we enable IRQs.
> > This is required, because the FIFO may still have entries left
> > from a previous run. Those would immediately fire after enabling
> > IRQs and would lead to an oops in the DMA TXstatus handling code.
> > 
> > Cc: "John W. Linville" <[EMAIL PROTECTED]>
> > Signed-off-by: Michael Buesch <[EMAIL PROTECTED]>
> > Signed-off-by: Larry Finger <[EMAIL PROTECTED]>
> > Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
> > ---
> 
> Chris,
> 
> The regression turns out to be a locking problem involving bcm43xx, 
> wpa_supplicant, and 
> NetworkManager. The exact cause is unknown; however, this patch is clearly 
> not the problem. Please 
> reinstate it for inclusion in -stable.

NM should be using wpa_supplicant underneath.  But depending on the NM
version, NM may be issuing any one of SIWENCODE (only to clear keys),
[S|G]IWSCAN, GIWRANGE, GIWAP, [S|G]IWMODE, [S|G]IWFREQ.  Mainly, NM
cleans up after wpa_supplicant, gets information about the current
connection, and does scans.  All other connection setup and handling is
done by wpa_supplicant.  But note that NM will do any of the above
operations at any time, no matter what wpa_supplicant is doing at that
time.  So the locking in the driver needs to be right, but it should be
right anyway regardless of whether either one or both of NM and
wpa_supplicant is in the picture...

Dan

> Thanks,
> 
> Larry
> 
> 
> -
> 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


[RFT] bcm43xx-softmac: match specifications change in rssi processing

2006-11-19 Thread Larry Finger
On September 5, 2006, Johannes Berg changed the specifications for RSSI
processing. Implementing those changes involves specifying the bytes in
the RX header that contain the LNA (low-noise amplifier) bits, adding a
new argument to bcm43xx_rssi_postprocess, and the actual changes in
the rssi processing.

Signed-off-by: Larry Finger <[EMAIL PROTECTED]>
---

Index: wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_xmit.c
===
--- wireless-2.6.orig/drivers/net/wireless/bcm43xx/bcm43xx_xmit.c
+++ wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_xmit.c
@@ -382,8 +382,8 @@ void bcm43xx_generate_txhdr(struct bcm43
 }
 
 static s8 bcm43xx_rssi_postprocess(struct bcm43xx_private *bcm,
-  u8 in_rssi, int ofdm,
-  int adjust_2053, int adjust_2050)
+  u8 in_rssi, int ofdm, int adjust_2053,
+  int adjust_2050, u8 lna)
 {
struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm);
struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
@@ -395,12 +395,10 @@ static s8 bcm43xx_rssi_postprocess(struc
tmp = in_rssi;
if (tmp > 127)
tmp -= 256;
-   tmp *= 73;
-   tmp /= 64;
if (adjust_2050)
-   tmp += 25;
+   tmp += 17;
else
-   tmp -= 3;
+   tmp -= 4;
} else {
if (bcm->sprom.boardflags & BCM43xx_BFL_RSSI) {
if (in_rssi > 63)
@@ -409,7 +407,7 @@ static s8 bcm43xx_rssi_postprocess(struc
tmp = 31 - tmp;
tmp *= -131;
tmp /= 128;
-   tmp -= 57;
+   tmp -= 67;
} else {
tmp = in_rssi;
tmp = 31 - tmp;
@@ -418,8 +416,23 @@ static s8 bcm43xx_rssi_postprocess(struc
tmp -= 68;
}
if (phy->type == BCM43xx_PHYTYPE_G &&
-   adjust_2050)
+   adjust_2050) {
+   tmp += 20;
+   switch (lna) {
+   case 0:
+   tmp += 2;
+   break;
+   case 1:
+   tmp -= 19;
+   break;
+   case 2:
+   tmp -= 13;
+   break;
+   case 3:
+   tmp -= 25;
+   }
tmp += 25;
+   }
}
break;
case 0x2060:
@@ -454,7 +467,7 @@ static s8 bcm43xx_rssinoise_postprocess(
//TODO: Incomplete specs.
ret = 0;
} else
-   ret = bcm43xx_rssi_postprocess(bcm, in_rssi, 0, 1, 1);
+   ret = bcm43xx_rssi_postprocess(bcm, in_rssi, 0, 1, 1, 0);
 
return ret;
 }
@@ -476,6 +489,7 @@ int bcm43xx_rx(struct bcm43xx_private *b
const u16 rxflags2 = le16_to_cpu(rxhdr->flags2);
const u16 rxflags3 = le16_to_cpu(rxhdr->flags3);
const int is_ofdm = !!(rxflags1 & BCM43xx_RXHDR_FLAGS1_OFDM);
+   u8 lna;
 
if (rxflags2 & BCM43xx_RXHDR_FLAGS2_TYPE2FRAME) {
plcp = (struct bcm43xx_plcp_hdr4 *)(skb->data + 2);
@@ -493,9 +507,11 @@ int bcm43xx_rx(struct bcm43xx_private *b
memset(&stats, 0, sizeof(stats));
stats.mac_time = le16_to_cpu(rxhdr->mactime);
stats.rssi = rxhdr->rssi;
+   lna = (rxhdr->phy_rx_status2 & 0xc) >> 14;
stats.signal = bcm43xx_rssi_postprocess(bcm, rxhdr->rssi, is_ofdm,
  !!(rxflags1 & 
BCM43xx_RXHDR_FLAGS1_2053RSSIADJ),
- !!(rxflags3 & 
BCM43xx_RXHDR_FLAGS3_2050RSSIADJ));
+ !!(rxflags3 & 
BCM43xx_RXHDR_FLAGS3_2050RSSIADJ),
+ lna);
stats.noise = bcm->stats.noise;
if (is_ofdm)
stats.rate = bcm43xx_plcp_get_bitrate_ofdm(plcp);
Index: wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_xmit.h
===
--- wireless-2.6.orig/drivers/net/wireless/bcm43xx/bcm43xx_xmit.h
+++ wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_xmit.h
@@ -94,7 +94

[PATCH] AF_UNIX recv/shutdown race

2006-11-19 Thread jmalicki
On some of our systems (Linux 2.6, 4-way SMP), we have found a race where
occasionally recv() can detect a shutdown before the last bytes written to
the socket, and will exhibit the odd behavior where recv() will return 0
to indicate a shutdown socket, and a subsequent call will return the last
bit data, after which it will return 0 again.

This is demonstrated by the attached test cases (cli.c and srv.c).  Start
one srv and several cli processes (perhaps 4-8) on a 2x dual core P4 (most
likely other systems as well, but I haven't reproduced it on other
configurations), and you will soon see this behavior.

What happens is that in unix_stream_recvmsg, the system checks for any
skbuffs on the queue ready to return.  Meanwhile, immediately afterwards,
another process/processor writes an skbuff and shuts down the sock.  Our
original reader process then checks shutdown, and returns 0.  On the next
call, it finally sees the skbuff written.

This patch combines af_unix's unix_sk(sk).readlock with
unix_state_rlock/runlock(sk).  readlock was only ever used by bind,
autobind, and unix_{stream,dgram}_recvmsg.  I can't see any way of
ensuring correctness for unix_stream_recvmsg without forcing it to hold
the state lock across getting the skbuf and checking shutdown.


Signed-off-by: Joseph Malicki <[EMAIL PROTECTED]>
---
diff -rup linux-2.6.18.orig/include/net/af_unix.h
linux-2.6.18/include/net/af_unix.h
--- linux-2.6.18.orig/include/net/af_unix.h 2006-09-19 23:42:06.0
-0400
+++ linux-2.6.18/include/net/af_unix.h  2006-10-02 19:42:07.0 -0400
@@ -78,7 +78,6 @@ struct unix_sock {
 struct unix_address *addr;
 struct dentry  *dentry;
 struct vfsmount*mnt;
-   struct mutexreadlock;
 struct sock*peer;
 struct sock*other;
 struct sock*gc_tree;
diff -rup linux-2.6.18.orig/net/unix/af_unix.c
linux-2.6.18/net/unix/af_unix.c
--- linux-2.6.18.orig/net/unix/af_unix.c2006-09-19 23:42:06.0 
-0400
+++ linux-2.6.18/net/unix/af_unix.c 2006-10-06 15:28:44.0 -0400
@@ -50,6 +50,8 @@
  *  Arnaldo C. Melo:   Remove MOD_{INC,DEC}_USE_COUNT,
  * the core infrastructure is doing that
  * for all net proto families now (2.5.69+)
+ *Joseph Malicki   :   Fix SMP race between write/shutdown
+ * and read.
  *
  *
  * Known differences from reference BSD that was tested:
@@ -593,7 +595,6 @@ static struct sock * unix_create1(struct
u->mnt= NULL;
spin_lock_init(&u->lock);
atomic_set(&u->inflight, sock ? 0 : -1);
-   mutex_init(&u->readlock); /* single task reading lock */
init_waitqueue_head(&u->peer_wait);
unix_insert_socket(unix_sockets_unbound, sk);
 out:
@@ -650,7 +651,7 @@ static int unix_autobind(struct socket *
struct unix_address * addr;
int err;

-   mutex_lock(&u->readlock);
+   unix_state_rlock(sk);

err = 0;
if (u->addr)
@@ -687,7 +688,7 @@ retry:
spin_unlock(&unix_table_lock);
err = 0;

-out:   mutex_unlock(&u->readlock);
+out:   unix_state_runlock(sk);
return err;
 }

@@ -770,7 +771,7 @@ static int unix_bind(struct socket *sock
goto out;
addr_len = err;

-   mutex_lock(&u->readlock);
+   unix_state_rlock(sk);

err = -EINVAL;
if (u->addr)
@@ -842,7 +843,7 @@ static int unix_bind(struct socket *sock
 out_unlock:
spin_unlock(&unix_table_lock);
 out_up:
-   mutex_unlock(&u->readlock);
+   unix_state_runlock(sk);
 out:
return err;

@@ -1572,7 +1573,7 @@ static int unix_dgram_recvmsg(struct kio

msg->msg_namelen = 0;

-   mutex_lock(&u->readlock);
+   unix_state_rlock(sk);

skb = skb_recv_datagram(sk, flags, noblock, &err);
if (!skb)
@@ -1628,7 +1629,7 @@ static int unix_dgram_recvmsg(struct kio
 out_free:
skb_free_datagram(sk,skb);
 out_unlock:
-   mutex_unlock(&u->readlock);
+   unix_state_runlock(sk);
 out:
return err;
 }
@@ -1674,7 +1675,6 @@ static int unix_stream_recvmsg(struct ki
struct sock_iocb *siocb = kiocb_to_siocb(iocb);
struct scm_cookie tmp_scm;
struct sock *sk = sock->sk;
-   struct unix_sock *u = unix_sk(sk);
struct sockaddr_un *sunaddr=msg->msg_name;
int copied = 0;
int check_creds = 0;
@@ -1704,7 +1704,7 @@ static int unix_stream_recvmsg(struct ki
memset(&tmp_scm, 0, sizeof(tmp_scm));
}

-   mutex_lock(&u->readlock);
+   unix_state_rlock(sk);

do
{
@@ -1728,7 +1728,7 @@ static int unix_stream_recvmsg(struct ki
err = -EAGAIN;
if (!timeo)
break;
-   mutex_un

Re: [PATCH 0/13] move d80211 away from netdev towards wiphy

2006-11-19 Thread Johannes Berg
Alright, a bit more thought later :)

Michael noted that letting people rename their wiphys is probably a good
idea to have stable based on the permanent mac address or such. Will
actually require moving the perm_addr field from struct ieee80211_hw
into struct wiphy (as below) too so that it's possible to query it
generically :)

Since d80211 also should relinquish control of this to cfg80211 I
decided that it was a good idea to make cfg80211 handle the wiphy stuff.
Also, I think cfg80211 should create /sys/class/ieee80211/ to
allow renaming to follow through in sysfs.

My plan would be to do this:

 struct ieee80211_hw {
-   /* these are assigned by d80211, don't write */
-   int index;
+   /* points to the cfg80211 wiphy for this piece */
+   struct wiphy *wiphy;
+
+   /* assigned by d80211, don't write */
struct ieee80211_conf conf;

along with the patch below.

In d80211, I'd then allocate ieee80211_hw and ieee80211_local along with
struct wiphy by doing wiphy_new() with the right size instead of
allocating it along with the master dev.

Thoughts?

--- wireless-dev.orig/include/net/cfg80211.h2006-11-20 00:16:34.999275208 
+0100
+++ wireless-dev/include/net/cfg80211.h 2006-11-20 00:23:01.569275208 +0100
@@ -7,9 +7,10 @@
 #include 
 #include 
 #include 
+#include 
 
 /*
- * 802.11 configuration in-kernel interface
+ * 802.11 configuration and wiphy management in-kernel interface
  *
  * Copyright 2006 Johannes Berg <[EMAIL PROTECTED]>
  */
@@ -164,28 +165,65 @@ struct cfg80211_ops {
 int (*next_bssid)(void *data, u8 *bssid));
 };
 
+#define WIPHYNAMESIZE  16
+
 /**
- * cfg80211_register - register a wiphy with cfg80211
+ * struct wiphy
  *
- * register a given method structure with the cfg80211 system
- * and associate the 'priv' pointer with it.
+ * @wiphy_index: the wiphy index assigned to this item
+ * @class_dev: the class device representing /sys/class/ieee80211/
+ * @name: name of this wiphy
+ */
+struct wiphy {
+   int wiphy_index;
+   struct class_device class_dev;
+   char name[WIPHYNAMESIZE];
+   void *priv;
+};
+
+/**
+ * wiphy_priv - return priv from wiphy
+ */
+static inline void *wiphy_priv(struct wiphy *wiphy)
+{
+   /* no fancy alignment for now... should probably do that */
+   return (char *)wiphy + sizeof(struct wiphy);
+}
+
+/**
+ * wiphy_new - create a new wiphy for use with cfg80211
  *
- * Returns a non-negative wiphy index or a negative error code.
+ * create a new wiphy and associate the given operations with it.
+ * @sizeof_priv bytes are allocated for private use.
  *
- * NOTE: for proper operation, this priv pointer MUST also be
- * assigned to each &struct net_device's @ieee80211_ptr member!
+ * the returned structure's driver-private pointer must be assigned
+ * to each netdev's ieee80211_ptr for proper operation.
  */
-extern int cfg80211_register(struct cfg80211_ops *ops, void *priv);
+struct wiphy *wiphy_new(struct cfg80211_ops *ops, int sizeof_priv);
 
 /**
- * cfg80211_unregister - deregister a wiphy from cfg80211
+ * wiphy_register - register a wiphy with cfg80211
+ *
+ * register the given wiphy
+ *
+ * Returns a non-negative wiphy index or a negative error code.
+ */
+extern int wiphy_register(struct wiphy *wiphy);
+
+/**
+ * wiphy_unregister - deregister a wiphy from cfg80211
  *
  * unregister a device with the given priv pointer.
  * After this call, no more requests can be made with this priv
  * pointer, but the call may sleep to wait for an outstanding
  * request that is being handled.
  */
-extern void cfg80211_unregister(void *priv);
+extern void wiphy_unregister(struct wiphy *wiphy);
+
+/**
+ * cfg80211_free - free wiphy
+ */
+extern void wiphy_free(struct wiphy *wiphy);
 
 /* helper functions specific to nl80211 */
 extern void *nl80211hdr_put(struct sk_buff *skb, u32 pid,
--- wireless-dev.orig/net/wireless/core.c   2006-11-20 00:16:35.059275208 
+0100
+++ wireless-dev/net/wireless/core.c2006-11-20 00:23:01.569275208 +0100
@@ -33,7 +33,7 @@ static struct cfg80211_registered_driver
return NULL;
 
list_for_each_entry(drv, &cfg80211_drv_list, list) {
-   if (drv->priv == priv) {
+   if (drv_priv(drv) == priv) {
result = drv;
break;
}
@@ -48,7 +48,7 @@ static struct cfg80211_registered_driver
struct cfg80211_registered_driver *result = NULL, *drv;
 
list_for_each_entry(drv, &cfg80211_drv_list, list) {
-   if (drv->wiphy == wiphy) {
+   if (drv->wiphy.wiphy_index == wiphy) {
result = drv;
break;
}
@@ -146,41 +146,56 @@ void cfg80211_put_drv(struct cfg80211_re
 
 /* exported functions */
 
-int cfg80211_register(struct cfg80211_ops *ops, void *priv)
+struct wiphy *wiphy_new(struct cfg80211_ops *ops, int sizeof_priv)
 {
-   struct cfg80211_registered_dr

Re: [PATCH 1/4] atl1: Build files for Attansic L1 driver

2006-11-19 Thread Randy Dunlap
On Sun, 19 Nov 2006 14:29:15 -0600 Jay Cliburn wrote:

> From: Jay Cliburn <[EMAIL PROTECTED]>
> 
> This patch contains the build files for the Attansic L1 gigabit ethernet
> adapter driver.
> 
> Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
> ---
> 
>  Kconfig   |   12 
>  Makefile  |1 +
>  atl1/Makefile |   30 ++
>  3 files changed, 43 insertions(+)
> 
> diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
> index 6e863aa..f503d10 100644
> --- a/drivers/net/Kconfig
> +++ b/drivers/net/Kconfig
> @@ -2329,6 +2329,18 @@ config QLA3XXX
> To compile this driver as a module, choose M here: the module
> will be called qla3xxx.
>  
> +config ATL1
> + tristate "Attansic(R) L1 Gigabit Ethernet support (EXPERIMENTAL)"
> + depends on NET_PCI && PCI && EXPERIMENTAL
> + select CRC32
> + select MII
> + ---help---
> +   This driver supports Attansic L1 gigabit ethernet adapter.
> +
> +   To compile this driver as a module, choose M here.  The module
> +   will be called atl1.
> +
> +
>  endmenu

One problem here is that MII depends on NET_ETHERNET, which is
10/100 ethernet, which may not be enabled if someone has only
gigabit ethernet.  :)

I have a partial patch which moves MII and PHYLIB outside of
NET_ETHERNET.  That also makes them usable by USB or other
non-drivers/net/ drivers, e.g., again without the need
to enable NET_ETHERNET if someone only has USB ethernet.  :(

I'll try to post it for review later today.

---
~Randy
-
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 7/13] d80211: add a perm_addr hardware property

2006-11-19 Thread Johannes Berg
On Sun, 2006-11-19 at 20:29 +0100, Johannes Berg wrote:

> + memcpy(ndev->dev_addr, local->wiphy.perm_addr, ETH_ALEN);

> + memcpy(local->mdev->dev_addr, local->wiphy.perm_addr, ETH_ALEN);

ugh, somehow I messed up. that should be local->hw.perm_addr of course.
Same in patch 8.

johannes


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


Re: [PATCH][XFRM]: nlmsg length not computed correctly in the presence of subpolicies

2006-11-19 Thread David Miller
From: Masahide NAKAMURA <[EMAIL PROTECTED]>
Date: Sat, 18 Nov 2006 18:08:42 +0900

> On Fri, 17 Nov 2006 08:48:31 -0500
> jamal <[EMAIL PROTECTED]> wrote:
> 
> > Another one in the same spirit as before. Compiles. I dont have
> > a good test case, but looks right.
> > Nakamura-san please ACK and Dave (as before this goes in as a bug-fix).
> 
> Acked-by: Masahide NAKAMURA <[EMAIL PROTECTED]>
> 
> I've tested with your patch and the result is fine.
> 
> However, unlike the add/delete XFRM policy case pointed by Jamal
> as the previous patch, I don't see the error without this patch on my
> environment about acqiure.
> (Maybe, does acquire path happen to make some buffer for policy type
> since the structures is not aligned cleanly?)
> 
> ..Anyway, the fix is correct for me. David, please apply it, too.

Applied, thanks.
-
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][XFRM]: Sub-policies broke policy events

2006-11-19 Thread David Miller
From: Masahide NAKAMURA <[EMAIL PROTECTED]>
Date: Sat, 18 Nov 2006 17:51:59 +0900

> On Fri, 17 Nov 2006 08:34:44 -0500
> jamal <[EMAIL PROTECTED]> wrote:
> 
> > 
> > Found the cause of my problems. 
> > Dave, this is against Linus tree because it is bug fix.
> > 
> > Nakamura-san please ACK.
> > 
> > cheers,
> > jamal
> 
> 
> It looks fine to me. Thanks, Jamal.
> 
> Acked-by: Masahide NAKAMURA <[EMAIL PROTECTED]>

Applied, thanks everyone.
-
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] IPv6: Fix NULL dereference in ipv6_del_addr()

2006-11-19 Thread David Miller
From: Ville Nuorvala <[EMAIL PROTECTED]>
Date: Fri, 17 Nov 2006 21:27:21 +0200

> YOSHIFUJI Hideaki wrote:
> > In article <[EMAIL PROTECTED]> (at Fri, 17 Nov 2006 15:26:28 +0200), Ville 
> > Nuorvala <[EMAIL PROTECTED]> says:
> > 
> > 
> >> -  dst_release(&rt->u.dst);
> >> +  if (rt)
> >> +  dst_release(&rt->u.dst);
> >>}
> > 
> > I disagree.  This does NOT fix any bugs.
> > 
> > (void *)&rt->u.dst is ever equal to (void*)rt, and
> > dst_release() checks if the argument is NULL.
> 
> As the check is unnecessary you probably want to clean up the other 
> places where rt is checked before &rt->u.dst is passed, as well ;-)
> This is done at least in addrconf.c, ndisc.c and route.c...
> 
> Seriously though, you are probably right about the pointer being equal 
> to NULL in this case,  but does the C language actually guarantee that 
> the pointer to the structure and its first element are equal, or is it 
> implementation dependent? I don't have my K&R here, so I can't check.

I would imagine that it does.  We rely on similar struct layout
semantics in other areas of the networking.

Also, in the past I've been told by GCC folks that the only way to
guarentee that two objects appear together, one after another, in
the .data segment is to place them into a structure :)

I don't think, therefore, that this will ever break.
-
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


[PATCHSET] DECNet address netlink work

2006-11-19 Thread Thomas Graf
First batch of patches to convert the DECNet address
code to the new netlink interface.

-
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/3] [DECnet] address: Calculate accurate message size for netlink notifications

2006-11-19 Thread Thomas Graf
Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>

Index: net-2.6.20/net/decnet/dn_dev.c
===
--- net-2.6.20.orig/net/decnet/dn_dev.c 2006-11-19 18:31:06.0 +0100
+++ net-2.6.20/net/decnet/dn_dev.c  2006-11-19 18:33:43.0 +0100
@@ -38,7 +38,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -47,6 +46,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -713,6 +713,14 @@
return rv;
 }
 
+static inline size_t dn_ifaddr_nlmsg_size(void)
+{
+   return NLMSG_ALIGN(sizeof(struct ifaddrmsg))
+  + nla_total_size(IFNAMSIZ) /* IFA_LABEL */
+  + nla_total_size(2) /* IFA_ADDRESS */
+  + nla_total_size(2); /* IFA_LOCAL */
+}
+
 static int dn_dev_fill_ifaddr(struct sk_buff *skb, struct dn_ifaddr *ifa,
u32 pid, u32 seq, int event, unsigned int flags)
 {
@@ -746,18 +754,15 @@
 static void rtmsg_ifa(int event, struct dn_ifaddr *ifa)
 {
struct sk_buff *skb;
-   int payload = sizeof(struct ifaddrmsg) + 128;
int err = -ENOBUFS;
 
-   skb = alloc_skb(nlmsg_total_size(payload), GFP_KERNEL);
+   skb = alloc_skb(dn_ifaddr_nlmsg_size(), GFP_KERNEL);
if (skb == NULL)
goto errout;
 
err = dn_dev_fill_ifaddr(skb, ifa, 0, 0, event, 0);
-   if (err < 0) {
-   kfree_skb(skb);
-   goto errout;
-   }
+   /* failure implies BUG in dn_ifaddr_nlmsg_size() */
+   BUG_ON(err < 0);
 
err = rtnl_notify(skb, 0, RTNLGRP_DECnet_IFADDR, NULL, GFP_KERNEL);
 errout:

--

-
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] [DECnet] address: Rename rtmsg_ifa() to dn_ifaddr_notify()

2006-11-19 Thread Thomas Graf
The name rtmsg_ifa is heavly overused and confusing.

Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>

Index: net-2.6.20/net/decnet/dn_dev.c
===
--- net-2.6.20.orig/net/decnet/dn_dev.c 2006-11-19 18:33:43.0 +0100
+++ net-2.6.20/net/decnet/dn_dev.c  2006-11-19 18:36:45.0 +0100
@@ -73,7 +73,7 @@
 
 static struct dn_dev *dn_dev_create(struct net_device *dev, int *err);
 static void dn_dev_delete(struct net_device *dev);
-static void rtmsg_ifa(int event, struct dn_ifaddr *ifa);
+static void dn_ifaddr_notify(int event, struct dn_ifaddr *ifa);
 
 static int dn_eth_up(struct net_device *);
 static void dn_eth_down(struct net_device *);
@@ -442,7 +442,7 @@
}
}
 
-   rtmsg_ifa(RTM_DELADDR, ifa1);
+   dn_ifaddr_notify(RTM_DELADDR, ifa1);
blocking_notifier_call_chain(&dnaddr_chain, NETDEV_DOWN, ifa1);
if (destroy) {
dn_dev_free_ifa(ifa1);
@@ -477,7 +477,7 @@
ifa->ifa_next = dn_db->ifa_list;
dn_db->ifa_list = ifa;
 
-   rtmsg_ifa(RTM_NEWADDR, ifa);
+   dn_ifaddr_notify(RTM_NEWADDR, ifa);
blocking_notifier_call_chain(&dnaddr_chain, NETDEV_UP, ifa);
 
return 0;
@@ -751,7 +751,7 @@
 return -1;
 }
 
-static void rtmsg_ifa(int event, struct dn_ifaddr *ifa)
+static void dn_ifaddr_notify(int event, struct dn_ifaddr *ifa)
 {
struct sk_buff *skb;
int err = -ENOBUFS;

--

-
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] [DECNET] address: Convert to new netlink interface

2006-11-19 Thread Thomas Graf
Extends the netlink interface to support the __le16 type and
converts address addition, deletion and, dumping to use the
new netlink interface.

Fixes multiple occasions of possible illegal memory references
due to not validated netlink attributes.

Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>

Index: net-2.6.20/include/net/netlink.h
===
--- net-2.6.20.orig/include/net/netlink.h   2006-11-19 18:36:40.0 
+0100
+++ net-2.6.20/include/net/netlink.h2006-11-19 21:43:12.0 +0100
@@ -829,6 +829,9 @@
 #define NLA_PUT_U16(skb, attrtype, value) \
NLA_PUT_TYPE(skb, u16, attrtype, value)
 
+#define NLA_PUT_LE16(skb, attrtype, value) \
+   NLA_PUT_TYPE(skb, __le16, attrtype, value)
+
 #define NLA_PUT_U32(skb, attrtype, value) \
NLA_PUT_TYPE(skb, u32, attrtype, value)
 
@@ -875,6 +878,15 @@
 }
 
 /**
+ * nla_get_le16 - return payload of __le16 attribute
+ * @nla: __le16 netlink attribute
+ */
+static inline __le16 nla_get_le16(struct nlattr *nla)
+{
+   return *(__le16 *) nla_data(nla);
+}
+
+/**
  * nla_get_u8 - return payload of u8 attribute
  * @nla: u8 netlink attribute
  */
Index: net-2.6.20/net/decnet/dn_dev.c
===
--- net-2.6.20.orig/net/decnet/dn_dev.c 2006-11-19 18:36:45.0 +0100
+++ net-2.6.20/net/decnet/dn_dev.c  2006-11-19 22:07:33.0 +0100
@@ -647,41 +647,62 @@
return dn_dev;
 }
 
-static int dn_dev_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void 
*arg)
+static struct nla_policy dn_ifa_policy[IFA_MAX+1] __read_mostly = {
+   [IFA_ADDRESS]   = { .type = NLA_U16 },
+   [IFA_LOCAL] = { .type = NLA_U16 },
+   [IFA_LABEL] = { .type = NLA_STRING,
+   .len = IFNAMSIZ - 1 },
+};
+
+static int dn_nl_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
 {
-   struct rtattr **rta = arg;
+   struct nlattr *tb[IFA_MAX+1];
struct dn_dev *dn_db;
-   struct ifaddrmsg *ifm = NLMSG_DATA(nlh);
+   struct ifaddrmsg *ifm;
struct dn_ifaddr *ifa, **ifap;
+   int err = -EADDRNOTAVAIL;
 
+   err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, dn_ifa_policy);
+   if (err < 0)
+   goto errout;
+
+   ifm = nlmsg_data(nlh);
if ((dn_db = dn_dev_by_index(ifm->ifa_index)) == NULL)
-   return -EADDRNOTAVAIL;
+   goto errout;
 
-   for(ifap = &dn_db->ifa_list; (ifa=*ifap) != NULL; ifap = 
&ifa->ifa_next) {
-   void *tmp = rta[IFA_LOCAL-1];
-   if ((tmp && memcmp(RTA_DATA(tmp), &ifa->ifa_local, 2)) ||
-   (rta[IFA_LABEL-1] && rtattr_strcmp(rta[IFA_LABEL-1], 
ifa->ifa_label)))
+   for (ifap = &dn_db->ifa_list; (ifa = *ifap); ifap = &ifa->ifa_next) {
+   if (tb[IFA_LOCAL] &&
+   nla_memcmp(tb[IFA_LOCAL], &ifa->ifa_local, 2))
+   continue;
+
+   if (tb[IFA_LABEL] && nla_strcmp(tb[IFA_LABEL], ifa->ifa_label))
continue;
 
dn_dev_del_ifa(dn_db, ifap, 1);
return 0;
}
 
-   return -EADDRNOTAVAIL;
+errout:
+   return err;
 }
 
-static int dn_dev_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void 
*arg)
+static int dn_nl_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
 {
-   struct rtattr **rta = arg;
+   struct nlattr *tb[IFA_MAX+1];
struct net_device *dev;
struct dn_dev *dn_db;
-   struct ifaddrmsg *ifm = NLMSG_DATA(nlh);
+   struct ifaddrmsg *ifm;
struct dn_ifaddr *ifa;
-   int rv;
+   int err;
+
+   err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, dn_ifa_policy);
+   if (err < 0)
+   return err;
 
-   if (rta[IFA_LOCAL-1] == NULL)
+   if (tb[IFA_LOCAL] == NULL)
return -EINVAL;
 
+   ifm = nlmsg_data(nlh);
if ((dev = __dev_get_by_index(ifm->ifa_index)) == NULL)
return -ENODEV;
 
@@ -695,22 +716,25 @@
if ((ifa = dn_dev_alloc_ifa()) == NULL)
return -ENOBUFS;
 
-   if (!rta[IFA_ADDRESS - 1])
-   rta[IFA_ADDRESS - 1] = rta[IFA_LOCAL - 1];
-   memcpy(&ifa->ifa_local, RTA_DATA(rta[IFA_LOCAL-1]), 2);
-   memcpy(&ifa->ifa_address, RTA_DATA(rta[IFA_ADDRESS-1]), 2);
+   if (tb[IFA_ADDRESS] == NULL)
+   tb[IFA_ADDRESS] = tb[IFA_LOCAL];
+
+   ifa->ifa_local = nla_get_le16(tb[IFA_LOCAL]);
+   ifa->ifa_address = nla_get_le16(tb[IFA_ADDRESS]);
ifa->ifa_flags = ifm->ifa_flags;
ifa->ifa_scope = ifm->ifa_scope;
ifa->ifa_dev = dn_db;
-   if (rta[IFA_LABEL-1])
-   rtattr_strlcpy(ifa->ifa_label, rta[IFA_LABEL-1], IFNAMSIZ);
+
+   if (tb[IFA_LABEL])
+   nla_strlcpy(ifa->ifa_label, tb[IFA_LABEL], IFNAMSIZ);
else
memcpy(ifa

Re: [PATCH 2.6.20 0/17][BNX2]: patches

2006-11-19 Thread David Miller
From: "Michael Chan" <[EMAIL PROTECTED]>
Date: Thu, 16 Nov 2006 18:58:53 -0800

> David,  A set of BNX2 patches for 2.6.20 to fix bugs, improve
> SerDes, and support a new chip.  Please review and apply.
 ...
> [PATCH 1/17][BNX2]: Fix Xen problem.
> [PATCH 2/17][BNX2]: Improve SerDes handling.
> [PATCH 3/17][BNX2]: Add bnx2_5706_serdes_timer().
> [PATCH 4/17][BNX2]: Add 5708S parallel detection.
> [PATCH 5/17][BNX2]: Remove udelay() in copper PHY code.
> [PATCH 6/17][BNX2]: Re-organize firmware structures.
> [PATCH 7/17][BNX2]: Add new 5709 registers (part 1).
> [PATCH 8/17][BNX2]: Add new 5709 registers (part 2).
> [PATCH 9/17][BNX2]: Add 5709 init code.
> [PATCH 10/17][BNX2]: Add 5709 reset and runtime code.
> [PATCH 11/17][BNX2]: New firmware to support 5709 (part 1).
> [PATCH 12/17][BNX2]: New firmware to support 5709 (part 2).
> [PATCH 13/17][BNX2]: New firmware to support 5709 (part 3).
> [PATCH 14/17][BNX2]: New firmware to support 5709 (part 4).
> [PATCH 15/17][BNX2]: Download 5709 firmware.
> [PATCH 16/17][BNX2]: Add 5709 PCI ID.
> [PATCH 17/17][BNX2]: Update version and rel date.

All applied, thanks a lot 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/4] atl1: Main C file for Attansic L1 driver

2006-11-19 Thread Jan Engelhardt
>+char at_driver_name[] = "atl1";
>+static const char at_driver_string[] = "Attansic(R) L1 Ethernet Network 
>Driver";
>+const char at_driver_version[] = DRV_VERSION;
>+static const char at_copyright[] =
>+"Copyright(c) 2005-2006 Attansic Corporation.";
>+

>+extern s32 at_read_mac_addr(struct at_hw *hw);
>+extern s32 at_init_hw(struct at_hw *hw);
>+extern s32 at_get_speed_and_duplex(struct at_hw *hw, u16 * speed, u16 * 
>duplex);
>+extern s32 at_set_speed_and_duplex(struct at_hw *hw, u16 speed, u16 duplex);
>+extern u32 at_auto_get_fc(struct at_adapter *adapter, u16 duplex);
>+extern u32 at_hash_mc_addr(struct at_hw *hw, u8 * mc_addr);
>+extern void at_hash_set(struct at_hw *hw, u32 hash_value);
>+extern s32 at_read_phy_reg(struct at_hw *hw, u16 reg_addr, u16 * phy_data);
>+extern s32 at_write_phy_reg(struct at_hw *hw, u32 reg_addr, u16 phy_data);
>+extern s32 at_validate_mdi_setting(struct at_hw *hw);
>+extern void set_mac_addr(struct at_hw *hw);
>+extern int get_permanent_address(struct at_hw *hw);
>+extern s32 at_phy_enter_power_saving(struct at_hw *hw);
>+extern s32 at_reset_hw(struct at_hw *hw);
>+extern void at_check_options(struct at_adapter *adapter);
>+void at_set_ethtool_ops(struct net_device *netdev);

Put externs in a .h file.

>+static u16 at_alloc_rx_buffers(struct at_adapter *adapter)
>+{
...
>+  u16 rfd_next_to_use, next_next;
>+  struct rx_free_desc *rfd_desc;
>+
>+  next_next = rfd_next_to_use = (u16) atomic_read(&rfd_ring->next_to_use);

Cast not needed.

>+  buffer_info->length = (u16) adapter->rx_buffer_len;

>+  rrd_next_to_clean = (u16) atomic_read(&rrd_ring->next_to_clean);

Same (check the others too)

>+  if (++rfd_ring->next_to_clean == rfd_ring->count) {
>+  rfd_ring->next_to_clean = 0;
>+  }
>+  }
>+
>+  buffer_info = &rfd_ring->buffer_info[rrd->buf_indx];
>+  if (++rfd_ring->next_to_clean == rfd_ring->count) {
>+  rfd_ring->next_to_clean = 0;
>+  }

Here is a stylistic one: {} is not needed for single-statememnt ifs.

>+static irqreturn_t at_intr(int irq, void *data)
>+{
>+  struct at_adapter *adapter = ((struct net_device *)data)->priv;

(Ahem)

>+  if (0 == (status = adapter->cmb.cmb->int_stats))

Someone else is probably going to complain about this one...


I have not looked through all of it, so there are sure some more places.

-`J'
-- 
-
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 2/4] atl1: Header files for Attansic L1 driver

2006-11-19 Thread Jan Engelhardt

On Nov 19 2006 14:30, Jay Cliburn wrote:
>+
>+#define   LBYTESWAP( a )  ( ( ( (a) & 0x00ff00ff ) << 8 ) | ( ( (a) & 
>0xff00ff00 ) >> 8 ) )
>+#define   LONGSWAP( a )   ( ( LBYTESWAP( a ) << 16 ) | ( LBYTESWAP( a ) 
>>> 16 ) )
>+#define   SHORTSWAP( a )  ( ( (a) << 8 ) | ( (a) >> 8 ) )

Please use swab16/swab32 for these.

>+#define AT_DESC_UNUSED(R) \
>+  R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \
>+  (R)->next_to_clean - (R)->next_to_use - 1)
>+
>+#define AT_DESC_USED(R) \
>+  (((R)->next_to_clean > (R)->next_to_use) ?  \
>+  ((R)->count+(R)->next_to_use-(R)->next_to_clean+1) : \
>+  ((R)->next_to_use-(R)->next_to_clean+1))

These look like they are on the edge to be written as a static-inline function.
What do others think?

>+#define AT_WRITE_REG(a, reg, value) ( \
>+  writel((value), ((a)->hw_addr + reg)))
>+
>+#define AT_READ_REG(a, reg) ( \
>+  readl((a)->hw_addr + reg ))
>+
>+#define AT_WRITE_REGB(a, reg, value) (\
>+  writeb((value), ((a)->hw_addr + reg)))
>+
>+#define AT_READ_REGB(a, reg) (\
>+  readb((a)->hw_addr + reg))
>+
>+#define AT_WRITE_REGW(a, reg, value) (\
>+  writew((value), ((a)->hw_addr + reg)))
>+
>+#define AT_READ_REGW(a, reg) (\
>+  readw((a)->hw_addr + reg))
>+
>+#define AT_WRITE_REG_ARRAY(a, reg, offset, value) ( \
>+  writel((value), (((a)->hw_addr + reg) + ((offset) << 2
>+
>+#define AT_READ_REG_ARRAY(a, reg, offset) ( \
>+  readl(((a)->hw_addr + reg) + ((offset) << 2)))

Possibly similarly.


-`J'
-- 
-
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/4] atl1: Revised Attansic L1 ethernet driver

2006-11-19 Thread Jay Cliburn
Based upon feedback from Stephen Hemminger and Francois Romieu, please
consider this resubmitted patchset that provides support for the Attansic 
L1 gigabit ethernet adapter.  This patchset is built against 2.6.19-rc6.  
The original patchset was submitted 20060927.

The monolithic version of this patchset may be found at:
ftp://hogchain.net/pub/linux/m2v/attansic/kernel_driver/atl1-2.0.2/atl1-2.0.2-kernel2.6.19.rc6.patch.bz2

As a reminder, this driver a modified version of the Attansic reference 
driver for the L1 ethernet adapter.  Attansic has granted permission for 
its inclusion in the mainline kernel.

The patch contains:

 Kconfig |   12 
 Makefile|1 
 atl1/Makefile   |   30 
 atl1/atl1.h |  251 +
 atl1/atl1_ethtool.c |  530 ++
 atl1/atl1_hw.c  |  840 +
 atl1/atl1_hw.h  |  991 
 atl1/atl1_main.c| 2551 
 atl1/atl1_osdep.h   |   78 +
 atl1/atl1_param.c   |  203 
 10 files changed, 5487 insertions(+)
-
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] atl1: Ancillary C files for Attansic L1 driver

2006-11-19 Thread Jay Cliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

This patch contains auxiliary C files for the Attansic L1 gigabit ethernet
adapter driver.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---

 atl1_ethtool.c |  530 +++
 atl1_hw.c  |  840
+
 atl1_param.c   |  203 +
 3 files changed, 1573 insertions(+)

diff --git a/drivers/net/atl1/atl1_ethtool.c b/drivers/net/atl1/atl1_ethtool.c
new file mode 100644
index 000..36da53a
--- /dev/null
+++ b/drivers/net/atl1/atl1_ethtool.c
@@ -0,0 +1,530 @@
+/** atl1_ethtool.c - atl1 ethtool support
+
+Copyright(c) 2005 - 2006 Attansic Corporation. All rights reserved.
+Copyright(c) 2006 Chris Snook <[EMAIL PROTECTED]>
+Copyright(c) 2006 Jay Cliburn <[EMAIL PROTECTED]>
+
+Derived from Intel e1000 driver
+Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option)
+any later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59
+Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+*/
+
+#include 
+
+#include "atl1.h"
+
+#ifdef SIOCETHTOOL
+#include 
+
+extern char at_driver_name[];
+extern char at_driver_version[];
+extern s32 at_up(struct at_adapter *adapter);
+extern void at_down(struct at_adapter *adapter);
+extern void at_reset(struct at_adapter *adapter);
+extern s32 at_setup_ring_resources(struct at_adapter *adapter);
+extern void at_free_ring_resources(struct at_adapter *adapter);
+extern s32 at_phy_setup_autoneg_adv(struct at_hw *hw);
+extern s32 at_write_phy_reg(struct at_hw *hw, u32 reg_addr, u16 phy_data);
+extern s32 at_get_speed_and_duplex(struct at_hw *hw, u16 * speed, u16 * 
duplex);
+
+#ifdef ETHTOOL_GSTATS
+struct at_stats {
+   char stat_string[ETH_GSTRING_LEN];
+   int sizeof_stat;
+   int stat_offset;
+};
+
+#define AT_STAT(m) sizeof(((struct at_adapter *)0)->m), \
+   offsetof(struct at_adapter, m)
+
+static struct at_stats at_gstrings_stats[] = {
+   {"rx_packets", AT_STAT(soft_stats.rx_packets)},
+   {"tx_packets", AT_STAT(soft_stats.tx_packets)},
+   {"rx_bytes", AT_STAT(soft_stats.rx_bytes)},
+   {"tx_bytes", AT_STAT(soft_stats.tx_bytes)},
+   {"rx_errors", AT_STAT(soft_stats.rx_errors)},
+   {"tx_errors", AT_STAT(soft_stats.tx_errors)},
+   {"rx_dropped", AT_STAT(net_stats.rx_dropped)},
+   {"tx_dropped", AT_STAT(net_stats.tx_dropped)},
+   {"multicast", AT_STAT(soft_stats.multicast)},
+   {"collisions", AT_STAT(soft_stats.collisions)},
+   {"rx_length_errors", AT_STAT(soft_stats.rx_length_errors)},
+   {"rx_over_errors", AT_STAT(soft_stats.rx_missed_errors)},
+   {"rx_crc_errors", AT_STAT(soft_stats.rx_crc_errors)},
+   {"rx_frame_errors", AT_STAT(soft_stats.rx_frame_errors)},
+   {"rx_fifo_errors", AT_STAT(soft_stats.rx_fifo_errors)},
+   {"rx_missed_errors", AT_STAT(soft_stats.rx_missed_errors)},
+   {"tx_aborted_errors", AT_STAT(soft_stats.tx_aborted_errors)},
+   {"tx_carrier_errors", AT_STAT(soft_stats.tx_carrier_errors)},
+   {"tx_fifo_errors", AT_STAT(soft_stats.tx_fifo_errors)},
+   {"tx_window_errors", AT_STAT(soft_stats.tx_window_errors)},
+   {"tx_abort_exce_coll", AT_STAT(soft_stats.excecol)},
+   {"tx_abort_late_coll", AT_STAT(soft_stats.latecol)},
+   {"tx_deferred_ok", AT_STAT(soft_stats.deffer)},
+   {"tx_single_coll_ok", AT_STAT(soft_stats.scc)},
+   {"tx_multi_coll_ok", AT_STAT(soft_stats.mcc)},
+   {"tx_underun", AT_STAT(soft_stats.tx_underun)},
+   {"tx_trunc", AT_STAT(soft_stats.tx_trunc)},
+   {"tx_pause", AT_STAT(soft_stats.tx_pause)},
+   {"rx_pause", AT_STAT(soft_stats.rx_pause)},
+   {"rx_rrd_ov", AT_STAT(soft_stats.rx_rrd_ov)},
+   {"rx_trunc", AT_STAT(soft_stats.rx_trunc)}
+};
+
+#define AT_STATS_LEN sizeof(at_gstrings_stats) / sizeof(struct at_stats)
+#endif /* ETHTOOL_GSTATS */
+
+static int at_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
+{
+   struct at_adapter *adapter = netdev_priv(netdev);
+   struct at_hw *hw = &adapter->hw;
+
+   ecmd->supported = (SUPPORTED_10baseT_Half |
+  SUPPORTED_10baseT_Full |
+  SUPPORTED_100baseT_Half |
+  SUPPORTED_100baseT_Full |
+  SUPPORTED_1000baseT_Full |
+  SUPPORTED_Autoneg | SUPPORTED_TP);
+   ecmd->

[PATCH 2/4] atl1: Header files for Attansic L1 driver

2006-11-19 Thread Jay Cliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

This patch contains the header files needed by the Attansic L1 gigabit
ethernet adapter driver.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---

 atl1.h   |  251 ++
 atl1_hw.h|  991
+++
 atl1_osdep.h |   78 
 3 files changed, 1320 insertions(+)

diff --git a/drivers/net/atl1/atl1.h b/drivers/net/atl1/atl1.h
new file mode 100644
index 000..95a5fa1
--- /dev/null
+++ b/drivers/net/atl1/atl1.h
@@ -0,0 +1,251 @@
+/** atl1.h - atl1 main header
+
+Copyright(c) 2005 - 2006 Attansic Corporation. All rights reserved.
+Copyright(c) 2006 Chris Snook <[EMAIL PROTECTED]>
+Copyright(c) 2006 Jay Cliburn <[EMAIL PROTECTED]>
+
+Derived from Intel e1000 driver
+Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option)
+any later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59
+Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+*/
+
+#ifndef _ATL1_H_
+#define _ATL1_H_
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include "atl1_hw.h"
+
+#ifdef NETIF_F_TSO
+#include 
+#endif
+
+#ifdef SIOCGMIIPHY
+#include 
+#endif
+
+#ifdef SIOCETHTOOL
+#include 
+#endif
+
+#ifdef NETIF_F_HW_VLAN_TX
+#include 
+#endif
+
+#define BAR_0  0
+
+#defineLBYTESWAP( a )  ( ( ( (a) & 0x00ff00ff ) << 8 ) | ( ( (a) & 
0xff00ff00 ) >> 8 ) )
+#defineLONGSWAP( a )   ( ( LBYTESWAP( a ) << 16 ) | ( LBYTESWAP( a ) 
>> 16 ) )
+#defineSHORTSWAP( a )  ( ( (a) << 8 ) | ( (a) >> 8 ) )
+
+struct at_adapter;
+
+#define AT_MAX_INTR3
+
+#define AT_DEFAULT_TPD 256
+#define AT_MAX_TPD 1023
+#define AT_MIN_TPD 64
+#define AT_DEFAULT_RFD 512
+#define AT_MIN_RFD 128
+#define AT_MAX_RFD 2047
+
+#define AT_DESC_UNUSED(R) \
+   R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \
+   (R)->next_to_clean - (R)->next_to_use - 1)
+
+#define AT_DESC_USED(R) \
+   (((R)->next_to_clean > (R)->next_to_use) ?  \
+   ((R)->count+(R)->next_to_use-(R)->next_to_clean+1) : \
+   ((R)->next_to_use-(R)->next_to_clean+1))
+
+#define AT_GET_DESC(R, i, type)(&(((type *)((R)->desc))[i]))
+#define AT_RFD_DESC(R, i)  AT_GET_DESC(R, i, struct rx_free_desc)
+#define AT_TPD_DESC(R, i)  AT_GET_DESC(R, i, struct tx_packet_desc)
+#define AT_RRD_DESC(R, i)  AT_GET_DESC(R, i, struct rx_return_desc)
+
+/** wrapper around a pointer to a socket buffer,
+ * so a DMA handle can be stored along with the buffer
+ */
+struct at_buffer {
+   struct sk_buff *skb;
+   u16 length;
+   u16 alloced;
+   dma_addr_t dma;
+};
+
+#define MAX_TX_BUF_LEN 0x3000  /* 12KB */
+
+struct at_tpd_ring {
+   void *desc; /* pointer to the descriptor ring memory */
+   dma_addr_t dma; /* physical adress of the descriptor ring */
+   u16 size;   /* length of descriptor ring in bytes */
+   u16 count;  /* number of descriptors in the ring */
+
+   u16 hw_idx; /* hardware index */
+   atomic_t next_to_clean;
+   atomic_t next_to_use;
+   struct at_buffer *buffer_info;
+};
+
+struct at_rfd_ring {
+   void *desc;
+   dma_addr_t dma;
+   u16 size;
+   u16 count;
+   atomic_t next_to_use;
+   u16 next_to_clean;
+   struct at_buffer *buffer_info;
+};
+
+struct at_rrd_ring {
+   void *desc;
+   dma_addr_t dma;
+   unsigned int size;
+   u16 count;
+   u16 next_to_use;
+   atomic_t next_to_clean;
+};
+
+struct at_ring_header {
+   /* pointer to the descriptor ring memory */
+   void *desc;
+   /* physical adress of the descriptor ring */
+   dma_addr_t dma;
+   /* length of descriptor ring in bytes */
+   unsigned int size;
+};
+
+struct at_cmb {
+   struct coals_msg_block *cmb;
+   dma_addr_t dma;
+};
+
+struct at_smb {
+   struct stats_msg_block *smb;
+   dma_addr_t dma;
+};
+
+/* Statistics counters */
+struct at_sft_stats {
+   u64 rx_packets;
+   u64 tx_packets;
+   u64 rx_bytes;
+   u64 tx_bytes;
+   u64 multicast;
+   u64 collisions;
+   u64 rx_errors;
+   u64 rx_length_errors;
+   u64 rx_crc_errors;
+   u64 rx_frame_erro

[PATCH 1/4] atl1: Build files for Attansic L1 driver

2006-11-19 Thread Jay Cliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

This patch contains the build files for the Attansic L1 gigabit ethernet
adapter driver.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---

 Kconfig   |   12 
 Makefile  |1 +
 atl1/Makefile |   30 ++
 3 files changed, 43 insertions(+)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 6e863aa..f503d10 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2329,6 +2329,18 @@ config QLA3XXX
  To compile this driver as a module, choose M here: the module
  will be called qla3xxx.
 
+config ATL1
+   tristate "Attansic(R) L1 Gigabit Ethernet support (EXPERIMENTAL)"
+   depends on NET_PCI && PCI && EXPERIMENTAL
+   select CRC32
+   select MII
+   ---help---
+ This driver supports Attansic L1 gigabit ethernet adapter.
+
+ To compile this driver as a module, choose M here.  The module
+ will be called atl1.
+
+
 endmenu
 
 #
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index f270bc4..b839af8 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -8,6 +8,7 @@ obj-$(CONFIG_IXGB) += ixgb/
 obj-$(CONFIG_CHELSIO_T1) += chelsio/
 obj-$(CONFIG_EHEA) += ehea/
 obj-$(CONFIG_BONDING) += bonding/
+obj-$(CONFIG_ATL1) += atl1/
 obj-$(CONFIG_GIANFAR) += gianfar_driver.o
 
 gianfar_driver-objs := gianfar.o \
diff --git a/drivers/net/atl1/Makefile b/drivers/net/atl1/Makefile
new file mode 100644
index 000..1a10b91
--- /dev/null
+++ b/drivers/net/atl1/Makefile
@@ -0,0 +1,30 @@
+
+#
+# Attansic L1 gigabit ethernet driver
+# Copyright(c) 2005 - 2006 Attansic Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# The full GNU General Public License is included in this distribution in
+# the file called "COPYING".
+#
+
+
+#
+# Makefile for the Attansic L1 gigabit ethernet driver
+#
+
+obj-$(CONFIG_ATL1) += atl1.o
+
+atl1-objs := atl1_main.o atl1_hw.o atl1_ethtool.o atl1_param.o
-
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/13] bcm43xx: update to new d80211 driver API

2006-11-19 Thread Johannes Berg
On Sun, 2006-11-19 at 20:43 +0100, Michael Buesch wrote:
> On Sunday 19 November 2006 20:31, Johannes Berg wrote:
> 
> > --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_debugfs.c 
> > 2006-11-19 20:12:47.629275208 +0100
> > +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_debugfs.c  
> > 2006-11-19 20:14:01.189275208 +0100
> > @@ -285,7 +285,7 @@ void bcm43xx_debugfs_add_device(struct b
> >  {
> > struct bcm43xx_dfsentry *e;
> > struct bcm43xx_txstatus_log *log;
> > -   char devdir[IFNAMSIZ];
> > +   char devdir[16];
> 
> What's the purpose of this?

Well since there's no interface name printed into that string any more
but the wiphy%d I figured I'd not use IFNAMSIZ.

johannes


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


Re: [PATCH][Generic netlink]: dont send empty operational attributes

2006-11-19 Thread Thomas Graf
* jamal <[EMAIL PROTECTED]> 2006-11-19 14:22
> On 11/19/06, jamal <[EMAIL PROTECTED]> wrote:
> >This is probably 2.6.19 material (a little annoyance)
> >I am testing using a new mailer - if this patch doesnt look right let me
> know.
> 
> Seems like i failed. Ok, heres the patch again..

HTML mail and application/octet-stream for the patch? :-)
Probably never made it to netdev. The patch (enclosed again)
is fine though.

Dont add operations attribute headers when the family doesnt have
any (gets annoying to see the header upon first registration
before the commands are registered)

signed-off-by: J Hadi Salim

---
commit 0dc22b960a081832e6c05b59eeefbce564354b94
tree 0659cc668f40fbe383c8d63eaa3adbec72668244
parent e030f8294a5b9f8179dae10cdbf9dcf32aa64110
author J Hadi Salim [EMAIL PROTECTED] <[EMAIL PROTECTED]> Sun, 19 Nov 2006 
14:00:04 -0500
committer J Hadi Salim [EMAIL PROTECTED] <[EMAIL PROTECTED](none)> Sun, 19 Nov 
2006 14:00:04 -0500

 net/netlink/genetlink.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 49bc2db..9e33d5f 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -403,6 +403,9 @@ static int ctrl_fill_info(struct genl_fa
NLA_PUT_U32(skb, CTRL_ATTR_HDRSIZE, family->hdrsize);
NLA_PUT_U32(skb, CTRL_ATTR_MAXATTR, family->maxattr);
 
+   if (list_empty(&family->ops_list))
+   goto ctrl_fill_done;
+
nla_ops = nla_nest_start(skb, CTRL_ATTR_OPS);
if (nla_ops == NULL)
goto nla_put_failure;
@@ -429,6 +432,7 @@ static int ctrl_fill_info(struct genl_fa
nla_nest_end(skb, nest);
}
 
+ctrl_fill_done:
nla_nest_end(skb, nla_ops);
 
return genlmsg_end(skb, hdr);
-
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/13] bcm43xx: update to new d80211 driver API

2006-11-19 Thread Michael Buesch
On Sunday 19 November 2006 20:31, Johannes Berg wrote:

> --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_debugfs.c   
> 2006-11-19 20:12:47.629275208 +0100
> +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_debugfs.c
> 2006-11-19 20:14:01.189275208 +0100
> @@ -285,7 +285,7 @@ void bcm43xx_debugfs_add_device(struct b
>  {
>   struct bcm43xx_dfsentry *e;
>   struct bcm43xx_txstatus_log *log;
> - char devdir[IFNAMSIZ];
> + char devdir[16];

What's the purpose of this?

>   assert(bcm);
>   e = kzalloc(sizeof(*e), GFP_KERNEL);
> @@ -308,7 +308,7 @@ void bcm43xx_debugfs_add_device(struct b
>  
>   bcm->dfsentry = e;
>  
> - strncpy(devdir, bcm->net_dev->name, ARRAY_SIZE(devdir));
> + snprintf(devdir, sizeof(devdir), "wiphy%d", bcm->ieee->index);
>   e->subdir = debugfs_create_dir(devdir, fs.root);
>   e->dentry_tsf = debugfs_create_file("tsf", 0666, e->subdir,
>   bcm, &tsf_fops);

> +static struct ieee80211_ops bcm43xx_hw_ops = {
> + .tx = bcm43xx_net_hard_start_xmit,
> + .open = bcm43xx_net_open,
> + .stop = bcm43xx_net_stop,
> + .add_interface = bcm43xx_add_interface,
> + .remove_interface = bcm43xx_remove_interface,
> + .reset = bcm43xx_net_reset,
> + .config = bcm43xx_net_config,
> + .config_interface = bcm43xx_config_interface,
> + .set_multicast_list = bcm43xx_set_multicast_list,
> + .set_key = bcm43xx_net_set_key,
> + .get_stats = bcm43xx_net_get_stats,
> + .get_tx_stats = bcm43xx_net_get_tx_stats,
> + .conf_tx = bcm43xx_net_conf_tx,
> +};

I like that being a seperate and static struct.

-- 
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 13/13] d80211: fix scan issues with new ops

2006-11-19 Thread Johannes Berg
If hardware shall do scanning, the hw_scan operation must be set. However,
if the driver is for multiple cards that may or may not do hardware
scanning, it'll need a flag.

Similar issues arise with passive_scan().

This patch introduces flags to fix these issues.

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

--- wireless-dev.orig/include/net/d80211.h  2006-11-19 20:14:02.959275208 
+0100
+++ wireless-dev/include/net/d80211.h   2006-11-19 20:14:03.619275208 +0100
@@ -504,6 +504,12 @@ struct ieee80211_hw {
/* do hardware fragmentation */
 #define IEEE80211_HW_FRAG (1<<15)
 
+   /* hardware does scanning instead of software */
+#define IEEE80211_HW_PASSIVE_SCAN (1<<16)
+
+   /* hardware does scanning instead of software */
+#define IEEE80211_HW_SCAN (1<<17)
+
u32 flags;  /* hardware flags defined above */
 
/* Set to the size of a needed device specific skb headroom for TX 
skbs. */
@@ -625,7 +631,8 @@ struct ieee80211_ops {
 struct ieee80211_scan_conf *conf);
 
/* Ask the hardware to service the scan request, no need to start
-* the scan state machine in stack. */
+* the scan state machine in stack.
+* This callback goes along with the IEEE80211_HW_SCAN flag. */
int (*hw_scan)(struct ieee80211_hw *hw, u8 *ssid, size_t len);
 
 /* return low-level statistics */
--- wireless-dev.orig/net/d80211/ieee80211_sta.c2006-11-19 
20:13:58.049275208 +0100
+++ wireless-dev/net/d80211/ieee80211_sta.c 2006-11-19 20:14:03.619275208 
+0100
@@ -2552,7 +2552,7 @@ int ieee80211_sta_req_scan(struct net_de
 
printk(KERN_DEBUG "%s: starting scan\n", dev->name);
 
-   if (local->ops->hw_scan) {
+   if (local->ops->hw_scan && (local->hw.flags & IEEE80211_HW_SCAN)) {
int rc = local->ops->hw_scan(local_to_hw(local),
ssid, ssid_len);
if (!rc) {
--- wireless-dev.orig/net/d80211/ieee80211_scan.c   2006-11-19 
20:13:58.049275208 +0100
+++ wireless-dev/net/d80211/ieee80211_scan.c2006-11-19 20:14:03.629275208 
+0100
@@ -114,7 +114,8 @@ static void ieee80211_scan_start(struct 
struct ieee80211_channel *chan = NULL;
int ret;
 
-   if (!local->ops->passive_scan) {
+   if (!local->ops->passive_scan ||
+   !(local->hw.flags & IEEE80211_HW_PASSIVE_SCAN)) {
printk(KERN_DEBUG "%s: Scan handler called, yet the hardware "
   "does not support passive scanning. Disabled.\n",
   local->mdev->name);


-
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/13] d80211: remove calib_int

2006-11-19 Thread Johannes Berg
The calibration interval is far too hardware dependent to be useful as a
generic stack setting and some hardware doesn't even have that parameter.

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

--- wireless-dev.orig/include/net/d80211.h  2006-11-19 20:14:02.289275208 
+0100
+++ wireless-dev/include/net/d80211.h   2006-11-19 20:14:02.959275208 +0100
@@ -259,8 +259,6 @@ struct ieee80211_conf {
 *  1 = Ant0,
 *  2 = Ant1 */
 
-   int calib_int;  /* hw/radio calibration interval in
-* seconds */
 int antenna_def;
 int antenna_mode;
 
--- wireless-dev.orig/net/d80211/ieee80211.c2006-11-19 20:14:02.299275208 
+0100
+++ wireless-dev/net/d80211/ieee80211.c 2006-11-19 20:14:02.959275208 +0100
@@ -4473,7 +4473,6 @@ struct ieee80211_hw *ieee80211_alloc_hw(
local->fragmentation_threshold = IEEE80211_MAX_FRAG_THRESHOLD;
local->short_retry_limit = 7;
local->long_retry_limit = 4;
-   local->hw.conf.calib_int = 60;
local->hw.conf.radio_enabled = 1;
local->rate_ctrl_num_up = RATE_CONTROL_NUM_UP;
local->rate_ctrl_num_down = RATE_CONTROL_NUM_DOWN;
--- wireless-dev.orig/net/d80211/ieee80211_ioctl.c  2006-11-19 
20:14:02.299275208 +0100
+++ wireless-dev/net/d80211/ieee80211_ioctl.c   2006-11-19 20:14:02.969275208 
+0100
@@ -2480,12 +2480,6 @@ static int ieee80211_ioctl_prism2_param(
ret = -EINVAL;
break;
 
-   case PRISM2_PARAM_CALIB_INT:
-   local->hw.conf.calib_int = value;
-   if (ieee80211_hw_config(local))
-   ret = -EINVAL;
-   break;
-
case PRISM2_PARAM_ANTENNA_MODE:
local->hw.conf.antenna_mode = value;
if (ieee80211_hw_config(local))
@@ -2687,10 +2681,6 @@ static int ieee80211_ioctl_get_prism2_pa
*param = local->hw.conf.antenna_sel;
break;
 
-   case PRISM2_PARAM_CALIB_INT:
-   *param = local->hw.conf.calib_int;
-   break;
-
case PRISM2_PARAM_ANTENNA_MODE:
*param = local->hw.conf.antenna_mode;
break;
--- wireless-dev.orig/net/d80211/ieee80211_sysfs.c  2006-11-19 
20:13:58.059275208 +0100
+++ wireless-dev/net/d80211/ieee80211_sysfs.c   2006-11-19 20:14:02.969275208 
+0100
@@ -154,7 +154,6 @@ IEEE80211_LOCAL_SHOW(channel, hw.conf.ch
 IEEE80211_LOCAL_SHOW(frequency, hw.conf.freq, "%d");
 IEEE80211_LOCAL_SHOW(radar_detect, hw.conf.radar_detect, "%d");
 IEEE80211_LOCAL_SHOW(antenna_sel, hw.conf.antenna_sel, "%d");
-IEEE80211_LOCAL_SHOW(calib_int, hw.conf.calib_int, "%d");
 IEEE80211_LOCAL_SHOW(bridge_packets, bridge_packets, "%d");
 IEEE80211_LOCAL_SHOW(key_tx_rx_threshold, key_tx_rx_threshold, "%d");
 IEEE80211_LOCAL_SHOW(rts_threshold, rts_threshold, "%d");
@@ -220,7 +219,6 @@ static struct class_device_attribute iee
__ATTR(frequency, S_IRUGO, ieee80211_local_show_frequency, NULL),
__ATTR(radar_detect, S_IRUGO, ieee80211_local_show_radar_detect, NULL),
__ATTR(antenna_sel, S_IRUGO, ieee80211_local_show_antenna_sel, NULL),
-   __ATTR(calib_int, S_IRUGO, ieee80211_local_show_calib_int, NULL),
__ATTR(bridge_packets, S_IRUGO, ieee80211_local_show_bridge_packets, 
NULL),
__ATTR(key_tx_rx_threshold, S_IRUGO, 
ieee80211_local_show_key_tx_rx_threshold, NULL),
__ATTR(rts_threshold, S_IRUGO, ieee80211_local_show_rts_threshold, 
NULL),


-
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/13] d80211: remove IEEE80211_CONF_SW_{EN,DE}CRYPT

2006-11-19 Thread Johannes Berg
There's no point in trying to tell a driver globally whether sw or hw
crypto is used, if it's sw then we just don't give it keys...

Besides, these weren't ever used!
Remove IEEE80211_CONF_SW_DECRYPT and IEEE80211_CONF_SW_ENCRYPT.

Acked-by: Michael Buesch <[EMAIL PROTECTED]>
Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>

--- wireless-dev.orig/include/net/d80211.h  2006-11-19 20:14:00.639275208 
+0100
+++ wireless-dev/include/net/d80211.h   2006-11-19 20:14:02.289275208 +0100
@@ -244,11 +244,9 @@ struct ieee80211_conf {
 
 int beacon_int;
 
-#define IEEE80211_CONF_SW_ENCRYPT  (1<<0)
-#define IEEE80211_CONF_SW_DECRYPT  (1<<1)
-#define IEEE80211_CONF_SHORT_SLOT_TIME (1<<2) /* use IEEE 802.11g Short Slot
+#define IEEE80211_CONF_SHORT_SLOT_TIME (1<<0) /* use IEEE 802.11g Short Slot
* Time */
-#define IEEE80211_CONF_SSID_HIDDEN (1<<3) /* do not broadcast the ssid */
+#define IEEE80211_CONF_SSID_HIDDEN (1<<1) /* do not broadcast the ssid */
u32 flags;  /* configuration flags defined above */
 
 u8 power_level;/* transmit power limit for 
current
--- wireless-dev.orig/net/d80211/ieee80211.c2006-11-19 20:14:00.039275208 
+0100
+++ wireless-dev/net/d80211/ieee80211.c 2006-11-19 20:14:02.299275208 +0100
@@ -516,8 +516,7 @@ ieee80211_tx_h_fragment(struct ieee80211
 
 static int wep_encrypt_skb(struct ieee80211_txrx_data *tx, struct sk_buff *skb)
 {
-   if (tx->key->force_sw_encrypt ||
-   (tx->local->hw.conf.flags & IEEE80211_CONF_SW_ENCRYPT)) {
+   if (tx->key->force_sw_encrypt) {
if (ieee80211_wep_encrypt(tx->local, skb, tx->key))
return -1;
} else {
@@ -3268,8 +3267,7 @@ ieee80211_rx_h_wep_weak_iv_detection(str
 
/* Check for weak IVs, if hwaccel did not remove IV from the frame */
if ((rx->local->hw.flags & IEEE80211_HW_WEP_INCLUDE_IV) ||
-   rx->key->force_sw_encrypt ||
-   (rx->local->hw.conf.flags & IEEE80211_CONF_SW_ENCRYPT)) {
+   rx->key->force_sw_encrypt) {
u8 *iv = ieee80211_wep_is_weak_iv(rx->skb, rx->key);
if (iv) {
rx->sta->wep_weak_iv_count++;
@@ -3301,8 +3299,7 @@ ieee80211_rx_h_wep_decrypt(struct ieee80
}
 
if (!(rx->u.rx.status->flag & RX_FLAG_DECRYPTED) ||
-   rx->key->force_sw_encrypt ||
-   (rx->local->hw.conf.flags & IEEE80211_CONF_SW_DECRYPT)) {
+   rx->key->force_sw_encrypt) {
if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key)) {
printk(KERN_DEBUG "%s: RX WEP frame, decrypt "
   "failed\n", rx->dev->name);
--- wireless-dev.orig/net/d80211/ieee80211_ioctl.c  2006-11-19 
20:13:58.049275208 +0100
+++ wireless-dev/net/d80211/ieee80211_ioctl.c   2006-11-19 20:14:02.299275208 
+0100
@@ -492,9 +492,7 @@ int ieee80211_set_hw_encryption(struct n
key->force_sw_encrypt = 1;
 
if (key && local->ops->set_key &&
-   (!(local->hw.conf.flags & IEEE80211_CONF_SW_ENCRYPT) ||
-!(local->hw.conf.flags & IEEE80211_CONF_SW_DECRYPT)) &&
-   (keyconf = ieee80211_key_data2conf(local, key)) != NULL) {
+   (keyconf = ieee80211_key_data2conf(local, key))) {
if (local->ops->set_key(local_to_hw(local), SET_KEY, addr,
   keyconf, sta ? sta->aid : 0)) {
rc = HOSTAP_CRYPT_ERR_KEY_SET_FAILED;
--- wireless-dev.orig/net/d80211/wpa.c  2006-11-19 20:13:58.069275208 +0100
+++ wireless-dev/net/d80211/wpa.c   2006-11-19 20:14:02.309275208 +0100
@@ -104,7 +104,6 @@ ieee80211_tx_h_michael_mic_add(struct ie
 #endif /* CONFIG_HOSTAPD_WPA_TESTING */
 
if (!tx->key->force_sw_encrypt &&
-   !(tx->local->hw.conf.flags & IEEE80211_CONF_SW_DECRYPT) &&
!tx->fragmented &&
!(tx->local->hw.flags & IEEE80211_HW_TKIP_INCLUDE_MMIC) &&
!wpa_test) {
@@ -186,8 +185,7 @@ ieee80211_rx_h_michael_mic_verify(struct
 #endif /* CONFIG_HOSTAPD_WPA_TESTING */
 
if ((rx->u.rx.status->flag & RX_FLAG_DECRYPTED) &&
-   !rx->key->force_sw_encrypt &&
-   !(rx->local->hw.conf.flags & IEEE80211_CONF_SW_DECRYPT)) {
+   !rx->key->force_sw_encrypt) {
if (rx->local->hw.flags & IEEE80211_HW_WEP_INCLUDE_IV) {
if (skb->len < MICHAEL_MIC_LEN)
return TXRX_DROP;
@@ -297,9 +295,7 @@ static int tkip_encrypt_skb(struct ieee8
hdrlen = ieee80211_get_hdrlen(fc);
len = skb->len - hdrlen;
 
-   tailneed = (!tx->key->force_sw_encrypt &&
-   !(tx->local->hw.conf.flags & IEEE80211_CONF_SW_DECRYPT))
-   ? 0 : TKIP_ICV_LEN;
+   tailneed = !tx->key->force_sw_encrypt ? 0 : TKIP_ICV_LEN;
if ((skb_headroom(skb) < TKIP_IV_LEN ||

[PATCH 10/13] bcm43xx: update to new d80211 driver API

2006-11-19 Thread Johannes Berg
Updates bcm43xx.

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

--- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/Makefile  
2006-11-19 20:12:47.459275208 +0100
+++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/Makefile   2006-11-19 
20:14:01.189275208 +0100
@@ -7,6 +7,6 @@ bcm43xx-d80211-obj-$(CONFIG_BCM43XX_D802
 bcm43xx-d80211-objs := bcm43xx_main.o bcm43xx_ilt.o \
   bcm43xx_radio.o bcm43xx_phy.o \
   bcm43xx_power.o bcm43xx_sysfs.o \
-  bcm43xx_leds.o bcm43xx_ethtool.o \
+  bcm43xx_leds.o \
   bcm43xx_xmit.o \
   $(bcm43xx-d80211-obj-y)
--- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h 
2006-11-19 20:12:47.539275208 +0100
+++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h  2006-11-19 
20:14:01.189275208 +0100
@@ -682,7 +682,6 @@ struct bcm43xx_private {
struct ieee80211_hw *ieee;
struct ieee80211_low_level_stats ieee_stats;
 
-   struct net_device *net_dev;
unsigned int irq;
 
spinlock_t irq_lock;
@@ -770,9 +769,9 @@ struct bcm43xx_private {
 
 
 static inline
-struct bcm43xx_private * bcm43xx_priv(struct net_device *dev)
+struct bcm43xx_private * bcm43xx_priv(struct ieee80211_hw *hw)
 {
-   return ieee80211_dev_hw_data(dev);
+   return hw->priv;
 }
 
 static inline
@@ -854,13 +853,7 @@ struct device;
 static inline
 struct bcm43xx_private * dev_to_bcm(struct device *dev)
 {
-   struct net_device *net_dev;
-   struct bcm43xx_private *bcm;
-
-   net_dev = dev_get_drvdata(dev);
-   bcm = bcm43xx_priv(net_dev);
-
-   return bcm;
+   return dev_get_drvdata(dev);
 }
 
 /* Is the device operating in a specified mode (IEEE80211_IF_TYPE_XXX). */
--- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_debugfs.c 
2006-11-19 20:12:47.629275208 +0100
+++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_debugfs.c  
2006-11-19 20:14:01.189275208 +0100
@@ -285,7 +285,7 @@ void bcm43xx_debugfs_add_device(struct b
 {
struct bcm43xx_dfsentry *e;
struct bcm43xx_txstatus_log *log;
-   char devdir[IFNAMSIZ];
+   char devdir[16];
 
assert(bcm);
e = kzalloc(sizeof(*e), GFP_KERNEL);
@@ -308,7 +308,7 @@ void bcm43xx_debugfs_add_device(struct b
 
bcm->dfsentry = e;
 
-   strncpy(devdir, bcm->net_dev->name, ARRAY_SIZE(devdir));
+   snprintf(devdir, sizeof(devdir), "wiphy%d", bcm->ieee->index);
e->subdir = debugfs_create_dir(devdir, fs.root);
e->dentry_tsf = debugfs_create_file("tsf", 0666, e->subdir,
bcm, &tsf_fops);
--- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c 
2006-11-19 20:12:47.709275208 +0100
+++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c  
2006-11-19 20:14:01.199275208 +0100
@@ -525,7 +525,6 @@ static int setup_rx_descbuffer(struct bc
 ring->rx_buffersize, 0);
meta->skb = skb;
meta->dmaaddr = dmaaddr;
-   skb->dev = ring->bcm->net_dev;
 
ring->ops->fill_descriptor(ring, desc, dmaaddr,
   ring->rx_buffersize, 0, 0, 0);
@@ -1091,7 +1090,7 @@ int bcm43xx_dma_tx(struct bcm43xx_privat
ring->nr_tx_packets++;
if (free_slots(ring) < SLOTS_PER_PACKET) {
/* FIXME: we currently only have one queue */
-   ieee80211_stop_queue(bcm->net_dev, 0);
+   ieee80211_stop_queue(bcm->ieee, 0);
ring->stopped = 1;
}
 
@@ -1130,7 +1129,7 @@ void bcm43xx_dma_handle_txstatus(struct 
if (status->acked)
meta->txstat.flags |= IEEE80211_TX_STATUS_ACK;
meta->txstat.retry_count = status->frame_count - 1;
-   ieee80211_tx_status_irqsafe(bcm->net_dev, meta->skb, 
&(meta->txstat));
+   ieee80211_tx_status_irqsafe(bcm->ieee, meta->skb, 
&(meta->txstat));
/* skb is freed by ieee80211_tx_status_irqsafe() */
} else {
/* No need to call free_descriptor_buffer here, as
@@ -1151,7 +1150,7 @@ void bcm43xx_dma_handle_txstatus(struct 
if (ring->stopped) {
assert(free_slots(ring) >= SLOTS_PER_PACKET);
/* FIXME: we currently only have one queue */
-   ieee80211_wake_queue(bcm->net_dev, 0);
+   ieee80211_wake_queue(bcm->ieee, 0);
ring->stopped = 0;
}
 }
--- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_ethtool.c 
2006-11-19 20:12:47.849275208 +0100
+++ /dev/null   1970-01-01 00:00:00.0 +
@@ -1,51 +0,0 @@
-/*
-
-  Broadcom BCM43xx wireless driver
-
-  ethtool support
-
-  Copyright (c) 2006 Jason Lunz <[EMAIL PROTECTED]>
-
-  Some code in this file is derived from the 8139too.c drive

[PATCH 8/13] d80211: introduce IEEE80211_HW_FRAG flag

2006-11-19 Thread Johannes Berg
This introduces the promised IEEE80211_HW_FRAG used to determine whether the
hardware can do fragmentation or not.

It actually makes sense to split this capability flag out from the function
pointer, maybe some hardware wants to be notified about the fragmentation
threshold even though it doesn't do fragmentation itself.

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

--- wireless-dev.orig/include/net/d80211.h  2006-11-19 20:13:59.349275208 
+0100
+++ wireless-dev/include/net/d80211.h   2006-11-19 20:14:00.039275208 +0100
@@ -505,6 +505,9 @@ struct ieee80211_hw {
 * per-packet RC4 key with each TX frame when doing hwcrypto */
 #define IEEE80211_HW_TKIP_REQ_PHASE2_KEY (1<<14)
 
+   /* do hardware fragmentation */
+#define IEEE80211_HW_FRAG (1<<15)
+
u32 flags;  /* hardware flags defined above */
 
/* Set to the size of a needed device specific skb headroom for TX 
skbs. */
@@ -658,8 +661,6 @@ struct ieee80211_ops {
int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value);
 
/* Configuration of fragmentation threshold (if device needs it) */
-   /* FIXME: if this is set, then d80211 will never do fragmentation!
-* hence, this really needs to be a flag in _hw!! */
int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value);
 
/* Configuration of retry limits (if device needs it) */
--- wireless-dev.orig/net/d80211/ieee80211.c2006-11-19 20:13:59.359275208 
+0100
+++ wireless-dev/net/d80211/ieee80211.c 2006-11-19 20:14:00.039275208 +0100
@@ -1079,7 +1079,7 @@ __ieee80211_tx_prepare(struct ieee80211_
tx->fragmented = local->fragmentation_threshold <
IEEE80211_MAX_FRAG_THRESHOLD && tx->u.tx.unicast &&
skb->len + FCS_LEN > local->fragmentation_threshold &&
-   (!local->ops->set_frag_threshold);
+   (!(local->wiphy.flags & IEEE80211_HW_FRAG));
if (!tx->sta)
control->flags |= IEEE80211_TXCTL_CLEAR_DST_MASK;
else if (tx->sta->clear_dst_mask) {


-
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 9/13] d80211: remove useless driver name field

2006-11-19 Thread Johannes Berg
struct ieee80211_ops has a driver name field that's never used.
Remove it.

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

--- wireless-dev.orig/include/net/d80211.h  2006-11-19 20:14:00.039275208 
+0100
+++ wireless-dev/include/net/d80211.h   2006-11-19 20:14:00.639275208 +0100
@@ -531,9 +531,6 @@ struct ieee80211_hw {
  * about supported hardware features and to pass function pointers to callback
  * functions. */
 struct ieee80211_ops {
-   /* Driver name */
-   char *name;
-
/* Handler that 802.11 module calls for each transmitted frame.
 * skb contains the buffer starting from the IEEE 802.11 header.
 * The low-level driver should send the frame out based on


-
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 7/13] d80211: add a perm_addr hardware property

2006-11-19 Thread Johannes Berg
After removing knowledge of the master net_dev from drivers,
they'll still need a way to tell us which MAC address they have.
This is that way, the perm_addr is initially used for all devices.

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

--- wireless-dev.orig/include/net/d80211.h  2006-11-19 20:13:58.029275208 
+0100
+++ wireless-dev/include/net/d80211.h   2006-11-19 20:13:59.349275208 +0100
@@ -11,6 +11,7 @@
 #define D80211_H
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -439,6 +440,9 @@ struct ieee80211_hw {
 
struct device *dev;
 
+   /* permanent mac address */
+   u8 perm_addr[ETH_ALEN];
+
/* TODO: frame_type 802.11/802.3, sw_encryption requirements */
 
/* Some wireless LAN chipsets generate beacons in the hardware/firmware
--- wireless-dev.orig/net/d80211/ieee80211_iface.c  2006-11-19 
20:13:58.069275208 +0100
+++ wireless-dev/net/d80211/ieee80211_iface.c   2006-11-19 20:13:59.359275208 
+0100
@@ -70,7 +70,7 @@ int ieee80211_if_add(struct net_device *
snprintf(ndev->name, IFNAMSIZ, "%s", name);
}
 
-   memcpy(ndev->dev_addr, local->mdev->dev_addr, ETH_ALEN);
+   memcpy(ndev->dev_addr, local->wiphy.perm_addr, ETH_ALEN);
ndev->base_addr = dev->base_addr;
ndev->irq = dev->irq;
ndev->mem_start = dev->mem_start;
@@ -123,7 +123,7 @@ int ieee80211_if_add_mgmt(struct ieee802
goto fail;
 
ndev->ieee80211_ptr = local;
-   memcpy(ndev->dev_addr, local->mdev->dev_addr, ETH_ALEN);
+   memcpy(ndev->dev_addr, local->wiphy.perm_addr, ETH_ALEN);
SET_NETDEV_DEV(ndev, local->mdev->class_dev.dev);
 
nsdata = IEEE80211_DEV_TO_SUB_IF(ndev);
--- wireless-dev.orig/net/d80211/ieee80211.c2006-11-19 20:13:58.039275208 
+0100
+++ wireless-dev/net/d80211/ieee80211.c 2006-11-19 20:13:59.359275208 +0100
@@ -4565,6 +4565,7 @@ int ieee80211_register_hw(struct ieee802
rtnl_unlock();
goto fail_dev;
}
+   memcpy(local->mdev->dev_addr, local->wiphy.perm_addr, ETH_ALEN);
result = register_netdevice(local->mdev);
if (result < 0) {
rtnl_unlock();


-
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 6/13] d80211: change the identifier netdev to ieee80211_hw

2006-11-19 Thread Johannes Berg
Traditionally, drivers were given a struct net_device * in order
to identify the wireless device. This was the master device, but
I'm trying to cut down it's use. Now, there long was a comment
that this might change. That time has come, this patch gives back
a struct ieee80211_hw pointer.

Currently, struct ieee80211_hw contains both static data (almost all of the
function pointers except one) and data that could possibly be per-device
even for a single driver. Hence patch also introduces struct ieee80211_ops
and moves the function pointers from ieee80211_hw into it. This makes
ieee80211_hw be the pure hardware description and allows drivers to make
have their ieee80211_ops static, thereby reducing the struct size
significantly.

Note that the patch changes the meaning of ieee80211_hw, previously it
was allocated by the driver and given to the stack as a hardware
description, now it is allocated by ieee80211alloc_hw() and then the
driver fills it before calling ieee80211_register_hw().

A later patch fixes the FIXME introduced here where hw fragmentation is
checked by having a function assigned or not---if functions are supposed to
be assigned now for all hw we need a new flag for that if some driver has
boards that can and other boards that cannot support it.

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


Patch attached due to size.



006-d80211-driver-api.patch.bz2
Description: application/bzip


[PATCH 5/13] d80211: reduce master ieee80211_ptr deref in scan routines

2006-11-19 Thread Johannes Berg
This patch changes a bunch of prototypes to have struct ieee80211_local*
instead of struct net_device* where that makes sense.

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

--- wireless-dev.orig/net/d80211/ieee80211.c2006-11-19 20:13:56.719275208 
+0100
+++ wireless-dev/net/d80211/ieee80211.c 2006-11-19 20:13:57.379275208 +0100
@@ -2266,7 +2266,7 @@ static int ieee80211_open(struct net_dev
local->hw->remove_interface(dev, &conf);
return res;
}
-   ieee80211_init_scan(local->mdev);
+   ieee80211_init_scan(local);
}
 local->open_count++;
 
@@ -2303,7 +2303,7 @@ static int ieee80211_stop(struct net_dev
 
local->open_count--;
 if (local->open_count == 0) {
-   ieee80211_stop_scan(local->mdev);
+   ieee80211_stop_scan(local);
dev_close(local->mdev);
if (local->apdev)
dev_close(local->apdev);
--- wireless-dev.orig/net/d80211/ieee80211_i.h  2006-11-19 20:13:56.719275208 
+0100
+++ wireless-dev/net/d80211/ieee80211_i.h   2006-11-19 20:13:57.379275208 
+0100
@@ -593,8 +593,8 @@ int ieee80211_set_hw_encryption(struct n
struct ieee80211_key *key);
 
 /* ieee80211_scan.c */
-void ieee80211_init_scan(struct net_device *dev);
-void ieee80211_stop_scan(struct net_device *dev);
+void ieee80211_init_scan(struct ieee80211_local *local);
+void ieee80211_stop_scan(struct ieee80211_local *local);
 
 
 
--- wireless-dev.orig/net/d80211/ieee80211_scan.c   2006-11-19 
20:13:50.889275208 +0100
+++ wireless-dev/net/d80211/ieee80211_scan.c2006-11-19 20:13:57.379275208 
+0100
@@ -105,10 +105,9 @@ static void next_chan_all_modes(struct i
 }
 
 
-static void ieee80211_scan_start(struct net_device *dev,
+static void ieee80211_scan_start(struct ieee80211_local *local,
 struct ieee80211_scan_conf *conf)
 {
-   struct ieee80211_local *local = dev->ieee80211_ptr;
int old_mode_idx = local->scan.mode_idx;
int old_chan_idx = local->scan.chan_idx;
struct ieee80211_hw_modes *mode = NULL;
@@ -118,7 +117,7 @@ static void ieee80211_scan_start(struct 
if (!local->hw->passive_scan) {
printk(KERN_DEBUG "%s: Scan handler called, yet the hardware "
   "does not support passive scanning. Disabled.\n",
-  dev->name);
+  local->mdev->name);
return;
}
 
@@ -136,7 +135,7 @@ static void ieee80211_scan_start(struct 
 
if (!local->scan.skb) {
printk(KERN_DEBUG "%s: Scan start called even though scan.skb "
-  "is not set\n", dev->name);
+  "is not set\n", local->mdev->name);
}
 
if (local->scan.our_mode_only) {
@@ -163,7 +162,7 @@ static void ieee80211_scan_start(struct 
 #if 0
printk(KERN_DEBUG "%s: Doing scan on mode: %d freq: %d chan: %d "
   "for %d ms\n",
-  dev->name, conf->scan_phymode, conf->scan_freq,
+  local->mdev->name, conf->scan_phymode, conf->scan_freq,
   conf->scan_channel, conf->scan_time);
 #endif
local->scan.rx_packets = 0;
@@ -171,9 +170,9 @@ static void ieee80211_scan_start(struct 
local->scan.freq = chan->freq;
local->scan.in_scan = 1;
 
-   ieee80211_netif_oper(dev, NETIF_STOP);
+   ieee80211_netif_oper(local->mdev, NETIF_STOP);
 
-   ret = local->hw->passive_scan(dev, IEEE80211_SCAN_START, conf);
+   ret = local->hw->passive_scan(local->mdev, IEEE80211_SCAN_START, conf);
 
if (ret == 0) {
long usec = local->hw->channel_change_time +
@@ -185,7 +184,7 @@ static void ieee80211_scan_start(struct 
local->scan.in_scan = 0;
if (conf->skb)
dev_kfree_skb(conf->skb);
-   ieee80211_netif_oper(dev, NETIF_WAKE);
+   ieee80211_netif_oper(local->mdev, NETIF_WAKE);
if (ret == -EAGAIN) {
local->scan.timer.expires = jiffies +
(local->scan.interval * HZ / 100);
@@ -193,7 +192,7 @@ static void ieee80211_scan_start(struct 
local->scan.chan_idx = old_chan_idx;
} else {
printk(KERN_DEBUG "%s: Got unknown error from "
-  "passive_scan %d\n", dev->name, ret);
+  "passive_scan %d\n", local->mdev->name, ret);
local->scan.timer.expires = jiffies +
(local->scan.interval * HZ);
}
@@ -204,10 +203,9 @@ static void ieee80211_scan_start(struct 
 }
 
 
-static void ieee80211_scan_stop(struct net_device *dev,
+static void ieee80211_scan_stop(struct ieee80211_local *local,
struct ieee8021

[PATCH 4/13] d80211: reduce mdev usage, change ieee80211_rx_mgmt

2006-11-19 Thread Johannes Berg
This patch reduces mdev usage by replacing struct net_device *
arguments that are never used except for dereferencing to get
struct ieee80211_local from ieee80211_ptr by struct
ieee80211_local directly.

Also, this patch changes ieee80211_rx_mgmt to no longer be callable
when local->apdev is NULL. All callers are updated accordingly,
in most cases actually increasing performance by not allocating
skbs when they won't be given to anyone anyway.

Instead of abusing ieee80211_rx_mgmt also introduce
ieee80211_rx_monitor.

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

--- wireless-dev.orig/net/d80211/ieee80211.c2006-11-19 20:13:56.079275208 
+0100
+++ wireless-dev/net/d80211/ieee80211.c 2006-11-19 20:13:56.719275208 +0100
@@ -210,9 +210,16 @@ static void ieee80211_key_threshold_noti
   struct ieee80211_key *key,
   struct sta_info *sta)
 {
+   struct ieee80211_local *local = dev->ieee80211_ptr;
struct sk_buff *skb;
struct ieee80211_msg_key_notification *msg;
 
+   /* if no one will get it anyway, don't even allocate it.
+* unlikely because this is only relevant for APs
+* where the device must be open... */
+   if (unlikely(!local->apdev))
+   return;
+
skb = dev_alloc_skb(sizeof(struct ieee80211_frame_info) +
sizeof(struct ieee80211_msg_key_notification));
if (!skb)
@@ -230,7 +237,7 @@ static void ieee80211_key_threshold_noti
 
key->tx_rx_count = 0;
 
-   ieee80211_rx_mgmt(dev, skb, NULL,
+   ieee80211_rx_mgmt(local, skb, NULL,
  ieee80211_msg_key_threshold_notification);
 }
 
@@ -2526,45 +2533,11 @@ ieee80211_get_rate(struct ieee80211_loca
return NULL;
 }
 
-
 void
-ieee80211_rx_mgmt(struct net_device *dev, struct sk_buff *skb,
- struct ieee80211_rx_status *status, u32 msg_type)
+ieee80211_fill_frame_info(struct ieee80211_local *local,
+ struct ieee80211_frame_info *fi,
+ struct ieee80211_rx_status *status)
 {
-   struct ieee80211_local *local = dev->ieee80211_ptr;
-struct ieee80211_frame_info *fi;
-size_t hlen;
-struct ieee80211_sub_if_data *sdata;
-
-   if (msg_type != ieee80211_msg_monitor)
-   dev = local->apdev;
-   if (!dev) {
-   dev_kfree_skb(skb);
-   return;
-   }
-skb->dev = dev;
-
-sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-
-   if (skb_headroom(skb) < sizeof(struct ieee80211_frame_info)) {
-   I802_DEBUG_INC(local->rx_expand_skb_head);
-   if (pskb_expand_head(skb, sizeof(struct ieee80211_frame_info),
-0, GFP_ATOMIC)) {
-   dev_kfree_skb(skb);
-return;
-   }
-   }
-
-   hlen = sizeof(struct ieee80211_frame_info);
-   if (msg_type == ieee80211_msg_monitor)
-   hlen -= sizeof(fi->msg_type);
-
-   fi = (struct ieee80211_frame_info *) skb_push(skb, hlen);
-memset(fi, 0, hlen);
-   if (msg_type != ieee80211_msg_monitor)
-   fi->msg_type = htonl(msg_type);
-   fi->version = htonl(IEEE80211_FI_VERSION);
-fi->length = htonl(hlen);
 if (status) {
 struct timespec ts;
struct ieee80211_rate *rate;
@@ -2615,27 +2588,104 @@ ieee80211_rx_mgmt(struct net_device *dev
 fi->ssi_noise = 0x;
 fi->encoding = 0;
} else {
+   /* clear everything because we really don't know.
+* the msg_type field isn't present on monitor frames
+* so we don't know whether it will be present or not,
+* but it's ok to not clear it since it'll be assigned
+* anyway */
+   memset(fi, 0, sizeof(*fi) - sizeof(fi->msg_type));
+
 fi->ssi_type = htonl(ieee80211_ssi_none);
 }
+   fi->version = htonl(IEEE80211_FI_VERSION);
+   fi->length = cpu_to_be32(sizeof(*fi) - sizeof(fi->msg_type));
+}
+
+/* this routine is actually not just for this, but also
+ * for pushing fake 'management' frames into userspace.
+ * it shall be replaced by a netlink-based system. */
+void
+ieee80211_rx_mgmt(struct ieee80211_local *local, struct sk_buff *skb,
+ struct ieee80211_rx_status *status, u32 msg_type)
+{
+   struct ieee80211_frame_info *fi;
+   const size_t hlen = sizeof(struct ieee80211_frame_info);
+   struct ieee80211_sub_if_data *sdata;
+
+   skb->dev = local->apdev;
+
+   sdata = IEEE80211_DEV_TO_SUB_IF(local->apdev);
+
+   if (skb_headroom(skb) < hlen) {
+   I802_DEBUG_INC(local->rx_expand_skb_head);
+   if (pskb_expand_head(skb, hlen, 0, GFP_ATOMIC)) {
+   dev_kfree_skb(skb);
+return;

[PATCH 3/13] d80211: reduce mdev usage

2006-11-19 Thread Johannes Berg
This patch reduces mdev usage by replacing struct net_device *
arguments that are never used except for dereferencing to get
struct ieee80211_local from ieee80211_ptr by struct
ieee80211_local directly. Also removes ->master from sub_if_data.

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

--- wireless-dev.orig/net/d80211/ieee80211_i.h  2006-11-19 20:13:55.359275208 
+0100
+++ wireless-dev/net/d80211/ieee80211_i.h   2006-11-19 20:13:56.069275208 
+0100
@@ -289,7 +289,6 @@ struct ieee80211_sub_if_data {
 unsigned int type;
 
 struct net_device *dev;
-struct net_device *master;
 struct ieee80211_local *local;
 
int mc_count;
--- wireless-dev.orig/net/d80211/ieee80211.c2006-11-19 20:13:55.359275208 
+0100
+++ wireless-dev/net/d80211/ieee80211.c 2006-11-19 20:13:56.079275208 +0100
@@ -1569,7 +1569,7 @@ static int ieee80211_subif_start_xmit(st
pkt_data->mgmt_iface = (sdata->type == IEEE80211_IF_TYPE_MGMT);
pkt_data->do_not_encrypt = no_encrypt;
 
-   skb->dev = sdata->master;
+   skb->dev = local->mdev;
sdata->stats.tx_packets++;
sdata->stats.tx_bytes += skb->len;
 
@@ -1625,7 +1625,7 @@ ieee80211_mgmt_start_xmit(struct sk_buff
pkt_data->pkt_probe_resp = 1;
 
skb->priority = 20; /* use hardcoded priority for mgmt TX queue */
-   skb->dev = sdata->master;
+   skb->dev = sdata->local->mdev;
 
/*
 * We're using the protocol field of the the frame control header
@@ -2031,12 +2031,12 @@ static void ieee80211_set_multicast_list
sdata->mc_count = dev->mc_count;
}
if (local->hw->set_multicast_list) {
-   flags = sdata->master->flags;
+   flags = local->mdev->flags;
if (local->iff_allmultis)
flags |= IFF_ALLMULTI;
if (local->iff_promiscs)
flags |= IFF_PROMISC;
-   local->hw->set_multicast_list(sdata->master, flags,
+   local->hw->set_multicast_list(local->mdev, flags,
  local->mc_count);
}
 }
@@ -2229,7 +2229,7 @@ static int ieee80211_open(struct net_dev
conf.if_id = dev->ifindex;
conf.type = sdata->type;
conf.mac_addr = dev->dev_addr;
-   res = local->hw->add_interface(sdata->master, &conf);
+   res = local->hw->add_interface(local->mdev, &conf);
if (res) {
if (sdata->type == IEEE80211_IF_TYPE_MNTR)
ieee80211_start_hard_monitor(local);
@@ -2245,12 +2245,12 @@ static int ieee80211_open(struct net_dev
 if (local->open_count == 0) {
res = 0;
if (local->hw->open)
-   res = local->hw->open(sdata->master);
+   res = local->hw->open(local->mdev);
if (res == 0) {
-   res = dev_open(sdata->master);
+   res = dev_open(local->mdev);
if (res) {
if (local->hw->stop)
-   local->hw->stop(sdata->master);
+   local->hw->stop(local->mdev);
} else if (local->apdev)
dev_open(local->apdev);
}
@@ -2259,7 +2259,7 @@ static int ieee80211_open(struct net_dev
local->hw->remove_interface(dev, &conf);
return res;
}
-   ieee80211_init_scan(sdata->master);
+   ieee80211_init_scan(local->mdev);
}
 local->open_count++;
 
@@ -2296,12 +2296,12 @@ static int ieee80211_stop(struct net_dev
 
local->open_count--;
 if (local->open_count == 0) {
-   ieee80211_stop_scan(sdata->master);
-   dev_close(sdata->master);
+   ieee80211_stop_scan(local->mdev);
+   dev_close(local->mdev);
if (local->apdev)
dev_close(local->apdev);
if (local->hw->stop)
-   local->hw->stop(sdata->master);
+   local->hw->stop(local->mdev);
 }
if (local->hw->remove_interface) {
struct ieee80211_if_init_conf conf;
@@ -2309,7 +2309,7 @@ static int ieee80211_stop(struct net_dev
conf.if_id = dev->ifindex;
conf.type = sdata->type;
conf.mac_addr = dev->dev_addr;
-   local->hw->remove_interface(sdata->master, &conf);
+   local->hw->remove_interface(local->mdev, &conf);
}
ieee80211_if_shutdown(dev);
 
@@ -3660,7 +3660,7 @@ void __ieee80211_rx(struct net_device *d
continue;
rx.u.rx.ra_match = 0;

[PATCH 2/13] d80211: reduce mdev usage

2006-11-19 Thread Johannes Berg
This patch reduces mdev usage by replacing struct net_device *
arguments that are never used except for dereferencing to get
struct ieee80211_local from ieee80211_ptr by struct
ieee80211_local directly.

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

--- wireless-dev.orig/net/d80211/ieee80211.c2006-11-19 20:13:51.869275208 
+0100
+++ wireless-dev/net/d80211/ieee80211.c 2006-11-19 20:13:55.359275208 +0100
@@ -130,9 +130,8 @@ static int rate_list_match(int *rate_lis
 }
 
 
-void ieee80211_prepare_rates(struct net_device *dev)
+void ieee80211_prepare_rates(struct ieee80211_local *local)
 {
-   struct ieee80211_local *local = dev->ieee80211_ptr;
int i;
 
for (i = 0; i < local->num_curr_rates; i++) {
@@ -1905,9 +1904,8 @@ int ieee80211_if_config_beacon(struct ne
return __ieee80211_if_config(dev, skb);
 }
 
-int ieee80211_hw_config(struct net_device *dev)
+int ieee80211_hw_config(struct ieee80211_local *local)
 {
-   struct ieee80211_local *local = dev->ieee80211_ptr;
int i, ret = 0;
 
 #ifdef CONFIG_D80211_VERBOSE_DEBUG
@@ -1917,7 +1915,7 @@ int ieee80211_hw_config(struct net_devic
 #endif /* CONFIG_D80211_VERBOSE_DEBUG */
 
if (local->hw->config)
-   ret = local->hw->config(dev, &local->conf);
+   ret = local->hw->config(local->mdev, &local->conf);
 
for (i = 0; i < local->hw->num_modes; i++) {
struct ieee80211_hw_modes *mode = &local->hw->modes[i];
@@ -1927,7 +1925,7 @@ int ieee80211_hw_config(struct net_devic
}
local->curr_rates = mode->rates;
local->num_curr_rates = mode->num_rates;
-   ieee80211_prepare_rates(dev);
+   ieee80211_prepare_rates(local);
break;
}
}
@@ -4251,16 +4249,6 @@ int ieee80211_if_update_wds(struct net_d
return 0;
 }
 
-
-static void ieee80211_if_init(struct net_device *dev)
-{
-   struct ieee80211_local *local = dev->ieee80211_ptr;
-
-spin_lock_init(&local->sub_if_lock);
-INIT_LIST_HEAD(&local->sub_if_list);
-}
-
-
 /* Must not be called for mdev and apdev */
 void ieee80211_if_setup(struct net_device *dev)
 {
@@ -4424,6 +4412,9 @@ struct net_device *ieee80211_alloc_hw(si
 
 init_timer(&local->scan.timer); /* clear it out */
 
+   spin_lock_init(&local->sub_if_lock);
+   INIT_LIST_HEAD(&local->sub_if_list);
+
 spin_lock_init(&local->generic_lock);
init_timer(&local->stat_timer);
local->stat_timer.function = ieee80211_stat_refresh;
@@ -4432,8 +4423,6 @@ struct net_device *ieee80211_alloc_hw(si
 
 sta_info_init(local);
 
-ieee80211_if_init(mdev);
-
mdev->hard_start_xmit = ieee80211_master_start_xmit;
mdev->wireless_handlers =
(struct iw_handler_def *) &ieee80211_iw_master_handler_def;
@@ -4600,7 +4589,7 @@ int ieee80211_update_hw(struct net_devic
local->conf.phymode = hw->modes[0].mode;
local->curr_rates = hw->modes[0].rates;
local->num_curr_rates = hw->modes[0].num_rates;
-   ieee80211_prepare_rates(dev);
+   ieee80211_prepare_rates(local);
 
local->conf.freq = local->hw->modes[0].channels[0].freq;
local->conf.channel = local->hw->modes[0].channels[0].chan;
@@ -4625,7 +4614,7 @@ void ieee80211_unregister_hw(struct net_
rtnl_lock();
local->reg_state = IEEE80211_DEV_UNREGISTERED;
if (local->apdev)
-   ieee80211_if_del_mgmt(local->apdev);
+   ieee80211_if_del_mgmt(local);
 
sysfs_remove_link(&local->class_dev.kobj, "master");
 
--- wireless-dev.orig/net/d80211/ieee80211_i.h  2006-11-19 20:13:51.889275208 
+0100
+++ wireless-dev/net/d80211/ieee80211_i.h   2006-11-19 20:13:55.359275208 
+0100
@@ -562,7 +562,7 @@ static inline void bss_tim_clear(struct 
 
 /* ieee80211.c */
 void ieee80211_release_hw(struct ieee80211_local *local);
-int ieee80211_hw_config(struct net_device *dev);
+int ieee80211_hw_config(struct ieee80211_local *local);
 int ieee80211_if_config(struct net_device *dev);
 int ieee80211_if_config_beacon(struct net_device *dev);
 struct ieee80211_key_conf *
@@ -574,7 +574,7 @@ void ieee80211_key_free(struct ieee80211
 void ieee80211_key_release(struct kobject *kobj);
 void ieee80211_rx_mgmt(struct net_device *dev, struct sk_buff *skb,
   struct ieee80211_rx_status *status, u32 msg_type);
-void ieee80211_prepare_rates(struct net_device *dev);
+void ieee80211_prepare_rates(struct ieee80211_local *local);
 void ieee80211_tx_set_iswep(struct ieee80211_txrx_data *tx);
 int ieee80211_if_update_wds(struct net_device *dev, u8 *remote_addr);
 void ieee80211_if_setup(struct net_device *dev);
@@ -662,8 +662,8 @@ int ieee80211_if_remove(struct net_devic
 void ieee80211_if_free(struct net_device *dev);
 void ieee80211_if_flush(struct net_device *dev);
 void ieee80211_if_sdata_init(struct ieee802

[PATCH 1/13] d80211: clean up some stupid list and loop code

2006-11-19 Thread Johannes Berg
"for (; condition ;)"??
Ever heard of while loops?

Also clean up some list handling (still. *sigh*)

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

--- wireless-dev.orig/net/d80211/ieee80211_sta.c2006-11-19 
20:13:52.269275208 +0100
+++ wireless-dev/net/d80211/ieee80211_sta.c 2006-11-19 20:13:54.109275208 
+0100
@@ -1314,16 +1314,10 @@ void ieee80211_rx_bss_list_init(struct n
 void ieee80211_rx_bss_list_deinit(struct net_device *dev)
 {
struct ieee80211_local *local = dev->ieee80211_ptr;
-   struct ieee80211_sta_bss *bss;
-   struct list_head *ptr;
+   struct ieee80211_sta_bss *bss, *tmp;
 
-   for (;;) {
-   ptr = local->sta_bss_list.next;
-   if (!ptr || ptr == &local->sta_bss_list)
-   break;
-   bss = list_entry(ptr, struct ieee80211_sta_bss, list);
+   list_for_each_entry_safe(bss, tmp, &local->sta_bss_list, list)
ieee80211_rx_bss_put(dev, bss);
-   }
 }
 
 
--- wireless-dev.orig/net/d80211/sta_info.c 2006-11-19 20:13:52.339275208 
+0100
+++ wireless-dev/net/d80211/sta_info.c  2006-11-19 20:13:54.119275208 +0100
@@ -324,16 +324,13 @@ static void sta_info_cleanup_expire_buff
 static void sta_info_cleanup(unsigned long data)
 {
struct ieee80211_local *local = (struct ieee80211_local *) data;
-   struct list_head *ptr;
+   struct sta_info *sta, *tmp;
 
spin_lock_bh(&local->sta_lock);
-   ptr = local->sta_list.next;
-   while (ptr && ptr != &local->sta_list) {
-   struct sta_info *sta = (struct sta_info *) ptr;
+   list_for_each_entry_safe(sta, tmp, &local->sta_list, list) {
__sta_info_get(sta);
sta_info_cleanup_expire_buffered(local, sta);
sta_info_put(sta);
-   ptr = ptr->next;
}
spin_unlock_bh(&local->sta_lock);
 
@@ -411,14 +408,11 @@ int sta_info_start(struct ieee80211_loca
 
 void sta_info_stop(struct ieee80211_local *local)
 {
-   struct list_head *ptr;
+   struct sta_info *sta, *tmp;
 
del_timer(&local->sta_cleanup);
 
-   ptr = local->sta_list.next;
-   while (ptr && ptr != &local->sta_list) {
-   struct sta_info *sta = (struct sta_info *) ptr;
-   ptr = ptr->next;
+   list_for_each_entry_safe(sta, tmp, &local->sta_list, list) {
/* sta_info_free must be called with 0 as the last
 * parameter to ensure all sysfs sta entries are
 * unregistered. We don't need locking at this
--- wireless-dev.orig/net/d80211/wme.c  2006-11-19 20:13:52.399275208 +0100
+++ wireless-dev/net/d80211/wme.c   2006-11-19 20:13:54.119275208 +0100
@@ -211,8 +211,7 @@ static inline int classify80211(struct s
skb->priority = classify_1d(skb, qd);
 
/* incase we are a client verify acm is not set for this ac */
-   for (; unlikely(local->wmm_acm & BIT(skb->priority)); )
-   {
+   while (unlikely(local->wmm_acm & BIT(skb->priority))) {
if (wme_downgrade_ac(skb)) {
/* No AC with lower priority has acm=0,
* drop packet. */


-
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/13] move d80211 away from netdev towards wiphy

2006-11-19 Thread Johannes Berg
This is a repost of the whole patchset modified according to various
comments.

I've folded patches 6, 7 and 8 into one driver API update patch that is
smaller than the three combined. Unfortunately, it's still very large.
I've also changed the introduction of ieee80211_wiphy, in fact the patch
doesn't introduce it at all it just moves some stuff into ieee80211_hw
and the operations out of it.

johannes


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


[PATCH][Generic netlink]: dont send empty operational attributes

2006-11-19 Thread jamal

This is probably 2.6.19 material (a little annoyance)
I am testing using a new mailer - if this patch doesnt look right let me know.

cheers,
jamal
-
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] fix IGMPV3_EXP() normalization bit shift value

2006-11-19 Thread David Miller
From: David Stevens <[EMAIL PROTECTED]>
Date: Thu, 16 Nov 2006 18:49:30 -0700

> The IGMPV3_EXP() macro doesn't correctly shift the normalization bit, so
> time-out values are longer than they should be. Patch below for viewing
> and attached for applying.
> 
> Thanks to Dirk Ooms for finding the problem in IGMPv3 - MLDv2 had a
> similar problem that was already fixed a year ago. :-(
> 
> +-DLS
> 
> Signed-off-by: David L Stevens <[EMAIL PROTECTED]>

Applied, and pushed to -stable.  Thanks David.
-
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] d80211: fix scan issues with new ops

2006-11-19 Thread Johannes Berg
On Sun, 2006-11-19 at 09:25 -0800, David Kimdon wrote:

> Perhaps that is a split that we do not need?  I don't see the problem
> that 'd80211: split ieee80211_hw' is solving.  I do see what it is
> doing, but maybe I am missing something . . .  

Oh, I just figured that on 64-bit systems the _ops part is something
like 264 bytes that we needlessly allocate for every device when in
reality it doesn't really change between cards for a single driver.

johannes


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


[Fwd: [Bug 7551] New: Fluctuating and slow network perfomance]

2006-11-19 Thread Stephen Hemminger


--- Begin Message ---
http://bugzilla.kernel.org/show_bug.cgi?id=7551

   Summary: Fluctuating and slow network perfomance
Kernel Version: 2.6.18.x
Status: NEW
  Severity: high
 Owner: [EMAIL PROTECTED]
 Submitter: [EMAIL PROTECTED]


Most recent kernel where this bug did *NOT* occur:
2.6.17.13

Distribution:
Crux

Hardware Environment:
Seem not dependence tested om Intel P4 PII and AMD Optron based. We use Intel or
3com NIC the problem seem to be the same regardels wich nic it runs through.

Software Environment:
Pure linux router with iptables or as filserver with samba.
Teste also on server with Apache and singel NIC, but same issue.

Problem Description:
Since 2.18.X it seem to be problem with the network performance.
This problem might have been for a while but it come more obvious now when I
updated the Main router. The trafik is now much slower even testing local
between to machines with same kernel version. 
I tested between mashine with older kernel with same network connection, this
show normal transfer speed and ping.

Steps to reproduce:
I have tested on non loaded local network.

THIS IS PART OF THE PROBLEM
Ping is flutuating, no other traffic to from the mashine during test. 
The test are made between two 2.6.18.3 servers.
664 octets from 192.168.117.254: icmp_seq=0 ttl=64 time=9.3 ms
64 octets from 192.168.117.254: icmp_seq=1 ttl=64 time=0.2 ms
64 octets from 192.168.117.254: icmp_seq=2 ttl=64 time=1.2 ms
64 octets from 192.168.117.254: icmp_seq=3 ttl=64 time=1.3 ms
64 octets from 192.168.117.254: icmp_seq=4 ttl=64 time=1.2 ms
64 octets from 192.168.117.254: icmp_seq=5 ttl=64 time=0.2 ms
64 octets from 192.168.117.254: icmp_seq=6 ttl=64 time=0.2 ms
64 octets from 192.168.117.254: icmp_seq=7 ttl=64 time=1.2 ms
64 octets from 192.168.117.254: icmp_seq=8 ttl=64 time=1.2 ms
64 octets from 192.168.117.254: icmp_seq=9 ttl=64 time=1.2 ms
64 octets from 192.168.117.254: icmp_seq=10 ttl=64 time=1.2 ms
64 octets from 192.168.117.254: icmp_seq=11 ttl=64 time=1.2 ms
64 octets from 192.168.117.254: icmp_seq=12 ttl=64 time=1.3 ms
64 octets from 192.168.117.254: icmp_seq=13 ttl=64 time=1.2 ms
64 octets from 192.168.117.254: icmp_seq=14 ttl=64 time=0.2 ms
64 octets from 192.168.117.254: icmp_seq=15 ttl=64 time=1.2 ms
64 octets from 192.168.117.254: icmp_seq=16 ttl=64 time=1.2 ms
64 octets from 192.168.117.254: icmp_seq=17 ttl=64 time=1.2 ms
64 octets from 192.168.117.254: icmp_seq=18 ttl=64 time=0.2 ms
64 octets from 192.168.117.254: icmp_seq=19 ttl=64 time=0.2 ms
64 octets from 192.168.117.254: icmp_seq=20 ttl=64 time=0.1 ms
64 octets from 192.168.117.254: icmp_seq=21 ttl=64 time=0.2 ms
64 octets from 192.168.117.254: icmp_seq=22 ttl=64 time=0.2 ms
64 octets from 192.168.117.254: icmp_seq=23 ttl=64 time=1.3 ms
64 octets from 192.168.117.254: icmp_seq=24 ttl=64 time=1.3 ms

This is between 2 2.6.17.13
This is very normal ping for our network.
64 octets from 192.168.117.229: icmp_seq=0 ttl=64 time=0.1 ms
64 octets from 192.168.117.229: icmp_seq=1 ttl=64 time=0.1 ms
64 octets from 192.168.117.229: icmp_seq=2 ttl=64 time=0.1 ms
64 octets from 192.168.117.229: icmp_seq=3 ttl=64 time=0.1 ms
64 octets from 192.168.117.229: icmp_seq=4 ttl=64 time=0.0 ms
64 octets from 192.168.117.229: icmp_seq=5 ttl=64 time=0.0 ms
64 octets from 192.168.117.229: icmp_seq=6 ttl=64 time=0.1 ms
64 octets from 192.168.117.229: icmp_seq=7 ttl=64 time=0.1 ms
64 octets from 192.168.117.229: icmp_seq=8 ttl=64 time=0.1 ms
64 octets from 192.168.117.229: icmp_seq=9 ttl=64 time=0.1 ms
64 octets from 192.168.117.229: icmp_seq=10 ttl=64 time=0.1 ms
64 octets from 192.168.117.229: icmp_seq=11 ttl=64 time=0.1 ms
64 octets from 192.168.117.229: icmp_seq=12 ttl=64 time=0.1 ms
64 octets from 192.168.117.229: icmp_seq=13 ttl=64 time=0.0 ms
64 octets from 192.168.117.229: icmp_seq=14 ttl=64 time=0.1 ms
64 octets from 192.168.117.229: icmp_seq=15 ttl=64 time=0.1 ms
64 octets from 192.168.117.229: icmp_seq=16 ttl=64 time=0.1 ms
64 octets from 192.168.117.229: icmp_seq=17 ttl=64 time=0.0 ms
64 octets from 192.168.117.229: icmp_seq=18 ttl=64 time=0.1 ms
64 octets from 192.168.117.229: icmp_seq=19 ttl=64 time=0.1 ms
64 octets from 192.168.117.229: icmp_seq=20 ttl=64 time=0.1 ms
64 octets from 192.168.117.229: icmp_seq=21 ttl=64 time=0.2 ms
64 octets from 192.168.117.229: icmp_seq=22 ttl=64 time=0.0 ms
64 octets from 192.168.117.229: icmp_seq=23 ttl=64 time=0.1 ms
64 octets from 192.168.117.229: icmp_seq=24 ttl=64 time=0.1 ms
64 octets from 192.168.117.229: icmp_seq=25 ttl=64 time=0.1 ms


COPY TEST:
Are general made between ramddisk
I have use both scp and other copy method, like SAMBA and NFS but the problem
are simmular, use the result from scp test.

TEST 1
This is between two server with kernel 2.6.17.13
scp [EMAIL PROTECTED]:/usr/src/linux-2.6.18.3.tar.bz2 /home/sysop
[EMAIL PROTECTED]'s password:
linux-2.6.18.3.tar.bz2 
  100%   40MB  13

Re: [PATCH] d80211: fix scan issues with new ops

2006-11-19 Thread David Kimdon
On Sun, Nov 19, 2006 at 05:57:39PM +0100, Johannes Berg wrote:
> On Sun, 2006-11-19 at 08:55 -0800, David Kimdon wrote:
> 
> > ok.  I am concerned that making this split between per driver and per
> > card is difficult to get right.  Setting or not setting a function
> > pointer for an operation is fairly standard practice and I don't see
> > the value in introducing yet another way to indicate support.
> 
> I guess we can punt this patch until some driver shows up that actually
> has some cards that need the function and some that don't. I'm actually
> guessing such a driver won't exist but wanted this for completeness in
> the split between _wiphy and _ops.

Perhaps that is a split that we do not need?  I don't see the problem
that 'd80211: split ieee80211_hw' is solving.  I do see what it is
doing, but maybe I am missing something . . .  

> 
> johannes


-
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


[BRIDGE] netlink: Convert bridge netlink code to new netlink interface

2006-11-19 Thread Thomas Graf
Removes dependency on buggy rta_buf, fixes a memory corruption bug due to
a unvalidated netlink attribute, and simplifies the code.

Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>

Index: net-2.6.20/net/bridge/br_netlink.c
===
--- net-2.6.20.orig/net/bridge/br_netlink.c 2006-11-19 17:41:03.0 
+0100
+++ net-2.6.20/net/bridge/br_netlink.c  2006-11-19 18:01:10.0 +0100
@@ -36,51 +36,43 @@
 {
const struct net_bridge *br = port->br;
const struct net_device *dev = port->dev;
-   struct ifinfomsg *r;
+   struct ifinfomsg *hdr;
struct nlmsghdr *nlh;
-   unsigned char *b = skb->tail;
-   u32 mtu = dev->mtu;
u8 operstate = netif_running(dev) ? dev->operstate : IF_OPER_DOWN;
-   u8 portstate = port->state;
 
pr_debug("br_fill_info event %d port %s master %s\n",
 event, dev->name, br->dev->name);
 
-   nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*r), flags);
-   r = NLMSG_DATA(nlh);
-   r->ifi_family = AF_BRIDGE;
-   r->__ifi_pad = 0;
-   r->ifi_type = dev->type;
-   r->ifi_index = dev->ifindex;
-   r->ifi_flags = dev_get_flags(dev);
-   r->ifi_change = 0;
-
-   RTA_PUT(skb, IFLA_IFNAME, strlen(dev->name)+1, dev->name);
-
-   RTA_PUT(skb, IFLA_MASTER, sizeof(int), &br->dev->ifindex);
+   nlh = nlmsg_put(skb, pid, seq, event, sizeof(*hdr), flags);
+   if (nlh == NULL)
+   return -ENOBUFS;
+
+   hdr = nlmsg_data(nlh);
+   hdr->ifi_family = AF_BRIDGE;
+   hdr->__ifi_pad = 0;
+   hdr->ifi_type = dev->type;
+   hdr->ifi_index = dev->ifindex;
+   hdr->ifi_flags = dev_get_flags(dev);
+   hdr->ifi_change = 0;
+
+   NLA_PUT_STRING(skb, IFLA_IFNAME, dev->name);
+   NLA_PUT_U32(skb, IFLA_MASTER, br->dev->ifindex);
+   NLA_PUT_U32(skb, IFLA_MTU, dev->mtu);
+   NLA_PUT_U8(skb, IFLA_OPERSTATE, operstate);
 
if (dev->addr_len)
-   RTA_PUT(skb, IFLA_ADDRESS, dev->addr_len, dev->dev_addr);
+   NLA_PUT(skb, IFLA_ADDRESS, dev->addr_len, dev->dev_addr);
 
-   RTA_PUT(skb, IFLA_MTU, sizeof(mtu), &mtu);
if (dev->ifindex != dev->iflink)
-   RTA_PUT(skb, IFLA_LINK, sizeof(int), &dev->iflink);
-
-
-   RTA_PUT(skb, IFLA_OPERSTATE, sizeof(operstate), &operstate);
+   NLA_PUT_U32(skb, IFLA_LINK, dev->iflink);
 
if (event == RTM_NEWLINK)
-   RTA_PUT(skb, IFLA_PROTINFO, sizeof(portstate), &portstate);
-
-   nlh->nlmsg_len = skb->tail - b;
-
-   return skb->len;
+   NLA_PUT_U8(skb, IFLA_PROTINFO, port->state);
 
-nlmsg_failure:
-rtattr_failure:
+   return nlmsg_end(skb, nlh);
 
-   skb_trim(skb, b - skb->data);
-   return -EINVAL;
+nla_put_failure:
+   return nlmsg_cancel(skb, nlh);
 }
 
 /*
@@ -113,25 +105,18 @@
 {
struct net_device *dev;
int idx;
-   int s_idx = cb->args[0];
-   int err = 0;
 
read_lock(&dev_base_lock);
for (dev = dev_base, idx = 0; dev; dev = dev->next) {
-   struct net_bridge_port *p = dev->br_port;
-
/* not a bridge port */
-   if (!p)
-   continue;
-
-   if (idx < s_idx)
-   goto cont;
+   if (dev->br_port == NULL || idx < cb->args[0])
+   goto skip;
 
-   err = br_fill_ifinfo(skb, p, NETLINK_CB(cb->skb).pid,
-cb->nlh->nlmsg_seq, RTM_NEWLINK, 
NLM_F_MULTI);
-   if (err <= 0)
+   if (br_fill_ifinfo(skb, dev->br_port, NETLINK_CB(cb->skb).pid,
+  cb->nlh->nlmsg_seq, RTM_NEWLINK,
+  NLM_F_MULTI) < 0)
break;
-cont:
+skip:
++idx;
}
read_unlock(&dev_base_lock);
@@ -147,26 +132,27 @@
  */
 static int br_rtm_setlink(struct sk_buff *skb,  struct nlmsghdr *nlh, void 
*arg)
 {
-   struct rtattr  **rta = arg;
-   struct ifinfomsg *ifm = NLMSG_DATA(nlh);
+   struct ifinfomsg *ifm;
+   struct nlattr *protinfo;
struct net_device *dev;
struct net_bridge_port *p;
u8 new_state;
 
+   if (nlmsg_len(nlh) < sizeof(*ifm))
+   return -EINVAL;
+
+   ifm = nlmsg_data(nlh);
if (ifm->ifi_family != AF_BRIDGE)
return -EPFNOSUPPORT;
 
-   /* Must pass valid state as PROTINFO */
-   if (rta[IFLA_PROTINFO-1]) {
-   u8 *pstate = RTA_DATA(rta[IFLA_PROTINFO-1]);
-   new_state = *pstate;
-   } else
+   protinfo = nlmsg_find_attr(nlh, sizeof(*ifm), IFLA_PROTINFO);
+   if (!protinfo || nla_len(protinfo) < sizeof(u8))
return -EINVAL;
 
+   new_state = nla_get_u8(protinfo);
if (new_state > BR_STATE_BLOCKING)
return -EINVAL;
 
-   /* Find bridge port */
   

Re: [PATCH] d80211: fix scan issues with new ops

2006-11-19 Thread Johannes Berg
On Sun, 2006-11-19 at 08:55 -0800, David Kimdon wrote:

> ok.  I am concerned that making this split between per driver and per
> card is difficult to get right.  Setting or not setting a function
> pointer for an operation is fairly standard practice and I don't see
> the value in introducing yet another way to indicate support.

I guess we can punt this patch until some driver shows up that actually
has some cards that need the function and some that don't. I'm actually
guessing such a driver won't exist but wanted this for completeness in
the split between _wiphy and _ops.

johannes


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


Re: [PATCH] d80211: fix scan issues with new ops

2006-11-19 Thread David Kimdon
On Sun, Nov 19, 2006 at 05:34:49PM +0100, Johannes Berg wrote:
> On Sun, 2006-11-19 at 07:56 -0800, David Kimdon wrote:
> 
> > What is wrong with the driver setting the function pointer to NULL for
> > the cards that do not support scanning?  Where does this requirment
> > come from that the function pointers in struct ieee80211_wiphy be
> > identical for all cards?
> 
> Well I want to allow drivers to make assign the 33 function pointers in
> a static structure, and differences between cards must then be handled
> in the non-static part.

ok.  I am concerned that making this split between per driver and per
card is difficult to get right.  Setting or not setting a function
pointer for an operation is fairly standard practice and I don't see
the value in introducing yet another way to indicate support.

-David
-
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] d80211: fix scan issues with new ops

2006-11-19 Thread Johannes Berg
On Sun, 2006-11-19 at 17:34 +0100, Johannes Berg wrote:

> Well I want to allow drivers to make assign the 33 function pointers in
> a static structure, and differences between cards must then be handled
> in the non-static part.

Uh, that didn't come out too well.

The point is that ieee80211_ops can be static after these changes which
is a whopping 33 function pointers or so :)

And only at the expense of having a few new flags.

johannes


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


Re: [PATCH 4/10] d80211: reduce mdev usage, fix ieee80211_rx_mgmt

2006-11-19 Thread Johannes Berg

> > +   /* if no one will get it anyway, don't even allocate it.
> > +* unlikely because this is only relevant for APs
> > +* where the device must be open... */
> > +   if (unlikely(!local->apdev))
> > +   return;
> 
> Why not just let it Oops and show the bug?  In what cases is it ok
> for apdev to not be set?

> Can we get whitespace changes like this in a separate patch?

Sure. I'll just remove it from this patch for now.

> again, so should we just let the Oops happen?

I'm thinking there might be race conditions where userspace does
something, then drops the ap device but after that some operations
complete and would lead to the oops too. Wasn't really sure.

johannes


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


Re: [PATCH] d80211: fix scan issues with new ops

2006-11-19 Thread Johannes Berg
On Sun, 2006-11-19 at 17:15 +0100, Michael Buesch wrote:

> > -   if (local->ops->hw_scan) {
> > +   if (local->ops->hw_scan && local->wiphy.flags & IEEE80211_HW_SCAN) {
> 
> Please wrap this into ()

Good point :)

johannes


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


Re: [PATCH] d80211: fix scan issues with new ops

2006-11-19 Thread Johannes Berg
On Sun, 2006-11-19 at 07:56 -0800, David Kimdon wrote:

> What is wrong with the driver setting the function pointer to NULL for
> the cards that do not support scanning?  Where does this requirment
> come from that the function pointers in struct ieee80211_wiphy be
> identical for all cards?

Well I want to allow drivers to make assign the 33 function pointers in
a static structure, and differences between cards must then be handled
in the non-static part.

johannes


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


Re: [PATCH 4/10] d80211: reduce mdev usage, fix ieee80211_rx_mgmt

2006-11-19 Thread David Kimdon
Reply-To: 
In-Reply-To: <[EMAIL PROTECTED]>


> 
> --- wireless-dev.orig/net/d80211/ieee80211.c  2006-11-17 20:01:54.999703408 
> +0100
> +++ wireless-dev/net/d80211/ieee80211.c   2006-11-17 20:01:55.659703408 
> +0100
> @@ -210,9 +210,16 @@ static void ieee80211_key_threshold_noti
>  struct ieee80211_key *key,
>  struct sta_info *sta)
>  {
> + struct ieee80211_local *local = dev->ieee80211_ptr;
>   struct sk_buff *skb;
>   struct ieee80211_msg_key_notification *msg;
>  
> + /* if no one will get it anyway, don't even allocate it.
> +  * unlikely because this is only relevant for APs
> +  * where the device must be open... */
> + if (unlikely(!local->apdev))
> + return;

Why not just let it Oops and show the bug?  In what cases is it ok
for apdev to not be set?

>   skb = dev_alloc_skb(sizeof(struct ieee80211_frame_info) +
>   sizeof(struct ieee80211_msg_key_notification));
>   if (!skb)


Can we get whitespace changes like this in a separate patch?

>  
> -jiffies_to_timespec(status->hosttime, &ts);
> + jiffies_to_timespec(status->hosttime, &ts);
>   fi->hosttime = cpu_to_be64((u64) ts.tv_sec * 100 +
>  ts.tv_nsec / 1000);
>   fi->mactime = cpu_to_be64(status->mactime);
>   switch (status->phymode) {
> -case MODE_IEEE80211A:
> -fi->phytype = htonl(ieee80211_phytype_ofdm_dot11_a);
> -break;
> -case MODE_IEEE80211B:
> -fi->phytype = htonl(ieee80211_phytype_dsss_dot11_b);
> -break;
> -case MODE_IEEE80211G:
> -fi->phytype = htonl(ieee80211_phytype_pbcc_dot11_g);
> -break;
> -case MODE_ATHEROS_TURBO:
> + case MODE_IEEE80211A:
> + fi->phytype = htonl(ieee80211_phytype_ofdm_dot11_a);
> + break;
> + case MODE_IEEE80211B:
> + fi->phytype = htonl(ieee80211_phytype_dsss_dot11_b);
> + break;
> + case MODE_IEEE80211G:
> + fi->phytype = htonl(ieee80211_phytype_pbcc_dot11_g);
> + break;
> + case MODE_ATHEROS_TURBO:
>   fi->phytype =
>   htonl(ieee80211_phytype_dsss_dot11_turbo);
>  break;
>  default:
> -fi->phytype = 0x;
> + fi->phytype = 0x;
>   break;
> -}
> -fi->channel = htonl(status->channel);
> + }
> + fi->channel = htonl(status->channel);


. . . 


>  int ieee80211_set_aid_for_sta(struct net_device *dev, u8 *peer_address,
> u16 aid)
>  {
> + struct ieee80211_local *local = dev->ieee80211_ptr;
>   struct sk_buff *skb;
>   struct ieee80211_msg_set_aid_for_sta *msg;
>  
> + /* unlikely because if this event only happens for APs,
> +  * which require an open ap device. */
> + if (unlikely(!local->apdev))
> + return 0;

again, so should we just let the Oops happen?

-David
-
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] d80211: remove IEEE80211_CONF_SW_{EN,DE}CRYPT

2006-11-19 Thread Michael Buesch
On Sunday 19 November 2006 00:53, Johannes Berg wrote:
> There's no point in trying to tell a driver globally whether sw or hw
> crypto is used, if it's sw then we just don't give it keys...
> 
> Besides, these weren't ever used!
> Remove IEEE80211_CONF_SW_DECRYPT and IEEE80211_CONF_SW_ENCRYPT.
> 
> Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>

Acked-by: Michael Buesch <[EMAIL PROTECTED]>

These two conf options are really useless. So yes, please remove them.

> ---
> Some more absolutely useless code in d80211
> 
> Patch applies after the other ones, it's now number 13 in my series.
> 
>  include/net/d80211.h |6 ++
>  net/d80211/ieee80211.c   |9 +++--
>  net/d80211/ieee80211_ioctl.c |4 +---
>  net/d80211/wpa.c |   27 +++
>  4 files changed, 13 insertions(+), 33 deletions(-)
> 
> --- wireless-dev.orig/include/net/d80211.h2006-11-19 00:41:30.489520302 
> +0100
> +++ wireless-dev/include/net/d80211.h 2006-11-19 00:41:46.509520302 +0100
> @@ -244,11 +244,9 @@ struct ieee80211_conf {
>  
>  int beacon_int;
>  
> -#define IEEE80211_CONF_SW_ENCRYPT(1<<0)
> -#define IEEE80211_CONF_SW_DECRYPT(1<<1)
> -#define IEEE80211_CONF_SHORT_SLOT_TIME   (1<<2) /* use IEEE 802.11g 
> Short Slot
> +#define IEEE80211_CONF_SHORT_SLOT_TIME   (1<<0) /* use IEEE 802.11g 
> Short Slot
>   * Time */
> -#define IEEE80211_CONF_SSID_HIDDEN   (1<<3) /* do not broadcast the ssid */
> +#define IEEE80211_CONF_SSID_HIDDEN   (1<<1) /* do not broadcast the ssid */
>   u32 flags;  /* configuration flags defined above */
>  
>  u8 power_level;  /* transmit power limit for 
> current
> --- wireless-dev.orig/net/d80211/ieee80211.c  2006-11-19 00:12:10.719520302 
> +0100
> +++ wireless-dev/net/d80211/ieee80211.c   2006-11-19 00:43:28.799520302 
> +0100
> @@ -516,8 +516,7 @@ ieee80211_tx_h_fragment(struct ieee80211
>  
>  static int wep_encrypt_skb(struct ieee80211_txrx_data *tx, struct sk_buff 
> *skb)
>  {
> - if (tx->key->force_sw_encrypt ||
> - (tx->local->wiphy.conf.flags & IEEE80211_CONF_SW_ENCRYPT)) {
> + if (tx->key->force_sw_encrypt) {
>   if (ieee80211_wep_encrypt(tx->local, skb, tx->key))
>   return -1;
>   } else {
> @@ -3268,8 +3267,7 @@ ieee80211_rx_h_wep_weak_iv_detection(str
>  
>   /* Check for weak IVs, if hwaccel did not remove IV from the frame */
>   if ((rx->local->wiphy.flags & IEEE80211_HW_WEP_INCLUDE_IV) ||
> - rx->key->force_sw_encrypt ||
> - (rx->local->wiphy.conf.flags & IEEE80211_CONF_SW_ENCRYPT)) {
> + rx->key->force_sw_encrypt) {
>   u8 *iv = ieee80211_wep_is_weak_iv(rx->skb, rx->key);
>   if (iv) {
>   rx->sta->wep_weak_iv_count++;
> @@ -3301,8 +3299,7 @@ ieee80211_rx_h_wep_decrypt(struct ieee80
>   }
>  
>   if (!(rx->u.rx.status->flag & RX_FLAG_DECRYPTED) ||
> - rx->key->force_sw_encrypt ||
> - (rx->local->wiphy.conf.flags & IEEE80211_CONF_SW_DECRYPT)) {
> + rx->key->force_sw_encrypt) {
>   if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key)) {
>   printk(KERN_DEBUG "%s: RX WEP frame, decrypt "
>  "failed\n", rx->dev->name);
> --- wireless-dev.orig/net/d80211/ieee80211_ioctl.c2006-11-19 
> 00:12:11.339520302 +0100
> +++ wireless-dev/net/d80211/ieee80211_ioctl.c 2006-11-19 00:42:58.779520302 
> +0100
> @@ -492,9 +492,7 @@ int ieee80211_set_hw_encryption(struct n
>   key->force_sw_encrypt = 1;
>  
>   if (key && local->ops->set_key &&
> - (!(local->wiphy.conf.flags & IEEE80211_CONF_SW_ENCRYPT) ||
> -  !(local->wiphy.conf.flags & IEEE80211_CONF_SW_DECRYPT)) &&
> - (keyconf = ieee80211_key_data2conf(local, key)) != NULL) {
> + (keyconf = ieee80211_key_data2conf(local, key))) {
>   if (local->ops->set_key(local_to_wiphy(local), SET_KEY, addr,
>  keyconf, sta ? sta->aid : 0)) {
>   rc = HOSTAP_CRYPT_ERR_KEY_SET_FAILED;
> --- wireless-dev.orig/net/d80211/wpa.c2006-11-19 00:12:13.019520302 
> +0100
> +++ wireless-dev/net/d80211/wpa.c 2006-11-19 00:45:16.999520302 +0100
> @@ -104,7 +104,6 @@ ieee80211_tx_h_michael_mic_add(struct ie
>  #endif /* CONFIG_HOSTAPD_WPA_TESTING */
>  
>   if (!tx->key->force_sw_encrypt &&
> - !(tx->local->wiphy.conf.flags & IEEE80211_CONF_SW_DECRYPT) &&
>   !tx->fragmented &&
>   !(tx->local->wiphy.flags & IEEE80211_HW_TKIP_INCLUDE_MMIC) &&
>   !wpa_test) {
> @@ -186,8 +185,7 @@ ieee80211_rx_h_michael_mic_verify(struct
>  #endif /* CONFIG_HOSTAPD_WPA_TESTING */
>  
>   if ((rx->u.rx.status->flag & RX_FLAG_DECRYPTED) &&
> - !rx->key->force_sw_encrypt &&
> - !(rx->local->wiphy.conf.flags & IEEE8021

Re: [PATCH] d80211: fix scan issues with new ops

2006-11-19 Thread Michael Buesch
On Sunday 19 November 2006 01:21, Johannes Berg wrote:
> If hardware shall do scanning, the hw_scan operation must be set. However,
> if the driver is for multiple cards that may or may not do hardware
> scanning, it'll need a flag.
> 
> Similar issues arise with passive_scan().
> 
> This patch introduces flags to fix these issues.
> 
> Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>
> 
> ---
> more fallout from my earlier patches... this time it's the scanning ops
> that were still used as flags as well as ops.
> 
> --- wireless-dev.orig/include/net/d80211.h2006-11-19 01:08:12.439520302 
> +0100
> +++ wireless-dev/include/net/d80211.h 2006-11-19 01:14:14.859520302 +0100
> @@ -504,6 +504,12 @@ struct ieee80211_wiphy {
>   /* do hardware fragmentation */
>  #define IEEE80211_HW_FRAG (1<<15)
>  
> + /* hardware does scanning instead of software */
> +#define IEEE80211_HW_PASSIVE_SCAN (1<<16)
> +
> + /* hardware does scanning instead of software */
> +#define IEEE80211_HW_SCAN (1<<17)
> +
>   u32 flags;  /* hardware flags defined above */
>  
>   /* Set to the size of a needed device specific skb headroom for TX 
> skbs. */
> @@ -627,7 +633,8 @@ struct ieee80211_ops {
>  struct ieee80211_scan_conf *conf);
>  
>   /* Ask the hardware to service the scan request, no need to start
> -  * the scan state machine in stack. */
> +  * the scan state machine in stack.
> +  * This callback goes along with the IEEE80211_HW_SCAN flag */
>   int (*hw_scan)(struct ieee80211_wiphy *wiphy, u8 *ssid,
>  size_t len);
>  
> --- wireless-dev.orig/net/d80211/ieee80211_sta.c  2006-11-19 
> 01:07:49.509520302 +0100
> +++ wireless-dev/net/d80211/ieee80211_sta.c   2006-11-19 01:18:49.879520302 
> +0100
> @@ -2552,7 +2552,7 @@ int ieee80211_sta_req_scan(struct net_de
>  
>   printk(KERN_DEBUG "%s: starting scan\n", dev->name);
>  
> - if (local->ops->hw_scan) {
> + if (local->ops->hw_scan && local->wiphy.flags & IEEE80211_HW_SCAN) {

Please wrap this into ()

(Hm, actually, the compiler should complain on this...)

>   int rc = local->ops->hw_scan(local_to_wiphy(local),
>   ssid, ssid_len);
>   if (!rc) {
> --- wireless-dev.orig/net/d80211/ieee80211_scan.c 2006-11-19 
> 01:18:19.249520302 +0100
> +++ wireless-dev/net/d80211/ieee80211_scan.c  2006-11-19 01:18:22.599520302 
> +0100
> @@ -114,7 +114,8 @@ static void ieee80211_scan_start(struct 
>   struct ieee80211_channel *chan = NULL;
>   int ret;
>  
> - if (!local->hw->passive_scan) {
> + if (!local->ops->passive_scan ||
> + !(local->wiphy.flags & IEEE80211_HW_PASSIVE_SCAN)) {
>   printk(KERN_DEBUG "%s: Scan handler called, yet the hardware "
>  "does not support passive scanning. Disabled.\n",
>  local->mdev->name);
> 
> 
> 

-- 
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: bcm43xx regression 2.6.19rc3 -> rc5, rtnl_lock trouble?

2006-11-19 Thread Michael Buesch
On Saturday 18 November 2006 20:02, Larry Finger wrote:
> Ray Lee wrote:
> > Larry Finger wrote:
> >> Johannes Berg wrote:
> >>> Hah, that's a lot more plausible than bcm43xx's drain patch actually
> >>> causing this. So maybe somehow interrupts for bcm43xx aren't routed
> >>> properly or something...
> >>>
> >>> Ray, please check /proc/interrupts when this happens.
> > 
> > When it happens, I can't. The keyboard is entirely dead (I'm in X, perhaps 
> > at
> > a console it would be okay). The only thing that works is magic SysRq. even
> > ctrl-alt-f1 to get to a console doesn't work.
> > 
> > That said, /proc/interrupts doesn't show MSI routed things on my AMD64 
> > laptop.
> > 
> >>> I am convinced that the patch in question (drain tx status) is not
> >>> causing this -- the patch should be a no-op in most cases anyway, and in
> >>> those cases where it isn't a no-op it'll run only once at card init and
> >>> remove some things from a hardware-internal FIFO.
> > 
> > Okay, I can buy that.
> > 
> >> I agree that drain tx status should not cause the problem.
> >>
> >> Ray, does -rc6 solve your problem as it did for Joseph?
> > 
> > I can't get it to repeat other than the first two times. However, I
> > accidentally stopped NetworkManager from handling my wireless a few days 
> > ago,
> > and haven't restarted it, so that may play into this.
> > 
> > Humor me one last time, I beg. Did you look at the messages file I posted? 
> > (Or
> > maybe I didn't include this second bit... Damn, I need to be more careful 
> > with
> > cutting and pasting...)
> 
> The locking stuff wasn't in any of the messages that I received.
> 
> > The second sysrq-t shows locking stuff going on, can you tell me if it looks
> > reasonable? It still seems to me that something acquiring and not releasing
> > rtnl_lock explains what I was seeing (rtnl lock is implicated in both 
> > sysrq-t
> > backtraces). I don't know if that thing is bcm43xx, though.
> > 
> > Is this part reasonable?:
> >  1 lock held by events/0/4:
> >   #0:  (&bcm->mutex){--..}, at: [mutex_lock+9/16] mutex_lock+0x9/0x10
> >  2 locks held by NetworkManager/4837:
> >   #0:  (rtnl_mutex){--..}, at: [mutex_lock+9/16] mutex_lock+0x9/0x10
> >   #1:  (&bcm->mutex){--..}, at: [mutex_lock+9/16] mutex_lock+0x9/0x10
> >  1 lock held by wpa_supplicant/5953:
> >   #0:  (rtnl_mutex){--..}, at: [mutex_lock+9/16] mutex_lock+0x9/0x10
> 
> I'm not an expert on locking, but it certainly looks as if bcm43xx and 
> wpa_supplicant are OK by 
> themselves, but that NetworkManager interferes. This behavior matches what I 
> see - I don't have 
> NetworkManager on my system, but I do use wpa_supplicant, with no lockups. Of 
> course, I have i386 
> architecture.
> 
> Although NetworkManager may be the catalyst to trigger the bug, I doubt that 
> it is the cause. 
> Strictly as a guess, I would suspect that the locking problem is in SoftMAC, 
> where we know there can 
> be locking difficulties, but no one is fixing them because EOL is near for 
> that component.

Well, this is different. The (known) locking problems are of type "missing 
locking".
But this seems to be a deadlock or something, so clearly a bug that
must be fixed. Even in softmac.
I don't know yet how this can happen, though.

-- 
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] d80211: fix scan issues with new ops

2006-11-19 Thread David Kimdon
On Sun, Nov 19, 2006 at 01:21:13AM +0100, Johannes Berg wrote:
> If hardware shall do scanning, the hw_scan operation must be set. However,
> if the driver is for multiple cards that may or may not do hardware
> scanning, it'll need a flag.

What is wrong with the driver setting the function pointer to NULL for
the cards that do not support scanning?  Where does this requirment
come from that the function pointers in struct ieee80211_wiphy be
identical for all cards?

-David
-
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


TULIP_MWI fix for Cobalt

2006-11-19 Thread Martin Michlmayr
Please consider the patch below.  The original consensus was that
since this is documented in the errata it should be done by default
rather than as a config option.  I think the original author of the
patch doesn't have time to submit a revised version but now that
there's a new maintainer of the Tulip code maybe there's hope to get
this in some way.

This patch is being used in the Debian MIPS kernels and fixes a real
bug.


From: Peter Horton <[EMAIL PROTECTED]>

This patch works around the MWI bug on the DC21143 rev 65 Tulip by ensuring
that the receive buffers don't end on a cache line boundary (as documented
in the errata).

This patch is required for the MIPs based Cobalt Qube/RaQ as supporting the
extra PCI commands seems to reduce the chance of a hard lockup between the
Tulip and the PCI bridge.

--- linux.git.orig/drivers/net/tulip/tulip_core.c   2006-01-29 
21:43:40.0 +
+++ linux.git/drivers/net/tulip/tulip_core.c2006-01-29 21:56:50.0 
+
@@ -294,6 +294,8 @@
if (tp->mii_cnt  ||  (tp->mtable  &&  tp->mtable->has_mii))
iowrite32(0x0004, ioaddr + CSR6);
 
+   printk(KERN_DEBUG "%s: CSR0 %08x\n", dev->name, tp->csr0);
+
/* Reset the chip, holding bit 0 set at least 50 PCI cycles. */
iowrite32(0x0001, ioaddr + CSR0);
udelay(100);
@@ -1155,8 +1157,10 @@
/* if we have any cache line size at all, we can do MRM */
csr0 |= MRM;
 
+#ifndef CONFIG_TULIP_MWI_DC21143
/* ...and barring hardware bugs, MWI */
if (!(tp->chip_id == DC21143 && tp->revision == 65))
+#endif
csr0 |= MWI;
 
/* set or disable MWI in the standard PCI command bit.
@@ -1182,7 +1186,7 @@
 */
switch (cache) {
case 8:
-   csr0 |= MRL | (1 << CALShift) | (16 << BurstLenShift);
+   csr0 |= MRL | (1 << CALShift) | (8 << BurstLenShift);
break;
case 16:
csr0 |= MRL | (2 << CALShift) | (16 << BurstLenShift);
Index: linux.git/drivers/net/tulip/tulip.h
===
--- linux.git.orig/drivers/net/tulip/tulip.h2006-01-29 21:43:40.0 
+
+++ linux.git/drivers/net/tulip/tulip.h 2006-01-29 21:52:01.0 +
@@ -262,7 +262,15 @@
 #define RX_RING_SIZE   128 
 #define MEDIA_MASK 31
 
-#define PKT_BUF_SZ 1536/* Size of each temporary Rx buffer. */
+/* MWI can fail on 21143 rev 65 if the receive buffer ends
+   on a cache line boundary. Ensure it doesn't ...
+*/
+
+#ifdef CONFIG_TULIP_MWI_DC21143
+#define PKT_BUF_SZ (1536 + 4)  /* Size of each temporary Rx 
buffer. */
+#else
+#define PKT_BUF_SZ 1536/* Size of each temporary Rx 
buffer. */
+#endif
 
 #define TULIP_MIN_CACHE_LINE   8   /* in units of 32-bit words */
 
Index: linux.git/drivers/net/tulip/Kconfig
===
--- linux.git.orig/drivers/net/tulip/Kconfig2006-01-29 21:48:09.0 
+
+++ linux.git/drivers/net/tulip/Kconfig 2006-01-29 21:50:28.0 +
@@ -57,6 +57,16 @@
 
  If unsure, say N.
 
+config TULIP_MWI_DC21143
+   bool "Enable MWI workaround on dc21143 controllers"
+   depends on TULIP_MWI
+   help
+ This enables a workaround for MWI ("New bus configuration") on DC21143
+ controllers.  Normally MWI is disabled on these chips because of
+ hardware errata.
+
+ If unsure, say N.
+
 config TULIP_MMIO
bool "Use PCI shared mem for NIC registers"
depends on TULIP


-- 
Martin Michlmayr
http://www.cyrius.com/
-
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: [RFC: 2.6 patch] remove broken net drivers

2006-11-19 Thread Geert Uytterhoeven
On Sat, 18 Nov 2006, Adrian Bunk wrote:
> This patch removes net drivers that:
> - had already been marked as BROKEN in 2.6.0 three years ago and
> - are still marked as BROKEN.
> 
> These are the following drivers:
> - MAC89x0

I still have a patch lying around for this one:

http://linux-m68k-cvs.ubb.ca/~geert/linux-m68k-2.6.x-merging/POSTPONED/357-mac89x0.diff

I don't remember 100% why I put it in my POSTPONED queue. Maybe because it was
rejected upstream?

If it's OK (it compiles fine with 2.6.19-rc5), please tell me, and I'll
resubmit it.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [EMAIL PROTECTED]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
-
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