Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91990
b: refs/heads/master
c: a46f025
h: refs/heads/master
v: v3
  • Loading branch information
Abhijeet Kolekar authored and John W. Linville committed Apr 24, 2008
1 parent b5763e3 commit 3115a0e
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 31 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 49186b4a083655a4ebf54e94baf0736256b01b47
refs/heads/master: a46f025d053e47b9ce602f53f6d30e94d304a51c
48 changes: 29 additions & 19 deletions trunk/drivers/net/ppp_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ 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 @@ -913,10 +914,18 @@ ppp_start_xmit(struct sk_buff *skb, struct net_device *dev)

outf:
kfree_skb(skb);
++ppp->dev->stats.tx_dropped;
++ppp->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 @@ -1086,8 +1095,8 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
#endif /* CONFIG_PPP_FILTER */
}

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

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

/*
Expand Down Expand Up @@ -1400,7 +1409,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->dev->stats.tx_errors;
++ppp->stats.tx_errors;
++ppp->nxseq;
return 1; /* abandon the frame */
}
Expand Down Expand Up @@ -1529,7 +1538,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->dev->stats.rx_length_errors;
++ppp->stats.rx_length_errors;

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

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

npi = proto_to_npindex(proto);
if (npi < 0) {
Expand Down Expand Up @@ -1797,7 +1806,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->dev->stats.rx_dropped;
++ppp->stats.rx_dropped;
ppp_receive_error(ppp);
return;
}
Expand Down Expand Up @@ -1919,7 +1928,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->dev->stats.rx_length_errors;
++ppp->stats.rx_length_errors;
printk(KERN_DEBUG "PPP: reconstructed packet"
" is too long (%d)\n", len);
} else if (p == head) {
Expand All @@ -1928,7 +1937,7 @@ ppp_mp_reconstruct(struct ppp *ppp)
skb = skb_get(p);
break;
} else if ((skb = dev_alloc_skb(len)) == NULL) {
++ppp->dev->stats.rx_missed_errors;
++ppp->stats.rx_missed_errors;
printk(KERN_DEBUG "PPP: no memory for "
"reconstructed packet");
} else {
Expand Down Expand Up @@ -1957,7 +1966,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->dev->stats.rx_dropped;
++ppp->stats.rx_dropped;
ppp_receive_error(ppp);
}

Expand Down Expand Up @@ -2368,12 +2377,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->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;
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;
if (!vj)
return;
st->vj.vjs_packets = vj->sls_o_compressed + vj->sls_o_uncompressed;
Expand Down Expand Up @@ -2427,6 +2436,7 @@ 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
11 changes: 2 additions & 9 deletions trunk/drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,23 +668,16 @@ 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);
ret = -EBUSY;
return -EBUSY;
} else {
tun->dev->type = (int) arg;
DBG(KERN_INFO "%s: linktype set to %d\n", tun->dev->name, tun->dev->type);
ret = 0;
}
rtnl_unlock();
return ret;
}
break;

#ifdef TUN_DEBUG
case TUNSETDEBUG:
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/wireless/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ obj-$(CONFIG_RTL8187) += rtl8187.o

obj-$(CONFIG_ADM8211) += adm8211.o

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

obj-$(CONFIG_P54_COMMON) += p54/
Expand Down
21 changes: 20 additions & 1 deletion trunk/net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -2709,7 +2709,26 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
bss->wmm_ie_len = elems.wmm_param_len + 2;
} else
bss->wmm_ie_len = 0;
} else if (!elems.wmm_param && bss->wmm_ie) {
} else if (elems.wmm_info &&
(!bss->wmm_ie || bss->wmm_ie_len != elems.wmm_info_len ||
memcmp(bss->wmm_ie, elems.wmm_info, elems.wmm_info_len))) {
/* As for certain AP's Fifth bit is not set in WMM IE in
* beacon frames.So while parsing the beacon frame the
* wmm_info structure is used instead of wmm_param.
* wmm_info structure was never used to set bss->wmm_ie.
* This code fixes this problem by copying the WME
* information from wmm_info to bss->wmm_ie and enabling
* n-band association.
*/
kfree(bss->wmm_ie);
bss->wmm_ie = kmalloc(elems.wmm_info_len + 2, GFP_ATOMIC);
if (bss->wmm_ie) {
memcpy(bss->wmm_ie, elems.wmm_info - 2,
elems.wmm_info_len + 2);
bss->wmm_ie_len = elems.wmm_info_len + 2;
} else
bss->wmm_ie_len = 0;
} else if (!elems.wmm_param && !elems.wmm_info && bss->wmm_ie) {
kfree(bss->wmm_ie);
bss->wmm_ie = NULL;
bss->wmm_ie_len = 0;
Expand Down

0 comments on commit 3115a0e

Please sign in to comment.