diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-06-27 22:50:10 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-06-27 22:50:10 -0400 |
commit | aa8f6dfd355021b4dd8b74b0588fd6fd8f21b79f (patch) | |
tree | 57ca3e27227695acbd97408eabb0f967726c3b51 /drivers/net/e1000/e1000_main.c | |
parent | f45727d52d1581e9ff4df9d1a12a60789ad2d1eb (diff) | |
parent | 245ac8738b0b840552d56b842e70e750d65911cc (diff) |
Merge /spare/repo/netdev-2.6 branch 'ieee80211'
Diffstat (limited to 'drivers/net/e1000/e1000_main.c')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 111 |
1 files changed, 68 insertions, 43 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 137226d98d47..cb7f051a60ad 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -29,6 +29,8 @@ | |||
29 | #include "e1000.h" | 29 | #include "e1000.h" |
30 | 30 | ||
31 | /* Change Log | 31 | /* Change Log |
32 | * 6.0.58 4/20/05 | ||
33 | * o Accepted ethtool cleanup patch from Stephen Hemminger | ||
32 | * 6.0.44+ 2/15/05 | 34 | * 6.0.44+ 2/15/05 |
33 | * o applied Anton's patch to resolve tx hang in hardware | 35 | * o applied Anton's patch to resolve tx hang in hardware |
34 | * o Applied Andrew Mortons patch - e1000 stops working after resume | 36 | * o Applied Andrew Mortons patch - e1000 stops working after resume |
@@ -41,9 +43,9 @@ char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; | |||
41 | #else | 43 | #else |
42 | #define DRIVERNAPI "-NAPI" | 44 | #define DRIVERNAPI "-NAPI" |
43 | #endif | 45 | #endif |
44 | #define DRV_VERSION "6.0.54-k2"DRIVERNAPI | 46 | #define DRV_VERSION "6.0.60-k2"DRIVERNAPI |
45 | char e1000_driver_version[] = DRV_VERSION; | 47 | char e1000_driver_version[] = DRV_VERSION; |
46 | char e1000_copyright[] = "Copyright (c) 1999-2004 Intel Corporation."; | 48 | char e1000_copyright[] = "Copyright (c) 1999-2005 Intel Corporation."; |
47 | 49 | ||
48 | /* e1000_pci_tbl - PCI Device ID Table | 50 | /* e1000_pci_tbl - PCI Device ID Table |
49 | * | 51 | * |
@@ -517,7 +519,7 @@ e1000_probe(struct pci_dev *pdev, | |||
517 | SET_NETDEV_DEV(netdev, &pdev->dev); | 519 | SET_NETDEV_DEV(netdev, &pdev->dev); |
518 | 520 | ||
519 | pci_set_drvdata(pdev, netdev); | 521 | pci_set_drvdata(pdev, netdev); |
520 | adapter = netdev->priv; | 522 | adapter = netdev_priv(netdev); |
521 | adapter->netdev = netdev; | 523 | adapter->netdev = netdev; |
522 | adapter->pdev = pdev; | 524 | adapter->pdev = pdev; |
523 | adapter->hw.back = adapter; | 525 | adapter->hw.back = adapter; |
@@ -738,7 +740,7 @@ static void __devexit | |||
738 | e1000_remove(struct pci_dev *pdev) | 740 | e1000_remove(struct pci_dev *pdev) |
739 | { | 741 | { |
740 | struct net_device *netdev = pci_get_drvdata(pdev); | 742 | struct net_device *netdev = pci_get_drvdata(pdev); |
741 | struct e1000_adapter *adapter = netdev->priv; | 743 | struct e1000_adapter *adapter = netdev_priv(netdev); |
742 | uint32_t manc, swsm; | 744 | uint32_t manc, swsm; |
743 | 745 | ||
744 | flush_scheduled_work(); | 746 | flush_scheduled_work(); |
@@ -871,7 +873,7 @@ e1000_sw_init(struct e1000_adapter *adapter) | |||
871 | static int | 873 | static int |
872 | e1000_open(struct net_device *netdev) | 874 | e1000_open(struct net_device *netdev) |
873 | { | 875 | { |
874 | struct e1000_adapter *adapter = netdev->priv; | 876 | struct e1000_adapter *adapter = netdev_priv(netdev); |
875 | int err; | 877 | int err; |
876 | 878 | ||
877 | /* allocate transmit descriptors */ | 879 | /* allocate transmit descriptors */ |
@@ -919,7 +921,7 @@ err_setup_tx: | |||
919 | static int | 921 | static int |
920 | e1000_close(struct net_device *netdev) | 922 | e1000_close(struct net_device *netdev) |
921 | { | 923 | { |
922 | struct e1000_adapter *adapter = netdev->priv; | 924 | struct e1000_adapter *adapter = netdev_priv(netdev); |
923 | 925 | ||
924 | e1000_down(adapter); | 926 | e1000_down(adapter); |
925 | 927 | ||
@@ -1599,7 +1601,7 @@ e1000_leave_82542_rst(struct e1000_adapter *adapter) | |||
1599 | static int | 1601 | static int |
1600 | e1000_set_mac(struct net_device *netdev, void *p) | 1602 | e1000_set_mac(struct net_device *netdev, void *p) |
1601 | { | 1603 | { |
1602 | struct e1000_adapter *adapter = netdev->priv; | 1604 | struct e1000_adapter *adapter = netdev_priv(netdev); |
1603 | struct sockaddr *addr = p; | 1605 | struct sockaddr *addr = p; |
1604 | 1606 | ||
1605 | if(!is_valid_ether_addr(addr->sa_data)) | 1607 | if(!is_valid_ether_addr(addr->sa_data)) |
@@ -1634,7 +1636,7 @@ e1000_set_mac(struct net_device *netdev, void *p) | |||
1634 | static void | 1636 | static void |
1635 | e1000_set_multi(struct net_device *netdev) | 1637 | e1000_set_multi(struct net_device *netdev) |
1636 | { | 1638 | { |
1637 | struct e1000_adapter *adapter = netdev->priv; | 1639 | struct e1000_adapter *adapter = netdev_priv(netdev); |
1638 | struct e1000_hw *hw = &adapter->hw; | 1640 | struct e1000_hw *hw = &adapter->hw; |
1639 | struct dev_mc_list *mc_ptr; | 1641 | struct dev_mc_list *mc_ptr; |
1640 | unsigned long flags; | 1642 | unsigned long flags; |
@@ -2213,7 +2215,7 @@ e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb) | |||
2213 | static int | 2215 | static int |
2214 | e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | 2216 | e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) |
2215 | { | 2217 | { |
2216 | struct e1000_adapter *adapter = netdev->priv; | 2218 | struct e1000_adapter *adapter = netdev_priv(netdev); |
2217 | unsigned int first, max_per_txd = E1000_MAX_DATA_PER_TXD; | 2219 | unsigned int first, max_per_txd = E1000_MAX_DATA_PER_TXD; |
2218 | unsigned int max_txd_pwr = E1000_MAX_TXD_PWR; | 2220 | unsigned int max_txd_pwr = E1000_MAX_TXD_PWR; |
2219 | unsigned int tx_flags = 0; | 2221 | unsigned int tx_flags = 0; |
@@ -2344,7 +2346,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
2344 | static void | 2346 | static void |
2345 | e1000_tx_timeout(struct net_device *netdev) | 2347 | e1000_tx_timeout(struct net_device *netdev) |
2346 | { | 2348 | { |
2347 | struct e1000_adapter *adapter = netdev->priv; | 2349 | struct e1000_adapter *adapter = netdev_priv(netdev); |
2348 | 2350 | ||
2349 | /* Do the reset outside of interrupt context */ | 2351 | /* Do the reset outside of interrupt context */ |
2350 | schedule_work(&adapter->tx_timeout_task); | 2352 | schedule_work(&adapter->tx_timeout_task); |
@@ -2353,7 +2355,7 @@ e1000_tx_timeout(struct net_device *netdev) | |||
2353 | static void | 2355 | static void |
2354 | e1000_tx_timeout_task(struct net_device *netdev) | 2356 | e1000_tx_timeout_task(struct net_device *netdev) |
2355 | { | 2357 | { |
2356 | struct e1000_adapter *adapter = netdev->priv; | 2358 | struct e1000_adapter *adapter = netdev_priv(netdev); |
2357 | 2359 | ||
2358 | e1000_down(adapter); | 2360 | e1000_down(adapter); |
2359 | e1000_up(adapter); | 2361 | e1000_up(adapter); |
@@ -2370,7 +2372,7 @@ e1000_tx_timeout_task(struct net_device *netdev) | |||
2370 | static struct net_device_stats * | 2372 | static struct net_device_stats * |
2371 | e1000_get_stats(struct net_device *netdev) | 2373 | e1000_get_stats(struct net_device *netdev) |
2372 | { | 2374 | { |
2373 | struct e1000_adapter *adapter = netdev->priv; | 2375 | struct e1000_adapter *adapter = netdev_priv(netdev); |
2374 | 2376 | ||
2375 | e1000_update_stats(adapter); | 2377 | e1000_update_stats(adapter); |
2376 | return &adapter->net_stats; | 2378 | return &adapter->net_stats; |
@@ -2387,7 +2389,7 @@ e1000_get_stats(struct net_device *netdev) | |||
2387 | static int | 2389 | static int |
2388 | e1000_change_mtu(struct net_device *netdev, int new_mtu) | 2390 | e1000_change_mtu(struct net_device *netdev, int new_mtu) |
2389 | { | 2391 | { |
2390 | struct e1000_adapter *adapter = netdev->priv; | 2392 | struct e1000_adapter *adapter = netdev_priv(netdev); |
2391 | int max_frame = new_mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE; | 2393 | int max_frame = new_mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE; |
2392 | 2394 | ||
2393 | if((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) || | 2395 | if((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) || |
@@ -2598,7 +2600,7 @@ static irqreturn_t | |||
2598 | e1000_intr(int irq, void *data, struct pt_regs *regs) | 2600 | e1000_intr(int irq, void *data, struct pt_regs *regs) |
2599 | { | 2601 | { |
2600 | struct net_device *netdev = data; | 2602 | struct net_device *netdev = data; |
2601 | struct e1000_adapter *adapter = netdev->priv; | 2603 | struct e1000_adapter *adapter = netdev_priv(netdev); |
2602 | struct e1000_hw *hw = &adapter->hw; | 2604 | struct e1000_hw *hw = &adapter->hw; |
2603 | uint32_t icr = E1000_READ_REG(hw, ICR); | 2605 | uint32_t icr = E1000_READ_REG(hw, ICR); |
2604 | #ifndef CONFIG_E1000_NAPI | 2606 | #ifndef CONFIG_E1000_NAPI |
@@ -2661,7 +2663,7 @@ e1000_intr(int irq, void *data, struct pt_regs *regs) | |||
2661 | static int | 2663 | static int |
2662 | e1000_clean(struct net_device *netdev, int *budget) | 2664 | e1000_clean(struct net_device *netdev, int *budget) |
2663 | { | 2665 | { |
2664 | struct e1000_adapter *adapter = netdev->priv; | 2666 | struct e1000_adapter *adapter = netdev_priv(netdev); |
2665 | int work_to_do = min(*budget, netdev->quota); | 2667 | int work_to_do = min(*budget, netdev->quota); |
2666 | int tx_cleaned; | 2668 | int tx_cleaned; |
2667 | int work_done = 0; | 2669 | int work_done = 0; |
@@ -2672,8 +2674,8 @@ e1000_clean(struct net_device *netdev, int *budget) | |||
2672 | *budget -= work_done; | 2674 | *budget -= work_done; |
2673 | netdev->quota -= work_done; | 2675 | netdev->quota -= work_done; |
2674 | 2676 | ||
2675 | /* If no Tx and no Rx work done, exit the polling mode */ | ||
2676 | if ((!tx_cleaned && (work_done == 0)) || !netif_running(netdev)) { | 2677 | if ((!tx_cleaned && (work_done == 0)) || !netif_running(netdev)) { |
2678 | /* If no Tx and not enough Rx work done, exit the polling mode */ | ||
2677 | netif_rx_complete(netdev); | 2679 | netif_rx_complete(netdev); |
2678 | e1000_irq_enable(adapter); | 2680 | e1000_irq_enable(adapter); |
2679 | return 0; | 2681 | return 0; |
@@ -2769,13 +2771,13 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter) | |||
2769 | i = tx_ring->next_to_clean; | 2771 | i = tx_ring->next_to_clean; |
2770 | eop = tx_ring->buffer_info[i].next_to_watch; | 2772 | eop = tx_ring->buffer_info[i].next_to_watch; |
2771 | eop_desc = E1000_TX_DESC(*tx_ring, eop); | 2773 | eop_desc = E1000_TX_DESC(*tx_ring, eop); |
2772 | DPRINTK(TX_ERR, ERR, "Detected Tx Unit Hang\n" | 2774 | DPRINTK(DRV, ERR, "Detected Tx Unit Hang\n" |
2773 | " TDH <%x>\n" | 2775 | " TDH <%x>\n" |
2774 | " TDT <%x>\n" | 2776 | " TDT <%x>\n" |
2775 | " next_to_use <%x>\n" | 2777 | " next_to_use <%x>\n" |
2776 | " next_to_clean <%x>\n" | 2778 | " next_to_clean <%x>\n" |
2777 | "buffer_info[next_to_clean]\n" | 2779 | "buffer_info[next_to_clean]\n" |
2778 | " dma <%llx>\n" | 2780 | " dma <%zx>\n" |
2779 | " time_stamp <%lx>\n" | 2781 | " time_stamp <%lx>\n" |
2780 | " next_to_watch <%x>\n" | 2782 | " next_to_watch <%x>\n" |
2781 | " jiffies <%lx>\n" | 2783 | " jiffies <%lx>\n" |
@@ -2994,7 +2996,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter) | |||
2994 | 2996 | ||
2995 | i = rx_ring->next_to_clean; | 2997 | i = rx_ring->next_to_clean; |
2996 | rx_desc = E1000_RX_DESC_PS(*rx_ring, i); | 2998 | rx_desc = E1000_RX_DESC_PS(*rx_ring, i); |
2997 | staterr = rx_desc->wb.middle.status_error; | 2999 | staterr = le32_to_cpu(rx_desc->wb.middle.status_error); |
2998 | 3000 | ||
2999 | while(staterr & E1000_RXD_STAT_DD) { | 3001 | while(staterr & E1000_RXD_STAT_DD) { |
3000 | buffer_info = &rx_ring->buffer_info[i]; | 3002 | buffer_info = &rx_ring->buffer_info[i]; |
@@ -3065,16 +3067,16 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter) | |||
3065 | #ifdef CONFIG_E1000_NAPI | 3067 | #ifdef CONFIG_E1000_NAPI |
3066 | if(unlikely(adapter->vlgrp && (staterr & E1000_RXD_STAT_VP))) { | 3068 | if(unlikely(adapter->vlgrp && (staterr & E1000_RXD_STAT_VP))) { |
3067 | vlan_hwaccel_receive_skb(skb, adapter->vlgrp, | 3069 | vlan_hwaccel_receive_skb(skb, adapter->vlgrp, |
3068 | le16_to_cpu(rx_desc->wb.middle.vlan & | 3070 | le16_to_cpu(rx_desc->wb.middle.vlan) & |
3069 | E1000_RXD_SPC_VLAN_MASK)); | 3071 | E1000_RXD_SPC_VLAN_MASK); |
3070 | } else { | 3072 | } else { |
3071 | netif_receive_skb(skb); | 3073 | netif_receive_skb(skb); |
3072 | } | 3074 | } |
3073 | #else /* CONFIG_E1000_NAPI */ | 3075 | #else /* CONFIG_E1000_NAPI */ |
3074 | if(unlikely(adapter->vlgrp && (staterr & E1000_RXD_STAT_VP))) { | 3076 | if(unlikely(adapter->vlgrp && (staterr & E1000_RXD_STAT_VP))) { |
3075 | vlan_hwaccel_rx(skb, adapter->vlgrp, | 3077 | vlan_hwaccel_rx(skb, adapter->vlgrp, |
3076 | le16_to_cpu(rx_desc->wb.middle.vlan & | 3078 | le16_to_cpu(rx_desc->wb.middle.vlan) & |
3077 | E1000_RXD_SPC_VLAN_MASK)); | 3079 | E1000_RXD_SPC_VLAN_MASK); |
3078 | } else { | 3080 | } else { |
3079 | netif_rx(skb); | 3081 | netif_rx(skb); |
3080 | } | 3082 | } |
@@ -3087,7 +3089,7 @@ next_desc: | |||
3087 | if(unlikely(++i == rx_ring->count)) i = 0; | 3089 | if(unlikely(++i == rx_ring->count)) i = 0; |
3088 | 3090 | ||
3089 | rx_desc = E1000_RX_DESC_PS(*rx_ring, i); | 3091 | rx_desc = E1000_RX_DESC_PS(*rx_ring, i); |
3090 | staterr = rx_desc->wb.middle.status_error; | 3092 | staterr = le32_to_cpu(rx_desc->wb.middle.status_error); |
3091 | } | 3093 | } |
3092 | rx_ring->next_to_clean = i; | 3094 | rx_ring->next_to_clean = i; |
3093 | adapter->alloc_rx_buf(adapter); | 3095 | adapter->alloc_rx_buf(adapter); |
@@ -3371,11 +3373,12 @@ e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) | |||
3371 | static int | 3373 | static int |
3372 | e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) | 3374 | e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) |
3373 | { | 3375 | { |
3374 | struct e1000_adapter *adapter = netdev->priv; | 3376 | struct e1000_adapter *adapter = netdev_priv(netdev); |
3375 | struct mii_ioctl_data *data = if_mii(ifr); | 3377 | struct mii_ioctl_data *data = if_mii(ifr); |
3376 | int retval; | 3378 | int retval; |
3377 | uint16_t mii_reg; | 3379 | uint16_t mii_reg; |
3378 | uint16_t spddplx; | 3380 | uint16_t spddplx; |
3381 | unsigned long flags; | ||
3379 | 3382 | ||
3380 | if(adapter->hw.media_type != e1000_media_type_copper) | 3383 | if(adapter->hw.media_type != e1000_media_type_copper) |
3381 | return -EOPNOTSUPP; | 3384 | return -EOPNOTSUPP; |
@@ -3385,22 +3388,29 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) | |||
3385 | data->phy_id = adapter->hw.phy_addr; | 3388 | data->phy_id = adapter->hw.phy_addr; |
3386 | break; | 3389 | break; |
3387 | case SIOCGMIIREG: | 3390 | case SIOCGMIIREG: |
3388 | if (!capable(CAP_NET_ADMIN)) | 3391 | if(!capable(CAP_NET_ADMIN)) |
3389 | return -EPERM; | 3392 | return -EPERM; |
3390 | if (e1000_read_phy_reg(&adapter->hw, data->reg_num & 0x1F, | 3393 | spin_lock_irqsave(&adapter->stats_lock, flags); |
3391 | &data->val_out)) | 3394 | if(e1000_read_phy_reg(&adapter->hw, data->reg_num & 0x1F, |
3395 | &data->val_out)) { | ||
3396 | spin_unlock_irqrestore(&adapter->stats_lock, flags); | ||
3392 | return -EIO; | 3397 | return -EIO; |
3398 | } | ||
3399 | spin_unlock_irqrestore(&adapter->stats_lock, flags); | ||
3393 | break; | 3400 | break; |
3394 | case SIOCSMIIREG: | 3401 | case SIOCSMIIREG: |
3395 | if (!capable(CAP_NET_ADMIN)) | 3402 | if(!capable(CAP_NET_ADMIN)) |
3396 | return -EPERM; | 3403 | return -EPERM; |
3397 | if (data->reg_num & ~(0x1F)) | 3404 | if(data->reg_num & ~(0x1F)) |
3398 | return -EFAULT; | 3405 | return -EFAULT; |
3399 | mii_reg = data->val_in; | 3406 | mii_reg = data->val_in; |
3400 | if (e1000_write_phy_reg(&adapter->hw, data->reg_num, | 3407 | spin_lock_irqsave(&adapter->stats_lock, flags); |
3401 | mii_reg)) | 3408 | if(e1000_write_phy_reg(&adapter->hw, data->reg_num, |
3409 | mii_reg)) { | ||
3410 | spin_unlock_irqrestore(&adapter->stats_lock, flags); | ||
3402 | return -EIO; | 3411 | return -EIO; |
3403 | if (adapter->hw.phy_type == e1000_phy_m88) { | 3412 | } |
3413 | if(adapter->hw.phy_type == e1000_phy_m88) { | ||
3404 | switch (data->reg_num) { | 3414 | switch (data->reg_num) { |
3405 | case PHY_CTRL: | 3415 | case PHY_CTRL: |
3406 | if(mii_reg & MII_CR_POWER_DOWN) | 3416 | if(mii_reg & MII_CR_POWER_DOWN) |
@@ -3420,8 +3430,12 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) | |||
3420 | HALF_DUPLEX; | 3430 | HALF_DUPLEX; |
3421 | retval = e1000_set_spd_dplx(adapter, | 3431 | retval = e1000_set_spd_dplx(adapter, |
3422 | spddplx); | 3432 | spddplx); |
3423 | if(retval) | 3433 | if(retval) { |
3434 | spin_unlock_irqrestore( | ||
3435 | &adapter->stats_lock, | ||
3436 | flags); | ||
3424 | return retval; | 3437 | return retval; |
3438 | } | ||
3425 | } | 3439 | } |
3426 | if(netif_running(adapter->netdev)) { | 3440 | if(netif_running(adapter->netdev)) { |
3427 | e1000_down(adapter); | 3441 | e1000_down(adapter); |
@@ -3431,8 +3445,11 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) | |||
3431 | break; | 3445 | break; |
3432 | case M88E1000_PHY_SPEC_CTRL: | 3446 | case M88E1000_PHY_SPEC_CTRL: |
3433 | case M88E1000_EXT_PHY_SPEC_CTRL: | 3447 | case M88E1000_EXT_PHY_SPEC_CTRL: |
3434 | if (e1000_phy_reset(&adapter->hw)) | 3448 | if(e1000_phy_reset(&adapter->hw)) { |
3449 | spin_unlock_irqrestore( | ||
3450 | &adapter->stats_lock, flags); | ||
3435 | return -EIO; | 3451 | return -EIO; |
3452 | } | ||
3436 | break; | 3453 | break; |
3437 | } | 3454 | } |
3438 | } else { | 3455 | } else { |
@@ -3448,6 +3465,7 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) | |||
3448 | break; | 3465 | break; |
3449 | } | 3466 | } |
3450 | } | 3467 | } |
3468 | spin_unlock_irqrestore(&adapter->stats_lock, flags); | ||
3451 | break; | 3469 | break; |
3452 | default: | 3470 | default: |
3453 | return -EOPNOTSUPP; | 3471 | return -EOPNOTSUPP; |
@@ -3504,7 +3522,7 @@ e1000_io_write(struct e1000_hw *hw, unsigned long port, uint32_t value) | |||
3504 | static void | 3522 | static void |
3505 | e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) | 3523 | e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) |
3506 | { | 3524 | { |
3507 | struct e1000_adapter *adapter = netdev->priv; | 3525 | struct e1000_adapter *adapter = netdev_priv(netdev); |
3508 | uint32_t ctrl, rctl; | 3526 | uint32_t ctrl, rctl; |
3509 | 3527 | ||
3510 | e1000_irq_disable(adapter); | 3528 | e1000_irq_disable(adapter); |
@@ -3544,7 +3562,7 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) | |||
3544 | static void | 3562 | static void |
3545 | e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid) | 3563 | e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid) |
3546 | { | 3564 | { |
3547 | struct e1000_adapter *adapter = netdev->priv; | 3565 | struct e1000_adapter *adapter = netdev_priv(netdev); |
3548 | uint32_t vfta, index; | 3566 | uint32_t vfta, index; |
3549 | if((adapter->hw.mng_cookie.status & | 3567 | if((adapter->hw.mng_cookie.status & |
3550 | E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) && | 3568 | E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) && |
@@ -3560,7 +3578,7 @@ e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid) | |||
3560 | static void | 3578 | static void |
3561 | e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid) | 3579 | e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid) |
3562 | { | 3580 | { |
3563 | struct e1000_adapter *adapter = netdev->priv; | 3581 | struct e1000_adapter *adapter = netdev_priv(netdev); |
3564 | uint32_t vfta, index; | 3582 | uint32_t vfta, index; |
3565 | 3583 | ||
3566 | e1000_irq_disable(adapter); | 3584 | e1000_irq_disable(adapter); |
@@ -3601,6 +3619,13 @@ e1000_set_spd_dplx(struct e1000_adapter *adapter, uint16_t spddplx) | |||
3601 | { | 3619 | { |
3602 | adapter->hw.autoneg = 0; | 3620 | adapter->hw.autoneg = 0; |
3603 | 3621 | ||
3622 | /* Fiber NICs only allow 1000 gbps Full duplex */ | ||
3623 | if((adapter->hw.media_type == e1000_media_type_fiber) && | ||
3624 | spddplx != (SPEED_1000 + DUPLEX_FULL)) { | ||
3625 | DPRINTK(PROBE, ERR, "Unsupported Speed/Duplex configuration\n"); | ||
3626 | return -EINVAL; | ||
3627 | } | ||
3628 | |||
3604 | switch(spddplx) { | 3629 | switch(spddplx) { |
3605 | case SPEED_10 + DUPLEX_HALF: | 3630 | case SPEED_10 + DUPLEX_HALF: |
3606 | adapter->hw.forced_speed_duplex = e1000_10_half; | 3631 | adapter->hw.forced_speed_duplex = e1000_10_half; |
@@ -3647,7 +3672,7 @@ static int | |||
3647 | e1000_suspend(struct pci_dev *pdev, uint32_t state) | 3672 | e1000_suspend(struct pci_dev *pdev, uint32_t state) |
3648 | { | 3673 | { |
3649 | struct net_device *netdev = pci_get_drvdata(pdev); | 3674 | struct net_device *netdev = pci_get_drvdata(pdev); |
3650 | struct e1000_adapter *adapter = netdev->priv; | 3675 | struct e1000_adapter *adapter = netdev_priv(netdev); |
3651 | uint32_t ctrl, ctrl_ext, rctl, manc, status, swsm; | 3676 | uint32_t ctrl, ctrl_ext, rctl, manc, status, swsm; |
3652 | uint32_t wufc = adapter->wol; | 3677 | uint32_t wufc = adapter->wol; |
3653 | 3678 | ||
@@ -3740,12 +3765,12 @@ static int | |||
3740 | e1000_resume(struct pci_dev *pdev) | 3765 | e1000_resume(struct pci_dev *pdev) |
3741 | { | 3766 | { |
3742 | struct net_device *netdev = pci_get_drvdata(pdev); | 3767 | struct net_device *netdev = pci_get_drvdata(pdev); |
3743 | struct e1000_adapter *adapter = netdev->priv; | 3768 | struct e1000_adapter *adapter = netdev_priv(netdev); |
3744 | uint32_t manc, ret, swsm; | 3769 | uint32_t manc, ret_val, swsm; |
3745 | 3770 | ||
3746 | pci_set_power_state(pdev, 0); | 3771 | pci_set_power_state(pdev, 0); |
3747 | pci_restore_state(pdev); | 3772 | pci_restore_state(pdev); |
3748 | ret = pci_enable_device(pdev); | 3773 | ret_val = pci_enable_device(pdev); |
3749 | pci_set_master(pdev); | 3774 | pci_set_master(pdev); |
3750 | 3775 | ||
3751 | pci_enable_wake(pdev, 3, 0); | 3776 | pci_enable_wake(pdev, 3, 0); |
@@ -3788,7 +3813,7 @@ e1000_resume(struct pci_dev *pdev) | |||
3788 | static void | 3813 | static void |
3789 | e1000_netpoll(struct net_device *netdev) | 3814 | e1000_netpoll(struct net_device *netdev) |
3790 | { | 3815 | { |
3791 | struct e1000_adapter *adapter = netdev->priv; | 3816 | struct e1000_adapter *adapter = netdev_priv(netdev); |
3792 | disable_irq(adapter->pdev->irq); | 3817 | disable_irq(adapter->pdev->irq); |
3793 | e1000_intr(adapter->pdev->irq, netdev, NULL); | 3818 | e1000_intr(adapter->pdev->irq, netdev, NULL); |
3794 | enable_irq(adapter->pdev->irq); | 3819 | enable_irq(adapter->pdev->irq); |