Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102571
b: refs/heads/master
c: 736bc92
h: refs/heads/master
i:
  102569: 64eee05
  102567: 04858fe
v: v3
  • Loading branch information
Paulius Zaleckas authored and John W. Linville committed May 14, 2008
1 parent b1382c7 commit 8e8fe65
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 29 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: 06a5223d68a7c48bf72a05aad533ea0e8a3453be
refs/heads/master: 736bc924fe7183dd27182a9148e78f250c1637ee
46 changes: 18 additions & 28 deletions trunk/drivers/net/wireless/atmel.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ struct atmel_private {
struct net_device *dev;
struct device *sys_dev;
struct iw_statistics wstats;
struct net_device_stats stats; // device stats
spinlock_t irqlock, timerlock; // spinlocks
enum { BUS_TYPE_PCCARD, BUS_TYPE_PCI } bus_type;
enum {
Expand Down Expand Up @@ -694,9 +693,9 @@ static void tx_done_irq(struct atmel_private *priv)

if (type == TX_PACKET_TYPE_DATA) {
if (status == TX_STATUS_SUCCESS)
priv->stats.tx_packets++;
priv->dev->stats.tx_packets++;
else
priv->stats.tx_errors++;
priv->dev->stats.tx_errors++;
netif_wake_queue(priv->dev);
}
}
Expand Down Expand Up @@ -792,13 +791,13 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)

if (priv->card && priv->present_callback &&
!(*priv->present_callback)(priv->card)) {
priv->stats.tx_errors++;
dev->stats.tx_errors++;
dev_kfree_skb(skb);
return 0;
}

if (priv->station_state != STATION_STATE_READY) {
priv->stats.tx_errors++;
dev->stats.tx_errors++;
dev_kfree_skb(skb);
return 0;
}
Expand All @@ -815,7 +814,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)
initial + 18 (+30-12) */

if (!(buff = find_tx_buff(priv, len + 18))) {
priv->stats.tx_dropped++;
dev->stats.tx_dropped++;
spin_unlock_irqrestore(&priv->irqlock, flags);
spin_unlock_bh(&priv->timerlock);
netif_stop_queue(dev);
Expand Down Expand Up @@ -851,7 +850,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)
/* low bit of first byte of destination tells us if broadcast */
tx_update_descriptor(priv, *(skb->data) & 0x01, len + 18, buff, TX_PACKET_TYPE_DATA);
dev->trans_start = jiffies;
priv->stats.tx_bytes += len;
dev->stats.tx_bytes += len;

spin_unlock_irqrestore(&priv->irqlock, flags);
spin_unlock_bh(&priv->timerlock);
Expand Down Expand Up @@ -895,7 +894,7 @@ static void fast_rx_path(struct atmel_private *priv,
}

if (!(skb = dev_alloc_skb(msdu_size + 14))) {
priv->stats.rx_dropped++;
priv->dev->stats.rx_dropped++;
return;
}

Expand All @@ -908,7 +907,7 @@ static void fast_rx_path(struct atmel_private *priv,
crc = crc32_le(crc, skbp + 12, msdu_size);
atmel_copy_to_host(priv->dev, (void *)&netcrc, rx_packet_loc + 30 + msdu_size, 4);
if ((crc ^ 0xffffffff) != netcrc) {
priv->stats.rx_crc_errors++;
priv->dev->stats.rx_crc_errors++;
dev_kfree_skb(skb);
return;
}
Expand All @@ -924,8 +923,8 @@ static void fast_rx_path(struct atmel_private *priv,
skb->protocol = eth_type_trans(skb, priv->dev);
skb->ip_summed = CHECKSUM_NONE;
netif_rx(skb);
priv->stats.rx_bytes += 12 + msdu_size;
priv->stats.rx_packets++;
priv->dev->stats.rx_bytes += 12 + msdu_size;
priv->dev->stats.rx_packets++;
}

/* Test to see if the packet in card memory at packet_loc has a valid CRC
Expand Down Expand Up @@ -991,7 +990,7 @@ static void frag_rx_path(struct atmel_private *priv,
crc = crc32_le(crc, &priv->rx_buf[12], msdu_size);
atmel_copy_to_host(priv->dev, (void *)&netcrc, rx_packet_loc + msdu_size, 4);
if ((crc ^ 0xffffffff) != netcrc) {
priv->stats.rx_crc_errors++;
priv->dev->stats.rx_crc_errors++;
memset(priv->frag_source, 0xff, 6);
}
}
Expand All @@ -1009,7 +1008,7 @@ static void frag_rx_path(struct atmel_private *priv,
msdu_size);
atmel_copy_to_host(priv->dev, (void *)&netcrc, rx_packet_loc + msdu_size, 4);
if ((crc ^ 0xffffffff) != netcrc) {
priv->stats.rx_crc_errors++;
priv->dev->stats.rx_crc_errors++;
memset(priv->frag_source, 0xff, 6);
more_frags = 1; /* don't send broken assembly */
}
Expand All @@ -1021,7 +1020,7 @@ static void frag_rx_path(struct atmel_private *priv,
if (!more_frags) { /* last one */
memset(priv->frag_source, 0xff, 6);
if (!(skb = dev_alloc_skb(priv->frag_len + 14))) {
priv->stats.rx_dropped++;
priv->dev->stats.rx_dropped++;
} else {
skb_reserve(skb, 2);
memcpy(skb_put(skb, priv->frag_len + 12),
Expand All @@ -1031,8 +1030,8 @@ static void frag_rx_path(struct atmel_private *priv,
skb->protocol = eth_type_trans(skb, priv->dev);
skb->ip_summed = CHECKSUM_NONE;
netif_rx(skb);
priv->stats.rx_bytes += priv->frag_len + 12;
priv->stats.rx_packets++;
priv->dev->stats.rx_bytes += priv->frag_len + 12;
priv->dev->stats.rx_packets++;
}
}
} else
Expand All @@ -1057,15 +1056,15 @@ static void rx_done_irq(struct atmel_private *priv)
if (status == 0xc1) /* determined by experiment */
priv->wstats.discard.nwid++;
else
priv->stats.rx_errors++;
priv->dev->stats.rx_errors++;
goto next;
}

msdu_size = atmel_rmem16(priv, atmel_rx(priv, RX_DESC_MSDU_SIZE_OFFSET, priv->rx_desc_head));
rx_packet_loc = atmel_rmem16(priv, atmel_rx(priv, RX_DESC_MSDU_POS_OFFSET, priv->rx_desc_head));

if (msdu_size < 30) {
priv->stats.rx_errors++;
priv->dev->stats.rx_errors++;
goto next;
}

Expand Down Expand Up @@ -1123,7 +1122,7 @@ static void rx_done_irq(struct atmel_private *priv)
msdu_size -= 4;
crc = crc32_le(crc, (unsigned char *)&priv->rx_buf, msdu_size);
if ((crc ^ 0xffffffff) != (*((u32 *)&priv->rx_buf[msdu_size]))) {
priv->stats.rx_crc_errors++;
priv->dev->stats.rx_crc_errors++;
goto next;
}
}
Expand Down Expand Up @@ -1250,12 +1249,6 @@ static irqreturn_t service_interrupt(int irq, void *dev_id)
}
}

static struct net_device_stats *atmel_get_stats(struct net_device *dev)
{
struct atmel_private *priv = netdev_priv(dev);
return &priv->stats;
}

static struct iw_statistics *atmel_get_wireless_stats(struct net_device *dev)
{
struct atmel_private *priv = netdev_priv(dev);
Expand Down Expand Up @@ -1518,8 +1511,6 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port,
priv->crc_ok_cnt = priv->crc_ko_cnt = 0;
} else
priv->probe_crc = 0;
memset(&priv->stats, 0, sizeof(priv->stats));
memset(&priv->wstats, 0, sizeof(priv->wstats));
priv->last_qual = jiffies;
priv->last_beacon_timestamp = 0;
memset(priv->frag_source, 0xff, sizeof(priv->frag_source));
Expand Down Expand Up @@ -1568,7 +1559,6 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port,
dev->change_mtu = atmel_change_mtu;
dev->set_mac_address = atmel_set_mac_address;
dev->hard_start_xmit = start_tx;
dev->get_stats = atmel_get_stats;
dev->wireless_handlers = (struct iw_handler_def *)&atmel_handler_def;
dev->do_ioctl = atmel_ioctl;
dev->irq = irq;
Expand Down

0 comments on commit 8e8fe65

Please sign in to comment.