Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (22 commits)
  tun: Multicast handling in tun_chr_ioctl() needs proper locking.
  [NET]: Fix heavy stack usage in seq_file output routines.
  [AF_UNIX] Initialise UNIX sockets before general device initcalls
  [RTNETLINK]: Fix bogus ASSERT_RTNL warning
  iwlwifi: Fix built-in compilation of iwlcore (part 2)
  tun: Fix minor race in TUNSETLINK ioctl handling.
  ppp_generic: use stats from net_device structure
  iwlwifi: Don't unlock priv->mutex if it isn't locked
  wireless: rndis_wlan: modparam_workaround_interval is never below 0.
  prism54: prism54_get_encode() test below 0 on unsigned index
  mac80211: update mesh EID values
  b43: Workaround DMA quirks
  mac80211: fix use before check of Qdisc length
  net/mac80211/rx.c: fix off-by-one
  mac80211: Fix race between ieee80211_rx_bss_put and lookup routines.
  ath5k: Fix radio identification on AR5424/2424
  ssb: Fix all-ones boardflags
  b43: Add more btcoexist workarounds
  b43: Fix HostFlags data types
  b43: Workaround invalid bluetooth settings
  ...
  • Loading branch information
Linus Torvalds committed Apr 24, 2008
2 parents e270b51 + 9edb74c commit d02aacf
Show file tree
Hide file tree
Showing 26 changed files with 237 additions and 124 deletions.
6 changes: 2 additions & 4 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2558,12 +2558,10 @@ W: http://www.tazenda.demon.co.uk/phil/linux-hp
S: Maintained

MAC80211
P: Michael Wu
M: flamingice@sourmilk.net
P: Johannes Berg
M: johannes@sipsolutions.net
P: Jiri Benc
M: jbenc@suse.cz
P: Michael Wu
M: flamingice@sourmilk.net
L: linux-wireless@vger.kernel.org
W: http://linuxwireless.org/
T: git kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6.git
Expand Down
48 changes: 19 additions & 29 deletions drivers/net/ppp_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ struct ppp {
u32 minseq; /* MP: min of most recent seqnos */
struct sk_buff_head mrq; /* MP: receive reconstruction queue */
#endif /* CONFIG_PPP_MULTILINK */
struct net_device_stats stats; /* statistics */
#ifdef CONFIG_PPP_FILTER
struct sock_filter *pass_filter; /* filter for packets to pass */
struct sock_filter *active_filter;/* filter for pkts to reset idle */
Expand Down Expand Up @@ -914,18 +913,10 @@ ppp_start_xmit(struct sk_buff *skb, struct net_device *dev)

outf:
kfree_skb(skb);
++ppp->stats.tx_dropped;
++ppp->dev->stats.tx_dropped;
return 0;
}

static struct net_device_stats *
ppp_net_stats(struct net_device *dev)
{
struct ppp *ppp = (struct ppp *) dev->priv;

return &ppp->stats;
}

static int
ppp_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
Expand Down Expand Up @@ -1095,8 +1086,8 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
#endif /* CONFIG_PPP_FILTER */
}

++ppp->stats.tx_packets;
ppp->stats.tx_bytes += skb->len - 2;
++ppp->dev->stats.tx_packets;
ppp->dev->stats.tx_bytes += skb->len - 2;

switch (proto) {
case PPP_IP:
Expand Down Expand Up @@ -1171,7 +1162,7 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
drop:
if (skb)
kfree_skb(skb);
++ppp->stats.tx_errors;
++ppp->dev->stats.tx_errors;
}

/*
Expand Down Expand Up @@ -1409,7 +1400,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
spin_unlock_bh(&pch->downl);
if (ppp->debug & 1)
printk(KERN_ERR "PPP: no memory (fragment)\n");
++ppp->stats.tx_errors;
++ppp->dev->stats.tx_errors;
++ppp->nxseq;
return 1; /* abandon the frame */
}
Expand Down Expand Up @@ -1538,7 +1529,7 @@ ppp_receive_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)

if (skb->len > 0)
/* note: a 0-length skb is used as an error indication */
++ppp->stats.rx_length_errors;
++ppp->dev->stats.rx_length_errors;

kfree_skb(skb);
ppp_receive_error(ppp);
Expand All @@ -1547,7 +1538,7 @@ ppp_receive_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
static void
ppp_receive_error(struct ppp *ppp)
{
++ppp->stats.rx_errors;
++ppp->dev->stats.rx_errors;
if (ppp->vj)
slhc_toss(ppp->vj);
}
Expand Down Expand Up @@ -1627,8 +1618,8 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
break;
}

++ppp->stats.rx_packets;
ppp->stats.rx_bytes += skb->len - 2;
++ppp->dev->stats.rx_packets;
ppp->dev->stats.rx_bytes += skb->len - 2;

npi = proto_to_npindex(proto);
if (npi < 0) {
Expand Down Expand Up @@ -1806,7 +1797,7 @@ ppp_receive_mp_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
*/
if (seq_before(seq, ppp->nextseq)) {
kfree_skb(skb);
++ppp->stats.rx_dropped;
++ppp->dev->stats.rx_dropped;
ppp_receive_error(ppp);
return;
}
Expand Down Expand Up @@ -1928,7 +1919,7 @@ ppp_mp_reconstruct(struct ppp *ppp)
/* Got a complete packet yet? */
if (lost == 0 && (p->BEbits & E) && (head->BEbits & B)) {
if (len > ppp->mrru + 2) {
++ppp->stats.rx_length_errors;
++ppp->dev->stats.rx_length_errors;
printk(KERN_DEBUG "PPP: reconstructed packet"
" is too long (%d)\n", len);
} else if (p == head) {
Expand All @@ -1937,7 +1928,7 @@ ppp_mp_reconstruct(struct ppp *ppp)
skb = skb_get(p);
break;
} else if ((skb = dev_alloc_skb(len)) == NULL) {
++ppp->stats.rx_missed_errors;
++ppp->dev->stats.rx_missed_errors;
printk(KERN_DEBUG "PPP: no memory for "
"reconstructed packet");
} else {
Expand Down Expand Up @@ -1966,7 +1957,7 @@ ppp_mp_reconstruct(struct ppp *ppp)
if (ppp->debug & 1)
printk(KERN_DEBUG " missed pkts %u..%u\n",
ppp->nextseq, head->sequence-1);
++ppp->stats.rx_dropped;
++ppp->dev->stats.rx_dropped;
ppp_receive_error(ppp);
}

Expand Down Expand Up @@ -2377,12 +2368,12 @@ ppp_get_stats(struct ppp *ppp, struct ppp_stats *st)
struct slcompress *vj = ppp->vj;

memset(st, 0, sizeof(*st));
st->p.ppp_ipackets = ppp->stats.rx_packets;
st->p.ppp_ierrors = ppp->stats.rx_errors;
st->p.ppp_ibytes = ppp->stats.rx_bytes;
st->p.ppp_opackets = ppp->stats.tx_packets;
st->p.ppp_oerrors = ppp->stats.tx_errors;
st->p.ppp_obytes = ppp->stats.tx_bytes;
st->p.ppp_ipackets = ppp->dev->stats.rx_packets;
st->p.ppp_ierrors = ppp->dev->stats.rx_errors;
st->p.ppp_ibytes = ppp->dev->stats.rx_bytes;
st->p.ppp_opackets = ppp->dev->stats.tx_packets;
st->p.ppp_oerrors = ppp->dev->stats.tx_errors;
st->p.ppp_obytes = ppp->dev->stats.tx_bytes;
if (!vj)
return;
st->vj.vjs_packets = vj->sls_o_compressed + vj->sls_o_uncompressed;
Expand Down Expand Up @@ -2436,7 +2427,6 @@ ppp_create_interface(int unit, int *retp)
dev->priv = ppp;

dev->hard_start_xmit = ppp_start_xmit;
dev->get_stats = ppp_net_stats;
dev->do_ioctl = ppp_net_ioctl;

ret = -EEXIST;
Expand Down
21 changes: 19 additions & 2 deletions drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,16 +668,23 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
break;

case TUNSETLINK:
{
int ret;

/* Only allow setting the type when the interface is down */
rtnl_lock();
if (tun->dev->flags & IFF_UP) {
DBG(KERN_INFO "%s: Linktype set failed because interface is up\n",
tun->dev->name);
return -EBUSY;
ret = -EBUSY;
} else {
tun->dev->type = (int) arg;
DBG(KERN_INFO "%s: linktype set to %d\n", tun->dev->name, tun->dev->type);
ret = 0;
}
break;
rtnl_unlock();
return ret;
}

#ifdef TUN_DEBUG
case TUNSETDEBUG:
Expand Down Expand Up @@ -734,15 +741,25 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
case SIOCADDMULTI:
/** Add the specified group to the character device's multicast filter
* list. */
rtnl_lock();
netif_tx_lock_bh(tun->dev);
add_multi(tun->chr_filter, ifr.ifr_hwaddr.sa_data);
netif_tx_unlock_bh(tun->dev);
rtnl_unlock();

DBG(KERN_DEBUG "%s: add multi: %s\n",
tun->dev->name, print_mac(mac, ifr.ifr_hwaddr.sa_data));
return 0;

case SIOCDELMULTI:
/** Remove the specified group from the character device's multicast
* filter list. */
rtnl_lock();
netif_tx_lock_bh(tun->dev);
del_multi(tun->chr_filter, ifr.ifr_hwaddr.sa_data);
netif_tx_unlock_bh(tun->dev);
rtnl_unlock();

DBG(KERN_DEBUG "%s: del multi: %s\n",
tun->dev->name, print_mac(mac, ifr.ifr_hwaddr.sa_data));
return 0;
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/wireless/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ obj-$(CONFIG_RTL8187) += rtl8187.o

obj-$(CONFIG_ADM8211) += adm8211.o

obj-$(CONFIG_IWL3945) += iwlwifi/
obj-$(CONFIG_IWL4965) += iwlwifi/
obj-$(CONFIG_IWLCORE) += iwlwifi/
obj-$(CONFIG_RT2X00) += rt2x00/

obj-$(CONFIG_P54_COMMON) += p54/
Expand Down
14 changes: 10 additions & 4 deletions drivers/net/wireless/ath5k/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,20 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
ah->ah_radio = AR5K_RF2413;
ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5112A;
} else if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_SC2) {

ah->ah_radio = AR5K_RF5413;
ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5112A;
} else if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_5133) {

if (ah->ah_mac_srev <= AR5K_SREV_VER_AR5424 &&
ah->ah_mac_srev >= AR5K_SREV_VER_AR2424)
/* AR5424 */
if (srev >= AR5K_SREV_VER_AR5424) {
ah->ah_radio = AR5K_RF5413;
ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5424;
else
/* AR2424 */
} else {
ah->ah_radio = AR5K_RF2413; /* For testing */
ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5112A;
}

/*
* Register returns 0x4 for radio revision
* so ath5k_hw_radio_revision doesn't parse the value
Expand Down
47 changes: 39 additions & 8 deletions drivers/net/wireless/b43/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,42 @@ void b43_dma_free(struct b43_wldev *dev)
destroy_ring(dma, tx_ring_mcast);
}

static int b43_dma_set_mask(struct b43_wldev *dev, u64 mask)
{
u64 orig_mask = mask;
bool fallback = 0;
int err;

/* Try to set the DMA mask. If it fails, try falling back to a
* lower mask, as we can always also support a lower one. */
while (1) {
err = ssb_dma_set_mask(dev->dev, mask);
if (!err)
break;
if (mask == DMA_64BIT_MASK) {
mask = DMA_32BIT_MASK;
fallback = 1;
continue;
}
if (mask == DMA_32BIT_MASK) {
mask = DMA_30BIT_MASK;
fallback = 1;
continue;
}
b43err(dev->wl, "The machine/kernel does not support "
"the required %u-bit DMA mask\n",
(unsigned int)dma_mask_to_engine_type(orig_mask));
return -EOPNOTSUPP;
}
if (fallback) {
b43info(dev->wl, "DMA mask fallback from %u-bit to %u-bit\n",
(unsigned int)dma_mask_to_engine_type(orig_mask),
(unsigned int)dma_mask_to_engine_type(mask));
}

return 0;
}

int b43_dma_init(struct b43_wldev *dev)
{
struct b43_dma *dma = &dev->dma;
Expand All @@ -989,14 +1025,9 @@ int b43_dma_init(struct b43_wldev *dev)

dmamask = supported_dma_mask(dev);
type = dma_mask_to_engine_type(dmamask);
err = ssb_dma_set_mask(dev->dev, dmamask);
if (err) {
b43err(dev->wl, "The machine/kernel does not support "
"the required DMA mask (0x%08X%08X)\n",
(unsigned int)((dmamask & 0xFFFFFFFF00000000ULL) >> 32),
(unsigned int)(dmamask & 0x00000000FFFFFFFFULL));
return -EOPNOTSUPP;
}
err = b43_dma_set_mask(dev, dmamask);
if (err)
return err;

err = -ENOMEM;
/* setup TX DMA channels. */
Expand Down
32 changes: 28 additions & 4 deletions drivers/net/wireless/b43/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ int b43_modparam_qos = 1;
module_param_named(qos, b43_modparam_qos, int, 0444);
MODULE_PARM_DESC(qos, "Enable QOS support (default on)");

static int modparam_btcoex = 1;
module_param_named(btcoex, modparam_btcoex, int, 0444);
MODULE_PARM_DESC(btcoex, "Enable Bluetooth coexistance (default on)");


static const struct ssb_device_id b43_ssb_tbl[] = {
SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 5),
Expand Down Expand Up @@ -3706,8 +3710,10 @@ static void setup_struct_wldev_for_init(struct b43_wldev *dev)
static void b43_bluetooth_coext_enable(struct b43_wldev *dev)
{
struct ssb_sprom *sprom = &dev->dev->bus->sprom;
u32 hf;
u64 hf;

if (!modparam_btcoex)
return;
if (!(sprom->boardflags_lo & B43_BFL_BTCOEXIST))
return;
if (dev->phy.type != B43_PHYTYPE_B && !dev->phy.gmode)
Expand All @@ -3719,11 +3725,13 @@ static void b43_bluetooth_coext_enable(struct b43_wldev *dev)
else
hf |= B43_HF_BTCOEX;
b43_hf_write(dev, hf);
//TODO
}

static void b43_bluetooth_coext_disable(struct b43_wldev *dev)
{ //TODO
{
if (!modparam_btcoex)
return;
//TODO
}

static void b43_imcfglo_timeouts_workaround(struct b43_wldev *dev)
Expand Down Expand Up @@ -3852,7 +3860,8 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
struct ssb_sprom *sprom = &bus->sprom;
struct b43_phy *phy = &dev->phy;
int err;
u32 hf, tmp;
u64 hf;
u32 tmp;

B43_WARN_ON(b43_status(dev) != B43_STAT_UNINIT);

Expand Down Expand Up @@ -4414,15 +4423,30 @@ static int b43_one_core_attach(struct ssb_device *dev, struct b43_wl *wl)
return err;
}

#define IS_PDEV(pdev, _vendor, _device, _subvendor, _subdevice) ( \
(pdev->vendor == PCI_VENDOR_ID_##_vendor) && \
(pdev->device == _device) && \
(pdev->subsystem_vendor == PCI_VENDOR_ID_##_subvendor) && \
(pdev->subsystem_device == _subdevice) )

static void b43_sprom_fixup(struct ssb_bus *bus)
{
struct pci_dev *pdev;

/* boardflags workarounds */
if (bus->boardinfo.vendor == SSB_BOARDVENDOR_DELL &&
bus->chip_id == 0x4301 && bus->boardinfo.rev == 0x74)
bus->sprom.boardflags_lo |= B43_BFL_BTCOEXIST;
if (bus->boardinfo.vendor == PCI_VENDOR_ID_APPLE &&
bus->boardinfo.type == 0x4E && bus->boardinfo.rev > 0x40)
bus->sprom.boardflags_lo |= B43_BFL_PACTRL;
if (bus->bustype == SSB_BUSTYPE_PCI) {
pdev = bus->host_pci;
if (IS_PDEV(pdev, BROADCOM, 0x4318, ASUSTEK, 0x100F) ||
IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0015) ||
IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0013))
bus->sprom.boardflags_lo &= ~B43_BFL_BTCOEXIST;
}
}

static void b43_wireless_exit(struct ssb_device *dev, struct b43_wl *wl)
Expand Down
Loading

0 comments on commit d02aacf

Please sign in to comment.