aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/tc35815.c78
1 files changed, 39 insertions, 39 deletions
diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index 1f623e5af948..5f4a14fd564f 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -616,7 +616,7 @@ static int __devinit tc35815_mac_match(struct device *dev, void *data)
616 616
617static int __devinit tc35815_read_plat_dev_addr(struct net_device *dev) 617static int __devinit tc35815_read_plat_dev_addr(struct net_device *dev)
618{ 618{
619 struct tc35815_local *lp = dev->priv; 619 struct tc35815_local *lp = netdev_priv(dev);
620 struct device *pd = bus_find_device(&platform_bus_type, NULL, 620 struct device *pd = bus_find_device(&platform_bus_type, NULL,
621 lp->pci_dev, tc35815_mac_match); 621 lp->pci_dev, tc35815_mac_match);
622 if (pd) { 622 if (pd) {
@@ -686,7 +686,7 @@ static int __devinit tc35815_init_one (struct pci_dev *pdev,
686 return -ENOMEM; 686 return -ENOMEM;
687 } 687 }
688 SET_NETDEV_DEV(dev, &pdev->dev); 688 SET_NETDEV_DEV(dev, &pdev->dev);
689 lp = dev->priv; 689 lp = netdev_priv(dev);
690 lp->dev = dev; 690 lp->dev = dev;
691 691
692 /* enable device (incl. PCI PM wakeup), and bus-mastering */ 692 /* enable device (incl. PCI PM wakeup), and bus-mastering */
@@ -823,7 +823,7 @@ static void __devexit tc35815_remove_one (struct pci_dev *pdev)
823static int 823static int
824tc35815_init_queues(struct net_device *dev) 824tc35815_init_queues(struct net_device *dev)
825{ 825{
826 struct tc35815_local *lp = dev->priv; 826 struct tc35815_local *lp = netdev_priv(dev);
827 int i; 827 int i;
828 unsigned long fd_addr; 828 unsigned long fd_addr;
829 829
@@ -960,7 +960,7 @@ tc35815_init_queues(struct net_device *dev)
960static void 960static void
961tc35815_clear_queues(struct net_device *dev) 961tc35815_clear_queues(struct net_device *dev)
962{ 962{
963 struct tc35815_local *lp = dev->priv; 963 struct tc35815_local *lp = netdev_priv(dev);
964 int i; 964 int i;
965 965
966 for (i = 0; i < TX_FD_NUM; i++) { 966 for (i = 0; i < TX_FD_NUM; i++) {
@@ -991,7 +991,7 @@ tc35815_clear_queues(struct net_device *dev)
991static void 991static void
992tc35815_free_queues(struct net_device *dev) 992tc35815_free_queues(struct net_device *dev)
993{ 993{
994 struct tc35815_local *lp = dev->priv; 994 struct tc35815_local *lp = netdev_priv(dev);
995 int i; 995 int i;
996 996
997 if (lp->tfd_base) { 997 if (lp->tfd_base) {
@@ -1105,7 +1105,7 @@ dump_frfd(struct FrFD *fd)
1105static void 1105static void
1106panic_queues(struct net_device *dev) 1106panic_queues(struct net_device *dev)
1107{ 1107{
1108 struct tc35815_local *lp = dev->priv; 1108 struct tc35815_local *lp = netdev_priv(dev);
1109 int i; 1109 int i;
1110 1110
1111 printk("TxFD base %p, start %u, end %u\n", 1111 printk("TxFD base %p, start %u, end %u\n",
@@ -1136,13 +1136,13 @@ static void print_eth(const u8 *add)
1136 1136
1137static int tc35815_tx_full(struct net_device *dev) 1137static int tc35815_tx_full(struct net_device *dev)
1138{ 1138{
1139 struct tc35815_local *lp = dev->priv; 1139 struct tc35815_local *lp = netdev_priv(dev);
1140 return ((lp->tfd_start + 1) % TX_FD_NUM == lp->tfd_end); 1140 return ((lp->tfd_start + 1) % TX_FD_NUM == lp->tfd_end);
1141} 1141}
1142 1142
1143static void tc35815_restart(struct net_device *dev) 1143static void tc35815_restart(struct net_device *dev)
1144{ 1144{
1145 struct tc35815_local *lp = dev->priv; 1145 struct tc35815_local *lp = netdev_priv(dev);
1146 int pid = lp->phy_addr; 1146 int pid = lp->phy_addr;
1147 int do_phy_reset = 1; 1147 int do_phy_reset = 1;
1148 del_timer(&lp->timer); /* Kill if running */ 1148 del_timer(&lp->timer); /* Kill if running */
@@ -1173,7 +1173,7 @@ static void tc35815_restart(struct net_device *dev)
1173 1173
1174static void tc35815_tx_timeout(struct net_device *dev) 1174static void tc35815_tx_timeout(struct net_device *dev)
1175{ 1175{
1176 struct tc35815_local *lp = dev->priv; 1176 struct tc35815_local *lp = netdev_priv(dev);
1177 struct tc35815_regs __iomem *tr = 1177 struct tc35815_regs __iomem *tr =
1178 (struct tc35815_regs __iomem *)dev->base_addr; 1178 (struct tc35815_regs __iomem *)dev->base_addr;
1179 1179
@@ -1212,7 +1212,7 @@ static void tc35815_tx_timeout(struct net_device *dev)
1212static int 1212static int
1213tc35815_open(struct net_device *dev) 1213tc35815_open(struct net_device *dev)
1214{ 1214{
1215 struct tc35815_local *lp = dev->priv; 1215 struct tc35815_local *lp = netdev_priv(dev);
1216 1216
1217 /* 1217 /*
1218 * This is used if the interrupt line can turned off (shared). 1218 * This is used if the interrupt line can turned off (shared).
@@ -1254,7 +1254,7 @@ tc35815_open(struct net_device *dev)
1254 */ 1254 */
1255static int tc35815_send_packet(struct sk_buff *skb, struct net_device *dev) 1255static int tc35815_send_packet(struct sk_buff *skb, struct net_device *dev)
1256{ 1256{
1257 struct tc35815_local *lp = dev->priv; 1257 struct tc35815_local *lp = netdev_priv(dev);
1258 struct TxFD *txfd; 1258 struct TxFD *txfd;
1259 unsigned long flags; 1259 unsigned long flags;
1260 1260
@@ -1368,7 +1368,7 @@ static int tc35815_do_interrupt(struct net_device *dev, u32 status, int limit)
1368static int tc35815_do_interrupt(struct net_device *dev, u32 status) 1368static int tc35815_do_interrupt(struct net_device *dev, u32 status)
1369#endif 1369#endif
1370{ 1370{
1371 struct tc35815_local *lp = dev->priv; 1371 struct tc35815_local *lp = netdev_priv(dev);
1372 struct tc35815_regs __iomem *tr = 1372 struct tc35815_regs __iomem *tr =
1373 (struct tc35815_regs __iomem *)dev->base_addr; 1373 (struct tc35815_regs __iomem *)dev->base_addr;
1374 int ret = -1; 1374 int ret = -1;
@@ -1485,7 +1485,7 @@ static void
1485tc35815_rx(struct net_device *dev) 1485tc35815_rx(struct net_device *dev)
1486#endif 1486#endif
1487{ 1487{
1488 struct tc35815_local *lp = dev->priv; 1488 struct tc35815_local *lp = netdev_priv(dev);
1489 unsigned int fdctl; 1489 unsigned int fdctl;
1490 int i; 1490 int i;
1491 int buf_free_count = 0; 1491 int buf_free_count = 0;
@@ -1769,7 +1769,7 @@ static int tc35815_poll(struct napi_struct *napi, int budget)
1769static void 1769static void
1770tc35815_check_tx_stat(struct net_device *dev, int status) 1770tc35815_check_tx_stat(struct net_device *dev, int status)
1771{ 1771{
1772 struct tc35815_local *lp = dev->priv; 1772 struct tc35815_local *lp = netdev_priv(dev);
1773 const char *msg = NULL; 1773 const char *msg = NULL;
1774 1774
1775 /* count collisions */ 1775 /* count collisions */
@@ -1846,7 +1846,7 @@ tc35815_check_tx_stat(struct net_device *dev, int status)
1846static void 1846static void
1847tc35815_txdone(struct net_device *dev) 1847tc35815_txdone(struct net_device *dev)
1848{ 1848{
1849 struct tc35815_local *lp = dev->priv; 1849 struct tc35815_local *lp = netdev_priv(dev);
1850 struct TxFD *txfd; 1850 struct TxFD *txfd;
1851 unsigned int fdctl; 1851 unsigned int fdctl;
1852 1852
@@ -1944,7 +1944,7 @@ tc35815_txdone(struct net_device *dev)
1944static int 1944static int
1945tc35815_close(struct net_device *dev) 1945tc35815_close(struct net_device *dev)
1946{ 1946{
1947 struct tc35815_local *lp = dev->priv; 1947 struct tc35815_local *lp = netdev_priv(dev);
1948 1948
1949 netif_stop_queue(dev); 1949 netif_stop_queue(dev);
1950#ifdef TC35815_NAPI 1950#ifdef TC35815_NAPI
@@ -1980,7 +1980,7 @@ static struct net_device_stats *tc35815_get_stats(struct net_device *dev)
1980 1980
1981static void tc35815_set_cam_entry(struct net_device *dev, int index, unsigned char *addr) 1981static void tc35815_set_cam_entry(struct net_device *dev, int index, unsigned char *addr)
1982{ 1982{
1983 struct tc35815_local *lp = dev->priv; 1983 struct tc35815_local *lp = netdev_priv(dev);
1984 struct tc35815_regs __iomem *tr = 1984 struct tc35815_regs __iomem *tr =
1985 (struct tc35815_regs __iomem *)dev->base_addr; 1985 (struct tc35815_regs __iomem *)dev->base_addr;
1986 int cam_index = index * 6; 1986 int cam_index = index * 6;
@@ -2037,7 +2037,7 @@ tc35815_set_multicast_list(struct net_device *dev)
2037#ifdef WORKAROUND_100HALF_PROMISC 2037#ifdef WORKAROUND_100HALF_PROMISC
2038 /* With some (all?) 100MHalf HUB, controller will hang 2038 /* With some (all?) 100MHalf HUB, controller will hang
2039 * if we enabled promiscuous mode before linkup... */ 2039 * if we enabled promiscuous mode before linkup... */
2040 struct tc35815_local *lp = dev->priv; 2040 struct tc35815_local *lp = netdev_priv(dev);
2041 int pid = lp->phy_addr; 2041 int pid = lp->phy_addr;
2042 if (!(tc_mdio_read(dev, pid, MII_BMSR) & BMSR_LSTATUS)) 2042 if (!(tc_mdio_read(dev, pid, MII_BMSR) & BMSR_LSTATUS))
2043 return; 2043 return;
@@ -2077,7 +2077,7 @@ tc35815_set_multicast_list(struct net_device *dev)
2077 2077
2078static void tc35815_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) 2078static void tc35815_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
2079{ 2079{
2080 struct tc35815_local *lp = dev->priv; 2080 struct tc35815_local *lp = netdev_priv(dev);
2081 strcpy(info->driver, MODNAME); 2081 strcpy(info->driver, MODNAME);
2082 strcpy(info->version, DRV_VERSION); 2082 strcpy(info->version, DRV_VERSION);
2083 strcpy(info->bus_info, pci_name(lp->pci_dev)); 2083 strcpy(info->bus_info, pci_name(lp->pci_dev));
@@ -2085,7 +2085,7 @@ static void tc35815_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *
2085 2085
2086static int tc35815_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) 2086static int tc35815_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
2087{ 2087{
2088 struct tc35815_local *lp = dev->priv; 2088 struct tc35815_local *lp = netdev_priv(dev);
2089 spin_lock_irq(&lp->lock); 2089 spin_lock_irq(&lp->lock);
2090 mii_ethtool_gset(&lp->mii, cmd); 2090 mii_ethtool_gset(&lp->mii, cmd);
2091 spin_unlock_irq(&lp->lock); 2091 spin_unlock_irq(&lp->lock);
@@ -2094,7 +2094,7 @@ static int tc35815_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
2094 2094
2095static int tc35815_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) 2095static int tc35815_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
2096{ 2096{
2097 struct tc35815_local *lp = dev->priv; 2097 struct tc35815_local *lp = netdev_priv(dev);
2098 int rc; 2098 int rc;
2099#if 1 /* use our negotiation method... */ 2099#if 1 /* use our negotiation method... */
2100 /* Verify the settings we care about. */ 2100 /* Verify the settings we care about. */
@@ -2124,7 +2124,7 @@ static int tc35815_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
2124 2124
2125static int tc35815_nway_reset(struct net_device *dev) 2125static int tc35815_nway_reset(struct net_device *dev)
2126{ 2126{
2127 struct tc35815_local *lp = dev->priv; 2127 struct tc35815_local *lp = netdev_priv(dev);
2128 int rc; 2128 int rc;
2129 spin_lock_irq(&lp->lock); 2129 spin_lock_irq(&lp->lock);
2130 rc = mii_nway_restart(&lp->mii); 2130 rc = mii_nway_restart(&lp->mii);
@@ -2134,7 +2134,7 @@ static int tc35815_nway_reset(struct net_device *dev)
2134 2134
2135static u32 tc35815_get_link(struct net_device *dev) 2135static u32 tc35815_get_link(struct net_device *dev)
2136{ 2136{
2137 struct tc35815_local *lp = dev->priv; 2137 struct tc35815_local *lp = netdev_priv(dev);
2138 int rc; 2138 int rc;
2139 spin_lock_irq(&lp->lock); 2139 spin_lock_irq(&lp->lock);
2140 rc = mii_link_ok(&lp->mii); 2140 rc = mii_link_ok(&lp->mii);
@@ -2144,19 +2144,19 @@ static u32 tc35815_get_link(struct net_device *dev)
2144 2144
2145static u32 tc35815_get_msglevel(struct net_device *dev) 2145static u32 tc35815_get_msglevel(struct net_device *dev)
2146{ 2146{
2147 struct tc35815_local *lp = dev->priv; 2147 struct tc35815_local *lp = netdev_priv(dev);
2148 return lp->msg_enable; 2148 return lp->msg_enable;
2149} 2149}
2150 2150
2151static void tc35815_set_msglevel(struct net_device *dev, u32 datum) 2151static void tc35815_set_msglevel(struct net_device *dev, u32 datum)
2152{ 2152{
2153 struct tc35815_local *lp = dev->priv; 2153 struct tc35815_local *lp = netdev_priv(dev);
2154 lp->msg_enable = datum; 2154 lp->msg_enable = datum;
2155} 2155}
2156 2156
2157static int tc35815_get_sset_count(struct net_device *dev, int sset) 2157static int tc35815_get_sset_count(struct net_device *dev, int sset)
2158{ 2158{
2159 struct tc35815_local *lp = dev->priv; 2159 struct tc35815_local *lp = netdev_priv(dev);
2160 2160
2161 switch (sset) { 2161 switch (sset) {
2162 case ETH_SS_STATS: 2162 case ETH_SS_STATS:
@@ -2168,7 +2168,7 @@ static int tc35815_get_sset_count(struct net_device *dev, int sset)
2168 2168
2169static void tc35815_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *stats, u64 *data) 2169static void tc35815_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *stats, u64 *data)
2170{ 2170{
2171 struct tc35815_local *lp = dev->priv; 2171 struct tc35815_local *lp = netdev_priv(dev);
2172 data[0] = lp->lstats.max_tx_qlen; 2172 data[0] = lp->lstats.max_tx_qlen;
2173 data[1] = lp->lstats.tx_ints; 2173 data[1] = lp->lstats.tx_ints;
2174 data[2] = lp->lstats.rx_ints; 2174 data[2] = lp->lstats.rx_ints;
@@ -2204,7 +2204,7 @@ static const struct ethtool_ops tc35815_ethtool_ops = {
2204 2204
2205static int tc35815_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 2205static int tc35815_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
2206{ 2206{
2207 struct tc35815_local *lp = dev->priv; 2207 struct tc35815_local *lp = netdev_priv(dev);
2208 int rc; 2208 int rc;
2209 2209
2210 if (!netif_running(dev)) 2210 if (!netif_running(dev))
@@ -2276,7 +2276,7 @@ static void tc_mdio_write(struct net_device *dev, int phy_id, int location,
2276 2276
2277static int tc35815_try_next_permutation(struct net_device *dev) 2277static int tc35815_try_next_permutation(struct net_device *dev)
2278{ 2278{
2279 struct tc35815_local *lp = dev->priv; 2279 struct tc35815_local *lp = netdev_priv(dev);
2280 int pid = lp->phy_addr; 2280 int pid = lp->phy_addr;
2281 unsigned short bmcr; 2281 unsigned short bmcr;
2282 2282
@@ -2305,7 +2305,7 @@ static int tc35815_try_next_permutation(struct net_device *dev)
2305static void 2305static void
2306tc35815_display_link_mode(struct net_device *dev) 2306tc35815_display_link_mode(struct net_device *dev)
2307{ 2307{
2308 struct tc35815_local *lp = dev->priv; 2308 struct tc35815_local *lp = netdev_priv(dev);
2309 int pid = lp->phy_addr; 2309 int pid = lp->phy_addr;
2310 unsigned short lpa, bmcr; 2310 unsigned short lpa, bmcr;
2311 char *speed = "", *duplex = ""; 2311 char *speed = "", *duplex = "";
@@ -2331,7 +2331,7 @@ tc35815_display_link_mode(struct net_device *dev)
2331 2331
2332static void tc35815_display_forced_link_mode(struct net_device *dev) 2332static void tc35815_display_forced_link_mode(struct net_device *dev)
2333{ 2333{
2334 struct tc35815_local *lp = dev->priv; 2334 struct tc35815_local *lp = netdev_priv(dev);
2335 int pid = lp->phy_addr; 2335 int pid = lp->phy_addr;
2336 unsigned short bmcr; 2336 unsigned short bmcr;
2337 char *speed = "", *duplex = ""; 2337 char *speed = "", *duplex = "";
@@ -2353,7 +2353,7 @@ static void tc35815_display_forced_link_mode(struct net_device *dev)
2353 2353
2354static void tc35815_set_link_modes(struct net_device *dev) 2354static void tc35815_set_link_modes(struct net_device *dev)
2355{ 2355{
2356 struct tc35815_local *lp = dev->priv; 2356 struct tc35815_local *lp = netdev_priv(dev);
2357 struct tc35815_regs __iomem *tr = 2357 struct tc35815_regs __iomem *tr =
2358 (struct tc35815_regs __iomem *)dev->base_addr; 2358 (struct tc35815_regs __iomem *)dev->base_addr;
2359 int pid = lp->phy_addr; 2359 int pid = lp->phy_addr;
@@ -2420,7 +2420,7 @@ static void tc35815_set_link_modes(struct net_device *dev)
2420static void tc35815_timer(unsigned long data) 2420static void tc35815_timer(unsigned long data)
2421{ 2421{
2422 struct net_device *dev = (struct net_device *)data; 2422 struct net_device *dev = (struct net_device *)data;
2423 struct tc35815_local *lp = dev->priv; 2423 struct tc35815_local *lp = netdev_priv(dev);
2424 int pid = lp->phy_addr; 2424 int pid = lp->phy_addr;
2425 unsigned short bmsr, bmcr, lpa; 2425 unsigned short bmsr, bmcr, lpa;
2426 int restart_timer = 0; 2426 int restart_timer = 0;
@@ -2628,7 +2628,7 @@ out:
2628static void tc35815_start_auto_negotiation(struct net_device *dev, 2628static void tc35815_start_auto_negotiation(struct net_device *dev,
2629 struct ethtool_cmd *ep) 2629 struct ethtool_cmd *ep)
2630{ 2630{
2631 struct tc35815_local *lp = dev->priv; 2631 struct tc35815_local *lp = netdev_priv(dev);
2632 int pid = lp->phy_addr; 2632 int pid = lp->phy_addr;
2633 unsigned short bmsr, bmcr, advertize; 2633 unsigned short bmsr, bmcr, advertize;
2634 int timeout; 2634 int timeout;
@@ -2752,7 +2752,7 @@ force_link:
2752 2752
2753static void tc35815_find_phy(struct net_device *dev) 2753static void tc35815_find_phy(struct net_device *dev)
2754{ 2754{
2755 struct tc35815_local *lp = dev->priv; 2755 struct tc35815_local *lp = netdev_priv(dev);
2756 int pid = lp->phy_addr; 2756 int pid = lp->phy_addr;
2757 unsigned short id0; 2757 unsigned short id0;
2758 2758
@@ -2781,7 +2781,7 @@ static void tc35815_find_phy(struct net_device *dev)
2781 2781
2782static void tc35815_phy_chip_init(struct net_device *dev) 2782static void tc35815_phy_chip_init(struct net_device *dev)
2783{ 2783{
2784 struct tc35815_local *lp = dev->priv; 2784 struct tc35815_local *lp = netdev_priv(dev);
2785 int pid = lp->phy_addr; 2785 int pid = lp->phy_addr;
2786 unsigned short bmcr; 2786 unsigned short bmcr;
2787 struct ethtool_cmd ecmd, *ep; 2787 struct ethtool_cmd ecmd, *ep;
@@ -2855,7 +2855,7 @@ static void tc35815_chip_reset(struct net_device *dev)
2855 2855
2856static void tc35815_chip_init(struct net_device *dev) 2856static void tc35815_chip_init(struct net_device *dev)
2857{ 2857{
2858 struct tc35815_local *lp = dev->priv; 2858 struct tc35815_local *lp = netdev_priv(dev);
2859 struct tc35815_regs __iomem *tr = 2859 struct tc35815_regs __iomem *tr =
2860 (struct tc35815_regs __iomem *)dev->base_addr; 2860 (struct tc35815_regs __iomem *)dev->base_addr;
2861 unsigned long txctl = TX_CTL_CMD; 2861 unsigned long txctl = TX_CTL_CMD;
@@ -2917,7 +2917,7 @@ static void tc35815_chip_init(struct net_device *dev)
2917static int tc35815_suspend(struct pci_dev *pdev, pm_message_t state) 2917static int tc35815_suspend(struct pci_dev *pdev, pm_message_t state)
2918{ 2918{
2919 struct net_device *dev = pci_get_drvdata(pdev); 2919 struct net_device *dev = pci_get_drvdata(pdev);
2920 struct tc35815_local *lp = dev->priv; 2920 struct tc35815_local *lp = netdev_priv(dev);
2921 unsigned long flags; 2921 unsigned long flags;
2922 2922
2923 pci_save_state(pdev); 2923 pci_save_state(pdev);
@@ -2935,7 +2935,7 @@ static int tc35815_suspend(struct pci_dev *pdev, pm_message_t state)
2935static int tc35815_resume(struct pci_dev *pdev) 2935static int tc35815_resume(struct pci_dev *pdev)
2936{ 2936{
2937 struct net_device *dev = pci_get_drvdata(pdev); 2937 struct net_device *dev = pci_get_drvdata(pdev);
2938 struct tc35815_local *lp = dev->priv; 2938 struct tc35815_local *lp = netdev_priv(dev);
2939 unsigned long flags; 2939 unsigned long flags;
2940 2940
2941 pci_restore_state(pdev); 2941 pci_restore_state(pdev);