Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121829
b: refs/heads/master
c: 9757d55
h: refs/heads/master
i:
  121827: 6e89453
v: v3
  • Loading branch information
Sujith authored and John W. Linville committed Nov 11, 2008
1 parent 0073d22 commit cb1f239
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 37 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: eb37b41cc2274cdecfc19d371717c321fe2ab426
refs/heads/master: 9757d55652f98836b9a4cac307a01f8b0232dbd9
4 changes: 3 additions & 1 deletion trunk/drivers/net/wireless/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ static struct pci_device_id ath_pci_id_table[] __devinitdata = {
{ 0 }
};

static void ath_detach(struct ath_softc *sc);

static int ath_get_channel(struct ath_softc *sc,
struct ieee80211_channel *chan)
{
Expand Down Expand Up @@ -813,7 +815,7 @@ static int ath_start_rfkill_poll(struct ath_softc *sc)
pci_iounmap(sc->pdev, sc->mem);
pci_release_region(sc->pdev, 0);
pci_disable_device(sc->pdev);
ieee80211_free_hw(hw);
ieee80211_free_hw(sc->hw);
return -EIO;
} else {
sc->sc_flags |= SC_OP_RFKILL_REGISTERED;
Expand Down
22 changes: 0 additions & 22 deletions trunk/net/core/pktgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t,
const char *ifname);
static int pktgen_device_event(struct notifier_block *, unsigned long, void *);
static void pktgen_run_all_threads(void);
static void pktgen_reset_all_threads(void);
static void pktgen_stop_all_threads_ifs(void);
static int pktgen_stop_device(struct pktgen_dev *pkt_dev);
static void pktgen_stop(struct pktgen_thread *t);
Expand Down Expand Up @@ -481,9 +480,6 @@ static ssize_t pgctrl_write(struct file *file, const char __user * buf,
else if (!strcmp(data, "start"))
pktgen_run_all_threads();

else if (!strcmp(data, "reset"))
pktgen_reset_all_threads();

else
printk(KERN_WARNING "pktgen: Unknown command: %s\n", data);

Expand Down Expand Up @@ -3177,24 +3173,6 @@ static void pktgen_run_all_threads(void)
pktgen_wait_all_threads_run();
}

static void pktgen_reset_all_threads(void)
{
struct pktgen_thread *t;

pr_debug("pktgen: entering pktgen_reset_all_threads.\n");

mutex_lock(&pktgen_thread_lock);

list_for_each_entry(t, &pktgen_threads, th_list)
t->control |= (T_REMDEVALL);

mutex_unlock(&pktgen_thread_lock);

schedule_timeout_interruptible(msecs_to_jiffies(125)); /* Propagate thread->control */

pktgen_wait_all_threads_run();
}

static void show_results(struct pktgen_dev *pkt_dev, int nr_frags)
{
__u64 total_us, bps, mbps, pps, idle;
Expand Down
33 changes: 20 additions & 13 deletions trunk/net/phonet/pep-gprs.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ struct gprs_dev {
void (*old_write_space)(struct sock *);

struct net_device *net;
struct net_device_stats stats;

struct sk_buff_head tx_queue;
struct work_struct tx_work;
Expand Down Expand Up @@ -82,7 +83,6 @@ static void gprs_state_change(struct sock *sk)

static int gprs_recv(struct gprs_dev *dev, struct sk_buff *skb)
{
struct net_device *net = dev->net;
int err = 0;
__be16 protocol = gprs_type_trans(skb);

Expand All @@ -99,7 +99,7 @@ static int gprs_recv(struct gprs_dev *dev, struct sk_buff *skb)
* so wrap the IP packet as a single fragment of an head-less
* socket buffer. The network stack will pull what it needs,
* but at least, the whole IP payload is not memcpy'd. */
rskb = netdev_alloc_skb(net, 0);
rskb = netdev_alloc_skb(dev->net, 0);
if (!rskb) {
err = -ENOBUFS;
goto drop;
Expand All @@ -123,11 +123,11 @@ static int gprs_recv(struct gprs_dev *dev, struct sk_buff *skb)

skb->protocol = protocol;
skb_reset_mac_header(skb);
skb->dev = net;
skb->dev = dev->net;

if (likely(net->flags & IFF_UP)) {
net->stats.rx_packets++;
net->stats.rx_bytes += skb->len;
if (likely(dev->net->flags & IFF_UP)) {
dev->stats.rx_packets++;
dev->stats.rx_bytes += skb->len;
netif_rx(skb);
skb = NULL;
} else
Expand All @@ -136,7 +136,7 @@ static int gprs_recv(struct gprs_dev *dev, struct sk_buff *skb)
drop:
if (skb) {
dev_kfree_skb(skb);
net->stats.rx_dropped++;
dev->stats.rx_dropped++;
}
return err;
}
Expand Down Expand Up @@ -199,15 +199,14 @@ static int gprs_xmit(struct sk_buff *skb, struct net_device *net)
static void gprs_tx(struct work_struct *work)
{
struct gprs_dev *dev = container_of(work, struct gprs_dev, tx_work);
struct net_device *net = dev->net;
struct sock *sk = dev->sk;
struct sk_buff *skb;

while ((skb = skb_dequeue(&dev->tx_queue)) != NULL) {
int err;

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

skb_orphan(skb);
skb_set_owner_w(skb, sk);
Expand All @@ -216,9 +215,9 @@ static void gprs_tx(struct work_struct *work)
err = pep_write(sk, skb);
if (err) {
LIMIT_NETDEBUG(KERN_WARNING"%s: TX error (%d)\n",
net->name, err);
net->stats.tx_aborted_errors++;
net->stats.tx_errors++;
dev->net->name, err);
dev->stats.tx_aborted_errors++;
dev->stats.tx_errors++;
}
release_sock(sk);
}
Expand All @@ -237,6 +236,13 @@ static int gprs_set_mtu(struct net_device *net, int new_mtu)
return 0;
}

static struct net_device_stats *gprs_get_stats(struct net_device *net)
{
struct gprs_dev *dev = netdev_priv(net);

return &dev->stats;
}

static void gprs_setup(struct net_device *net)
{
net->features = NETIF_F_FRAGLIST;
Expand All @@ -250,6 +256,7 @@ static void gprs_setup(struct net_device *net)
net->destructor = free_netdev;
net->hard_start_xmit = gprs_xmit; /* mandatory */
net->change_mtu = gprs_set_mtu;
net->get_stats = gprs_get_stats;
}

/*
Expand Down

0 comments on commit cb1f239

Please sign in to comment.