19 #include <linux/module.h>
22 #include <linux/pci.h>
24 #include <linux/netdevice.h>
26 #include <linux/if_arp.h>
27 #include <asm/byteorder.h>
59 #if VERBOSE > SHOW_ERROR_MESSAGES
61 "cleanup skb %p skb->data %p skb->len %u truesize %u\n ",
65 pci_unmap_single(priv->
pdev,
89 unsigned char wds_mac[6];
92 #if VERBOSE > SHOW_ERROR_MESSAGES
104 netif_stop_queue(ndev);
117 offset = (4 - (
long) skb->
data) & 0x03;
121 if (!skb_cloned(skb) && (skb_tailroom(skb) >=
offset)) {
122 unsigned char *
src = skb->
data;
124 #if VERBOSE > SHOW_ERROR_MESSAGES
130 skb_reserve(skb, (4 - (
long) skb->
data) & 0x03);
134 #ifdef ISLPCI_ETH_DEBUG
135 printk(
"islpci_eth_transmit:wds_mac\n");
138 skb_copy_to_linear_data(skb, wds_mac, 6);
143 #if VERBOSE > SHOW_ERROR_MESSAGES
155 newskb_offset = (4 - (
long) newskb->
data) & 0x03;
159 skb_reserve(newskb, newskb_offset);
163 skb_copy_from_linear_data(skb,
166 skb_copy_to_linear_data(newskb, wds_mac, 6);
167 #ifdef ISLPCI_ETH_DEBUG
168 printk(
"islpci_eth_transmit:wds_mac\n");
171 skb_copy_from_linear_data(skb, newskb->
data,
174 #if VERBOSE > SHOW_ERROR_MESSAGES
185 #if VERBOSE > SHOW_ERROR_MESSAGES
191 pci_map_address = pci_map_single(priv->
pdev,
194 if (
unlikely(pci_map_address == 0)) {
207 frame_size = skb->
len;
221 netif_stop_queue(ndev);
227 ndev->
stats.tx_packets++;
231 islpci_trigger(priv);
234 spin_unlock_irqrestore(&priv->
slock, flags);
239 ndev->
stats.tx_dropped++;
240 spin_unlock_irqrestore(&priv->
slock, flags);
303 skb_reset_mac_header(*skb);
320 #if VERBOSE > SHOW_ERROR_MESSAGES
329 offset = ((
unsigned long)
333 #if VERBOSE > SHOW_ERROR_MESSAGES
335 "frq->addr %x skb->data %p skb->len %u offset %u truesize %u\n ",
341 pci_unmap_single(priv->
pdev,
352 #if VERBOSE > SHOW_ERROR_MESSAGES
366 #if VERBOSE > SHOW_ERROR_MESSAGES
377 discard = islpci_monitor_rx(priv, &skb);
395 skb_copy_from_linear_data(skb,
404 ndev->
stats.rx_packets++;
408 #ifdef ISLPCI_ETH_DEBUG
410 (
"islpci_eth_receive:netif_rx %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n",
436 skb_reserve(skb, (4 - (
long) skb->
data) & 0x03);
441 #if VERBOSE > SHOW_ERROR_MESSAGES
443 "new alloc skb %p skb->data %p skb->len %u index %u truesize %u\n ",
449 pci_map_single(priv->
pdev, (
void *) skb->
data,
455 "Error mapping DMA address\n");
468 le32_add_cpu(&control_block->
469 driver_curr_frag[ISL38XX_CB_RX_DATA_LQ], 1);
473 islpci_trigger(priv);
486 netif_wake_queue(priv->
ndev);
495 ndev->
stats.tx_errors++;
499 "%s: tx_timeout, scheduling reset", ndev->
name);
500 netif_stop_queue(ndev);
505 "%s: tx_timeout, waiting for reset", ndev->
name);