aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/netxen/netxen_nic_main.c')
-rw-r--r--drivers/net/netxen/netxen_nic_main.c233
1 files changed, 145 insertions, 88 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index ba01524b5531..645d384fe87e 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -39,7 +39,9 @@
39#include "netxen_nic_phan_reg.h" 39#include "netxen_nic_phan_reg.h"
40 40
41#include <linux/dma-mapping.h> 41#include <linux/dma-mapping.h>
42#include <linux/if_vlan.h>
42#include <net/ip.h> 43#include <net/ip.h>
44#include <linux/ipv6.h>
43 45
44MODULE_DESCRIPTION("NetXen Multi port (1/10) Gigabit Network Driver"); 46MODULE_DESCRIPTION("NetXen Multi port (1/10) Gigabit Network Driver");
45MODULE_LICENSE("GPL"); 47MODULE_LICENSE("GPL");
@@ -242,7 +244,7 @@ static void netxen_check_options(struct netxen_adapter *adapter)
242 case NETXEN_BRDTYPE_P3_4_GB: 244 case NETXEN_BRDTYPE_P3_4_GB:
243 case NETXEN_BRDTYPE_P3_4_GB_MM: 245 case NETXEN_BRDTYPE_P3_4_GB_MM:
244 adapter->msix_supported = !!use_msi_x; 246 adapter->msix_supported = !!use_msi_x;
245 adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_10G; 247 adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G;
246 break; 248 break;
247 249
248 case NETXEN_BRDTYPE_P2_SB35_4G: 250 case NETXEN_BRDTYPE_P2_SB35_4G:
@@ -251,6 +253,14 @@ static void netxen_check_options(struct netxen_adapter *adapter)
251 adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G; 253 adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G;
252 break; 254 break;
253 255
256 case NETXEN_BRDTYPE_P3_10G_TP:
257 adapter->msix_supported = !!use_msi_x;
258 if (adapter->ahw.board_type == NETXEN_NIC_XGBE)
259 adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_10G;
260 else
261 adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G;
262 break;
263
254 default: 264 default:
255 adapter->msix_supported = 0; 265 adapter->msix_supported = 0;
256 adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G; 266 adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G;
@@ -271,10 +281,15 @@ static void netxen_check_options(struct netxen_adapter *adapter)
271static int 281static int
272netxen_check_hw_init(struct netxen_adapter *adapter, int first_boot) 282netxen_check_hw_init(struct netxen_adapter *adapter, int first_boot)
273{ 283{
274 int ret = 0; 284 u32 val, timeout;
275 285
276 if (first_boot == 0x55555555) { 286 if (first_boot == 0x55555555) {
277 /* This is the first boot after power up */ 287 /* This is the first boot after power up */
288 adapter->pci_write_normalize(adapter,
289 NETXEN_CAM_RAM(0x1fc), NETXEN_BDINFO_MAGIC);
290
291 if (!NX_IS_REVISION_P2(adapter->ahw.revision_id))
292 return 0;
278 293
279 /* PCI bus master workaround */ 294 /* PCI bus master workaround */
280 adapter->hw_read_wx(adapter, 295 adapter->hw_read_wx(adapter,
@@ -294,18 +309,26 @@ netxen_check_hw_init(struct netxen_adapter *adapter, int first_boot)
294 /* clear the register for future unloads/loads */ 309 /* clear the register for future unloads/loads */
295 adapter->pci_write_normalize(adapter, 310 adapter->pci_write_normalize(adapter,
296 NETXEN_CAM_RAM(0x1fc), 0); 311 NETXEN_CAM_RAM(0x1fc), 0);
297 ret = -1; 312 return -EIO;
298 } 313 }
299 314
300 if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) { 315 /* Start P2 boot loader */
301 /* Start P2 boot loader */ 316 val = adapter->pci_read_normalize(adapter,
302 adapter->pci_write_normalize(adapter, 317 NETXEN_ROMUSB_GLB_PEGTUNE_DONE);
303 NETXEN_CAM_RAM(0x1fc), NETXEN_BDINFO_MAGIC); 318 adapter->pci_write_normalize(adapter,
304 adapter->pci_write_normalize(adapter, 319 NETXEN_ROMUSB_GLB_PEGTUNE_DONE, val | 0x1);
305 NETXEN_ROMUSB_GLB_PEGTUNE_DONE, 1); 320 timeout = 0;
306 } 321 do {
322 msleep(1);
323 val = adapter->pci_read_normalize(adapter,
324 NETXEN_CAM_RAM(0x1fc));
325
326 if (++timeout > 5000)
327 return -EIO;
328
329 } while (val == NETXEN_BDINFO_MAGIC);
307 } 330 }
308 return ret; 331 return 0;
309} 332}
310 333
311static void netxen_set_port_mode(struct netxen_adapter *adapter) 334static void netxen_set_port_mode(struct netxen_adapter *adapter)
@@ -712,17 +735,18 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
712 735
713 SET_ETHTOOL_OPS(netdev, &netxen_nic_ethtool_ops); 736 SET_ETHTOOL_OPS(netdev, &netxen_nic_ethtool_ops);
714 737
715 /* ScatterGather support */ 738 netdev->features |= (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO);
716 netdev->features = NETIF_F_SG; 739 netdev->vlan_features |= (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO);
717 netdev->features |= NETIF_F_IP_CSUM; 740
718 netdev->features |= NETIF_F_TSO;
719 if (NX_IS_REVISION_P3(revision_id)) { 741 if (NX_IS_REVISION_P3(revision_id)) {
720 netdev->features |= NETIF_F_IPV6_CSUM; 742 netdev->features |= (NETIF_F_IPV6_CSUM | NETIF_F_TSO6);
721 netdev->features |= NETIF_F_TSO6; 743 netdev->vlan_features |= (NETIF_F_IPV6_CSUM | NETIF_F_TSO6);
722 } 744 }
723 745
724 if (adapter->pci_using_dac) 746 if (adapter->pci_using_dac) {
725 netdev->features |= NETIF_F_HIGHDMA; 747 netdev->features |= NETIF_F_HIGHDMA;
748 netdev->vlan_features |= NETIF_F_HIGHDMA;
749 }
726 750
727 /* 751 /*
728 * Set the CRB window to invalid. If any register in window 0 is 752 * Set the CRB window to invalid. If any register in window 0 is
@@ -784,8 +808,8 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
784 CRB_CMDPEG_STATE, 0); 808 CRB_CMDPEG_STATE, 0);
785 netxen_pinit_from_rom(adapter, 0); 809 netxen_pinit_from_rom(adapter, 0);
786 msleep(1); 810 msleep(1);
787 netxen_load_firmware(adapter);
788 } 811 }
812 netxen_load_firmware(adapter);
789 813
790 if (NX_IS_REVISION_P3(revision_id)) 814 if (NX_IS_REVISION_P3(revision_id))
791 netxen_pcie_strap_init(adapter); 815 netxen_pcie_strap_init(adapter);
@@ -801,13 +825,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
801 825
802 } 826 }
803 827
804 if ((first_boot == 0x55555555) &&
805 (NX_IS_REVISION_P2(revision_id))) {
806 /* Unlock the HW, prompting the boot sequence */
807 adapter->pci_write_normalize(adapter,
808 NETXEN_ROMUSB_GLB_PEGTUNE_DONE, 1);
809 }
810
811 err = netxen_initialize_adapter_offload(adapter); 828 err = netxen_initialize_adapter_offload(adapter);
812 if (err) 829 if (err)
813 goto err_out_iounmap; 830 goto err_out_iounmap;
@@ -821,7 +838,9 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
821 adapter->pci_write_normalize(adapter, CRB_DRIVER_VERSION, i); 838 adapter->pci_write_normalize(adapter, CRB_DRIVER_VERSION, i);
822 839
823 /* Handshake with the card before we register the devices. */ 840 /* Handshake with the card before we register the devices. */
824 netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); 841 err = netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE);
842 if (err)
843 goto err_out_free_offload;
825 844
826 } /* first_driver */ 845 } /* first_driver */
827 846
@@ -925,6 +944,7 @@ err_out_disable_msi:
925 if (adapter->flags & NETXEN_NIC_MSI_ENABLED) 944 if (adapter->flags & NETXEN_NIC_MSI_ENABLED)
926 pci_disable_msi(pdev); 945 pci_disable_msi(pdev);
927 946
947err_out_free_offload:
928 if (first_driver) 948 if (first_driver)
929 netxen_free_adapter_offload(adapter); 949 netxen_free_adapter_offload(adapter);
930 950
@@ -968,6 +988,9 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev)
968 netxen_free_hw_resources(adapter); 988 netxen_free_hw_resources(adapter);
969 netxen_release_rx_buffers(adapter); 989 netxen_release_rx_buffers(adapter);
970 netxen_free_sw_resources(adapter); 990 netxen_free_sw_resources(adapter);
991
992 if (NX_IS_REVISION_P3(adapter->ahw.revision_id))
993 netxen_p3_free_mac_list(adapter);
971 } 994 }
972 995
973 if (adapter->portnum == 0) 996 if (adapter->portnum == 0)
@@ -983,8 +1006,10 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev)
983 1006
984 iounmap(adapter->ahw.db_base); 1007 iounmap(adapter->ahw.db_base);
985 iounmap(adapter->ahw.pci_base0); 1008 iounmap(adapter->ahw.pci_base0);
986 iounmap(adapter->ahw.pci_base1); 1009 if (adapter->ahw.pci_base1 != NULL)
987 iounmap(adapter->ahw.pci_base2); 1010 iounmap(adapter->ahw.pci_base1);
1011 if (adapter->ahw.pci_base2 != NULL)
1012 iounmap(adapter->ahw.pci_base2);
988 1013
989 pci_release_regions(pdev); 1014 pci_release_regions(pdev);
990 pci_disable_device(pdev); 1015 pci_disable_device(pdev);
@@ -1137,29 +1162,72 @@ static int netxen_nic_close(struct net_device *netdev)
1137 return 0; 1162 return 0;
1138} 1163}
1139 1164
1140void netxen_tso_check(struct netxen_adapter *adapter, 1165static bool netxen_tso_check(struct net_device *netdev,
1141 struct cmd_desc_type0 *desc, struct sk_buff *skb) 1166 struct cmd_desc_type0 *desc, struct sk_buff *skb)
1142{ 1167{
1143 if (desc->mss) { 1168 bool tso = false;
1144 desc->total_hdr_length = (sizeof(struct ethhdr) + 1169 u8 opcode = TX_ETHER_PKT;
1145 ip_hdrlen(skb) + tcp_hdrlen(skb)); 1170 __be16 protocol = skb->protocol;
1171 u16 flags = 0;
1172
1173 if (protocol == __constant_htons(ETH_P_8021Q)) {
1174 struct vlan_ethhdr *vh = (struct vlan_ethhdr *)skb->data;
1175 protocol = vh->h_vlan_encapsulated_proto;
1176 flags = FLAGS_VLAN_TAGGED;
1177 }
1146 1178
1147 if ((NX_IS_REVISION_P3(adapter->ahw.revision_id)) && 1179 if ((netdev->features & (NETIF_F_TSO | NETIF_F_TSO6)) &&
1148 (skb->protocol == htons(ETH_P_IPV6))) 1180 skb_shinfo(skb)->gso_size > 0) {
1149 netxen_set_cmd_desc_opcode(desc, TX_TCP_LSO6); 1181
1150 else 1182 desc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size);
1151 netxen_set_cmd_desc_opcode(desc, TX_TCP_LSO); 1183 desc->total_hdr_length =
1184 skb_transport_offset(skb) + tcp_hdrlen(skb);
1185
1186 opcode = (protocol == __constant_htons(ETH_P_IPV6)) ?
1187 TX_TCP_LSO6 : TX_TCP_LSO;
1188 tso = true;
1152 1189
1153 } else if (skb->ip_summed == CHECKSUM_PARTIAL) { 1190 } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
1154 if (ip_hdr(skb)->protocol == IPPROTO_TCP) 1191 u8 l4proto;
1155 netxen_set_cmd_desc_opcode(desc, TX_TCP_PKT); 1192
1156 else if (ip_hdr(skb)->protocol == IPPROTO_UDP) 1193 if (protocol == __constant_htons(ETH_P_IP)) {
1157 netxen_set_cmd_desc_opcode(desc, TX_UDP_PKT); 1194 l4proto = ip_hdr(skb)->protocol;
1158 else 1195
1159 return; 1196 if (l4proto == IPPROTO_TCP)
1197 opcode = TX_TCP_PKT;
1198 else if(l4proto == IPPROTO_UDP)
1199 opcode = TX_UDP_PKT;
1200 } else if (protocol == __constant_htons(ETH_P_IPV6)) {
1201 l4proto = ipv6_hdr(skb)->nexthdr;
1202
1203 if (l4proto == IPPROTO_TCP)
1204 opcode = TX_TCPV6_PKT;
1205 else if(l4proto == IPPROTO_UDP)
1206 opcode = TX_UDPV6_PKT;
1207 }
1160 } 1208 }
1161 desc->tcp_hdr_offset = skb_transport_offset(skb); 1209 desc->tcp_hdr_offset = skb_transport_offset(skb);
1162 desc->ip_hdr_offset = skb_network_offset(skb); 1210 desc->ip_hdr_offset = skb_network_offset(skb);
1211 netxen_set_tx_flags_opcode(desc, flags, opcode);
1212 return tso;
1213}
1214
1215static void
1216netxen_clean_tx_dma_mapping(struct pci_dev *pdev,
1217 struct netxen_cmd_buffer *pbuf, int last)
1218{
1219 int k;
1220 struct netxen_skb_frag *buffrag;
1221
1222 buffrag = &pbuf->frag_array[0];
1223 pci_unmap_single(pdev, buffrag->dma,
1224 buffrag->length, PCI_DMA_TODEVICE);
1225
1226 for (k = 1; k < last; k++) {
1227 buffrag = &pbuf->frag_array[k];
1228 pci_unmap_page(pdev, buffrag->dma,
1229 buffrag->length, PCI_DMA_TODEVICE);
1230 }
1163} 1231}
1164 1232
1165static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) 1233static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
@@ -1167,33 +1235,22 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1167 struct netxen_adapter *adapter = netdev_priv(netdev); 1235 struct netxen_adapter *adapter = netdev_priv(netdev);
1168 struct netxen_hardware_context *hw = &adapter->ahw; 1236 struct netxen_hardware_context *hw = &adapter->ahw;
1169 unsigned int first_seg_len = skb->len - skb->data_len; 1237 unsigned int first_seg_len = skb->len - skb->data_len;
1238 struct netxen_cmd_buffer *pbuf;
1170 struct netxen_skb_frag *buffrag; 1239 struct netxen_skb_frag *buffrag;
1171 unsigned int i; 1240 struct cmd_desc_type0 *hwdesc;
1241 struct pci_dev *pdev = adapter->pdev;
1242 dma_addr_t temp_dma;
1243 int i, k;
1172 1244
1173 u32 producer, consumer; 1245 u32 producer, consumer;
1174 u32 saved_producer = 0; 1246 int frag_count, no_of_desc;
1175 struct cmd_desc_type0 *hwdesc;
1176 int k;
1177 struct netxen_cmd_buffer *pbuf = NULL;
1178 int frag_count;
1179 int no_of_desc;
1180 u32 num_txd = adapter->max_tx_desc_count; 1247 u32 num_txd = adapter->max_tx_desc_count;
1248 bool is_tso = false;
1181 1249
1182 frag_count = skb_shinfo(skb)->nr_frags + 1; 1250 frag_count = skb_shinfo(skb)->nr_frags + 1;
1183 1251
1184 /* There 4 fragments per descriptor */ 1252 /* There 4 fragments per descriptor */
1185 no_of_desc = (frag_count + 3) >> 2; 1253 no_of_desc = (frag_count + 3) >> 2;
1186 if (netdev->features & (NETIF_F_TSO | NETIF_F_TSO6)) {
1187 if (skb_shinfo(skb)->gso_size > 0) {
1188
1189 no_of_desc++;
1190 if ((ip_hdrlen(skb) + tcp_hdrlen(skb) +
1191 sizeof(struct ethhdr)) >
1192 (sizeof(struct cmd_desc_type0) - 2)) {
1193 no_of_desc++;
1194 }
1195 }
1196 }
1197 1254
1198 producer = adapter->cmd_producer; 1255 producer = adapter->cmd_producer;
1199 smp_mb(); 1256 smp_mb();
@@ -1205,34 +1262,26 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1205 } 1262 }
1206 1263
1207 /* Copy the descriptors into the hardware */ 1264 /* Copy the descriptors into the hardware */
1208 saved_producer = producer;
1209 hwdesc = &hw->cmd_desc_head[producer]; 1265 hwdesc = &hw->cmd_desc_head[producer];
1210 memset(hwdesc, 0, sizeof(struct cmd_desc_type0)); 1266 memset(hwdesc, 0, sizeof(struct cmd_desc_type0));
1211 /* Take skb->data itself */ 1267 /* Take skb->data itself */
1212 pbuf = &adapter->cmd_buf_arr[producer]; 1268 pbuf = &adapter->cmd_buf_arr[producer];
1213 if ((netdev->features & (NETIF_F_TSO | NETIF_F_TSO6)) && 1269
1214 skb_shinfo(skb)->gso_size > 0) { 1270 is_tso = netxen_tso_check(netdev, hwdesc, skb);
1215 pbuf->mss = skb_shinfo(skb)->gso_size; 1271
1216 hwdesc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size);
1217 } else {
1218 pbuf->mss = 0;
1219 hwdesc->mss = 0;
1220 }
1221 pbuf->total_length = skb->len;
1222 pbuf->skb = skb; 1272 pbuf->skb = skb;
1223 pbuf->cmd = TX_ETHER_PKT;
1224 pbuf->frag_count = frag_count; 1273 pbuf->frag_count = frag_count;
1225 pbuf->port = adapter->portnum;
1226 buffrag = &pbuf->frag_array[0]; 1274 buffrag = &pbuf->frag_array[0];
1227 buffrag->dma = pci_map_single(adapter->pdev, skb->data, first_seg_len, 1275 temp_dma = pci_map_single(pdev, skb->data, first_seg_len,
1228 PCI_DMA_TODEVICE); 1276 PCI_DMA_TODEVICE);
1277 if (pci_dma_mapping_error(pdev, temp_dma))
1278 goto drop_packet;
1279
1280 buffrag->dma = temp_dma;
1229 buffrag->length = first_seg_len; 1281 buffrag->length = first_seg_len;
1230 netxen_set_cmd_desc_totallength(hwdesc, skb->len); 1282 netxen_set_tx_frags_len(hwdesc, frag_count, skb->len);
1231 netxen_set_cmd_desc_num_of_buff(hwdesc, frag_count); 1283 netxen_set_tx_port(hwdesc, adapter->portnum);
1232 netxen_set_cmd_desc_opcode(hwdesc, TX_ETHER_PKT);
1233 1284
1234 netxen_set_cmd_desc_port(hwdesc, adapter->portnum);
1235 netxen_set_cmd_desc_ctxid(hwdesc, adapter->portnum);
1236 hwdesc->buffer1_length = cpu_to_le16(first_seg_len); 1285 hwdesc->buffer1_length = cpu_to_le16(first_seg_len);
1237 hwdesc->addr_buffer1 = cpu_to_le64(buffrag->dma); 1286 hwdesc->addr_buffer1 = cpu_to_le64(buffrag->dma);
1238 1287
@@ -1240,7 +1289,6 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1240 struct skb_frag_struct *frag; 1289 struct skb_frag_struct *frag;
1241 int len, temp_len; 1290 int len, temp_len;
1242 unsigned long offset; 1291 unsigned long offset;
1243 dma_addr_t temp_dma;
1244 1292
1245 /* move to next desc. if there is a need */ 1293 /* move to next desc. if there is a need */
1246 if ((i & 0x3) == 0) { 1294 if ((i & 0x3) == 0) {
@@ -1256,8 +1304,12 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1256 offset = frag->page_offset; 1304 offset = frag->page_offset;
1257 1305
1258 temp_len = len; 1306 temp_len = len;
1259 temp_dma = pci_map_page(adapter->pdev, frag->page, offset, 1307 temp_dma = pci_map_page(pdev, frag->page, offset,
1260 len, PCI_DMA_TODEVICE); 1308 len, PCI_DMA_TODEVICE);
1309 if (pci_dma_mapping_error(pdev, temp_dma)) {
1310 netxen_clean_tx_dma_mapping(pdev, pbuf, i);
1311 goto drop_packet;
1312 }
1261 1313
1262 buffrag++; 1314 buffrag++;
1263 buffrag->dma = temp_dma; 1315 buffrag->dma = temp_dma;
@@ -1285,16 +1337,12 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1285 } 1337 }
1286 producer = get_next_index(producer, num_txd); 1338 producer = get_next_index(producer, num_txd);
1287 1339
1288 /* might change opcode to TX_TCP_LSO */
1289 netxen_tso_check(adapter, &hw->cmd_desc_head[saved_producer], skb);
1290
1291 /* For LSO, we need to copy the MAC/IP/TCP headers into 1340 /* For LSO, we need to copy the MAC/IP/TCP headers into
1292 * the descriptor ring 1341 * the descriptor ring
1293 */ 1342 */
1294 if (netxen_get_cmd_desc_opcode(&hw->cmd_desc_head[saved_producer]) 1343 if (is_tso) {
1295 == TX_TCP_LSO) {
1296 int hdr_len, first_hdr_len, more_hdr; 1344 int hdr_len, first_hdr_len, more_hdr;
1297 hdr_len = hw->cmd_desc_head[saved_producer].total_hdr_length; 1345 hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
1298 if (hdr_len > (sizeof(struct cmd_desc_type0) - 2)) { 1346 if (hdr_len > (sizeof(struct cmd_desc_type0) - 2)) {
1299 first_hdr_len = sizeof(struct cmd_desc_type0) - 2; 1347 first_hdr_len = sizeof(struct cmd_desc_type0) - 2;
1300 more_hdr = 1; 1348 more_hdr = 1;
@@ -1336,6 +1384,11 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1336 netdev->trans_start = jiffies; 1384 netdev->trans_start = jiffies;
1337 1385
1338 return NETDEV_TX_OK; 1386 return NETDEV_TX_OK;
1387
1388drop_packet:
1389 adapter->stats.txdropped++;
1390 dev_kfree_skb_any(skb);
1391 return NETDEV_TX_OK;
1339} 1392}
1340 1393
1341static int netxen_nic_check_temp(struct netxen_adapter *adapter) 1394static int netxen_nic_check_temp(struct netxen_adapter *adapter)
@@ -1407,6 +1460,8 @@ static void netxen_nic_handle_phy_intr(struct netxen_adapter *adapter)
1407 netif_carrier_off(netdev); 1460 netif_carrier_off(netdev);
1408 netif_stop_queue(netdev); 1461 netif_stop_queue(netdev);
1409 } 1462 }
1463
1464 netxen_nic_set_link_parameters(adapter);
1410 } else if (!adapter->ahw.linkup && linkup) { 1465 } else if (!adapter->ahw.linkup && linkup) {
1411 printk(KERN_INFO "%s: %s NIC Link is up\n", 1466 printk(KERN_INFO "%s: %s NIC Link is up\n",
1412 netxen_nic_driver_name, netdev->name); 1467 netxen_nic_driver_name, netdev->name);
@@ -1415,6 +1470,8 @@ static void netxen_nic_handle_phy_intr(struct netxen_adapter *adapter)
1415 netif_carrier_on(netdev); 1470 netif_carrier_on(netdev);
1416 netif_wake_queue(netdev); 1471 netif_wake_queue(netdev);
1417 } 1472 }
1473
1474 netxen_nic_set_link_parameters(adapter);
1418 } 1475 }
1419} 1476}
1420 1477