Lines Matching refs:tp

460 typhoon_hello(struct typhoon *tp)  in typhoon_hello()  argument
462 struct basic_ring *ring = &tp->cmdRing; in typhoon_hello()
469 if(spin_trylock(&tp->command_lock)) { in typhoon_hello()
475 iowrite32(ring->lastWrite, tp->ioaddr + TYPHOON_REG_CMD_READY); in typhoon_hello()
476 spin_unlock(&tp->command_lock); in typhoon_hello()
481 typhoon_process_response(struct typhoon *tp, int resp_size, in typhoon_process_response() argument
484 struct typhoon_indexes *indexes = tp->indexes; in typhoon_process_response()
486 u8 *base = tp->respRing.ringBase; in typhoon_process_response()
517 typhoon_media_status(tp->dev, resp); in typhoon_process_response()
519 typhoon_hello(tp); in typhoon_process_response()
521 netdev_err(tp->dev, in typhoon_process_response()
551 typhoon_num_free_cmd(struct typhoon *tp) in typhoon_num_free_cmd() argument
553 int lastWrite = tp->cmdRing.lastWrite; in typhoon_num_free_cmd()
554 int cmdCleared = le32_to_cpu(tp->indexes->cmdCleared); in typhoon_num_free_cmd()
560 typhoon_num_free_resp(struct typhoon *tp) in typhoon_num_free_resp() argument
562 int respReady = le32_to_cpu(tp->indexes->respReady); in typhoon_num_free_resp()
563 int respCleared = le32_to_cpu(tp->indexes->respCleared); in typhoon_num_free_resp()
576 typhoon_issue_command(struct typhoon *tp, int num_cmd, struct cmd_desc *cmd, in typhoon_issue_command() argument
579 struct typhoon_indexes *indexes = tp->indexes; in typhoon_issue_command()
580 struct basic_ring *ring = &tp->cmdRing; in typhoon_issue_command()
587 spin_lock(&tp->command_lock); in typhoon_issue_command()
589 freeCmd = typhoon_num_free_cmd(tp); in typhoon_issue_command()
590 freeResp = typhoon_num_free_resp(tp); in typhoon_issue_command()
593 netdev_err(tp->dev, "no descs for cmd, had (needed) %d (%d) cmd, %d (%d) resp\n", in typhoon_issue_command()
603 tp->awaiting_resp = 1; in typhoon_issue_command()
629 iowrite32(ring->lastWrite, tp->ioaddr + TYPHOON_REG_CMD_READY); in typhoon_issue_command()
630 typhoon_post_pci_writes(tp->ioaddr); in typhoon_issue_command()
654 got_resp = typhoon_process_response(tp, num_resp, in typhoon_issue_command()
671 if(tp->awaiting_resp) { in typhoon_issue_command()
672 tp->awaiting_resp = 0; in typhoon_issue_command()
683 iowrite32(1, tp->ioaddr + TYPHOON_REG_SELF_INTERRUPT); in typhoon_issue_command()
686 spin_unlock(&tp->command_lock); in typhoon_issue_command()
714 struct typhoon *tp = netdev_priv(dev); in typhoon_start_tx() local
726 txRing = &tp->txLoRing; in typhoon_start_tx()
783 typhoon_tso_fill(skb, txRing, tp->txlo_dma_addr); in typhoon_start_tx()
793 skb_dma = pci_map_single(tp->tx_pdev, skb->data, skb->len, in typhoon_start_tx()
804 skb_dma = pci_map_single(tp->tx_pdev, skb->data, len, in typhoon_start_tx()
822 skb_dma = pci_map_single(tp->tx_pdev, frag_addr, len, in typhoon_start_tx()
835 iowrite32(txRing->lastWrite, tp->tx_ioaddr + txRing->writeRegister); in typhoon_start_tx()
861 struct typhoon *tp = netdev_priv(dev); in typhoon_set_rx_mode() local
887 typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_set_rx_mode()
894 typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_set_rx_mode()
898 typhoon_do_get_stats(struct typhoon *tp) in typhoon_do_get_stats() argument
900 struct net_device_stats *stats = &tp->dev->stats; in typhoon_do_get_stats()
901 struct net_device_stats *saved = &tp->stats_saved; in typhoon_do_get_stats()
908 err = typhoon_issue_command(tp, 1, &xp_cmd, 7, xp_resp); in typhoon_do_get_stats()
941 tp->speed = (s->linkStatus & TYPHOON_LINK_100MBPS) ? in typhoon_do_get_stats()
943 tp->duplex = (s->linkStatus & TYPHOON_LINK_FULL_DUPLEX) ? in typhoon_do_get_stats()
952 struct typhoon *tp = netdev_priv(dev); in typhoon_get_stats() local
953 struct net_device_stats *stats = &tp->dev->stats; in typhoon_get_stats()
954 struct net_device_stats *saved = &tp->stats_saved; in typhoon_get_stats()
957 if(tp->card_state == Sleeping) in typhoon_get_stats()
960 if(typhoon_do_get_stats(tp) < 0) { in typhoon_get_stats()
971 struct typhoon *tp = netdev_priv(dev); in typhoon_get_drvinfo() local
972 struct pci_dev *pci_dev = tp->pdev; in typhoon_get_drvinfo()
977 if(tp->card_state == Sleeping) { in typhoon_get_drvinfo()
982 if(typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp) < 0) { in typhoon_get_drvinfo()
1001 struct typhoon *tp = netdev_priv(dev); in typhoon_get_link_ksettings() local
1007 switch (tp->xcvr_select) { in typhoon_get_link_ksettings()
1029 if(tp->capabilities & TYPHOON_FIBER) { in typhoon_get_link_ksettings()
1042 typhoon_do_get_stats(tp); in typhoon_get_link_ksettings()
1043 cmd->base.speed = tp->speed; in typhoon_get_link_ksettings()
1044 cmd->base.duplex = tp->duplex; in typhoon_get_link_ksettings()
1046 if(tp->xcvr_select == TYPHOON_XCVR_AUTONEG) in typhoon_get_link_ksettings()
1063 struct typhoon *tp = netdev_priv(dev); in typhoon_set_link_ksettings() local
1093 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_set_link_ksettings()
1097 tp->xcvr_select = xcvr; in typhoon_set_link_ksettings()
1099 tp->speed = 0xff; /* invalid */ in typhoon_set_link_ksettings()
1100 tp->duplex = 0xff; /* invalid */ in typhoon_set_link_ksettings()
1102 tp->speed = speed; in typhoon_set_link_ksettings()
1103 tp->duplex = cmd->base.duplex; in typhoon_set_link_ksettings()
1113 struct typhoon *tp = netdev_priv(dev); in typhoon_get_wol() local
1117 if(tp->wol_events & TYPHOON_WAKE_LINK_EVENT) in typhoon_get_wol()
1119 if(tp->wol_events & TYPHOON_WAKE_MAGIC_PKT) in typhoon_get_wol()
1127 struct typhoon *tp = netdev_priv(dev); in typhoon_set_wol() local
1132 tp->wol_events = 0; in typhoon_set_wol()
1134 tp->wol_events |= TYPHOON_WAKE_LINK_EVENT; in typhoon_set_wol()
1136 tp->wol_events |= TYPHOON_WAKE_MAGIC_PKT; in typhoon_set_wol()
1183 typhoon_init_interface(struct typhoon *tp) in typhoon_init_interface() argument
1185 struct typhoon_interface *iface = &tp->shared->iface; in typhoon_init_interface()
1188 memset(tp->shared, 0, sizeof(struct typhoon_shared)); in typhoon_init_interface()
1192 shared_dma = tp->shared_dma + shared_offset(indexes); in typhoon_init_interface()
1195 shared_dma = tp->shared_dma + shared_offset(txLo); in typhoon_init_interface()
1199 shared_dma = tp->shared_dma + shared_offset(txHi); in typhoon_init_interface()
1203 shared_dma = tp->shared_dma + shared_offset(rxBuff); in typhoon_init_interface()
1208 shared_dma = tp->shared_dma + shared_offset(rxLo); in typhoon_init_interface()
1212 shared_dma = tp->shared_dma + shared_offset(rxHi); in typhoon_init_interface()
1216 shared_dma = tp->shared_dma + shared_offset(cmd); in typhoon_init_interface()
1220 shared_dma = tp->shared_dma + shared_offset(resp); in typhoon_init_interface()
1224 shared_dma = tp->shared_dma + shared_offset(zeroWord); in typhoon_init_interface()
1227 tp->indexes = &tp->shared->indexes; in typhoon_init_interface()
1228 tp->txLoRing.ringBase = (u8 *) tp->shared->txLo; in typhoon_init_interface()
1229 tp->txHiRing.ringBase = (u8 *) tp->shared->txHi; in typhoon_init_interface()
1230 tp->rxLoRing.ringBase = (u8 *) tp->shared->rxLo; in typhoon_init_interface()
1231 tp->rxHiRing.ringBase = (u8 *) tp->shared->rxHi; in typhoon_init_interface()
1232 tp->rxBuffRing.ringBase = (u8 *) tp->shared->rxBuff; in typhoon_init_interface()
1233 tp->cmdRing.ringBase = (u8 *) tp->shared->cmd; in typhoon_init_interface()
1234 tp->respRing.ringBase = (u8 *) tp->shared->resp; in typhoon_init_interface()
1236 tp->txLoRing.writeRegister = TYPHOON_REG_TX_LO_READY; in typhoon_init_interface()
1237 tp->txHiRing.writeRegister = TYPHOON_REG_TX_HI_READY; in typhoon_init_interface()
1239 tp->txlo_dma_addr = le32_to_cpu(iface->txLoAddr); in typhoon_init_interface()
1240 tp->card_state = Sleeping; in typhoon_init_interface()
1242 tp->offload = TYPHOON_OFFLOAD_IP_CHKSUM | TYPHOON_OFFLOAD_TCP_CHKSUM; in typhoon_init_interface()
1243 tp->offload |= TYPHOON_OFFLOAD_UDP_CHKSUM | TSO_OFFLOAD_ON; in typhoon_init_interface()
1244 tp->offload |= TYPHOON_OFFLOAD_VLAN; in typhoon_init_interface()
1246 spin_lock_init(&tp->command_lock); in typhoon_init_interface()
1253 typhoon_init_rings(struct typhoon *tp) in typhoon_init_rings() argument
1255 memset(tp->indexes, 0, sizeof(struct typhoon_indexes)); in typhoon_init_rings()
1257 tp->txLoRing.lastWrite = 0; in typhoon_init_rings()
1258 tp->txHiRing.lastWrite = 0; in typhoon_init_rings()
1259 tp->rxLoRing.lastWrite = 0; in typhoon_init_rings()
1260 tp->rxHiRing.lastWrite = 0; in typhoon_init_rings()
1261 tp->rxBuffRing.lastWrite = 0; in typhoon_init_rings()
1262 tp->cmdRing.lastWrite = 0; in typhoon_init_rings()
1263 tp->respRing.lastWrite = 0; in typhoon_init_rings()
1265 tp->txLoRing.lastRead = 0; in typhoon_init_rings()
1266 tp->txHiRing.lastRead = 0; in typhoon_init_rings()
1272 typhoon_request_firmware(struct typhoon *tp) in typhoon_request_firmware() argument
1285 err = request_firmware(&typhoon_fw, FIRMWARE_NAME, &tp->pdev->dev); in typhoon_request_firmware()
1287 netdev_err(tp->dev, "Failed to load firmware \"%s\"\n", in typhoon_request_firmware()
1323 netdev_err(tp->dev, "Invalid firmware image\n"); in typhoon_request_firmware()
1330 typhoon_download_firmware(struct typhoon *tp) in typhoon_download_firmware() argument
1332 void __iomem *ioaddr = tp->ioaddr; in typhoon_download_firmware()
1333 struct pci_dev *pdev = tp->pdev; in typhoon_download_firmware()
1360 netdev_err(tp->dev, "no DMA mem for firmware\n"); in typhoon_download_firmware()
1373 netdev_err(tp->dev, "card ready timeout\n"); in typhoon_download_firmware()
1413 netdev_err(tp->dev, "segment ready timeout\n"); in typhoon_download_firmware()
1446 netdev_err(tp->dev, "final segment ready timeout\n"); in typhoon_download_firmware()
1453 netdev_err(tp->dev, "boot ready timeout, status 0x%0x\n", in typhoon_download_firmware()
1471 typhoon_boot_3XP(struct typhoon *tp, u32 initial_status) in typhoon_boot_3XP() argument
1473 void __iomem *ioaddr = tp->ioaddr; in typhoon_boot_3XP()
1476 netdev_err(tp->dev, "boot ready timeout\n"); in typhoon_boot_3XP()
1481 iowrite32(tp->shared_dma, ioaddr + TYPHOON_REG_BOOT_RECORD_ADDR_LO); in typhoon_boot_3XP()
1487 netdev_err(tp->dev, "boot finish timeout (status 0x%x)\n", in typhoon_boot_3XP()
1507 typhoon_clean_tx(struct typhoon *tp, struct transmit_ring *txRing, in typhoon_clean_tx() argument
1531 pci_unmap_single(tp->pdev, skb_dma, dma_len, in typhoon_clean_tx()
1543 typhoon_tx_complete(struct typhoon *tp, struct transmit_ring *txRing, in typhoon_tx_complete() argument
1550 lastRead = typhoon_clean_tx(tp, txRing, index); in typhoon_tx_complete()
1551 if(netif_queue_stopped(tp->dev) && typhoon_num_free(txRing->lastWrite, in typhoon_tx_complete()
1553 netif_wake_queue(tp->dev); in typhoon_tx_complete()
1560 typhoon_recycle_rx_skb(struct typhoon *tp, u32 idx) in typhoon_recycle_rx_skb() argument
1562 struct typhoon_indexes *indexes = tp->indexes; in typhoon_recycle_rx_skb()
1563 struct rxbuff_ent *rxb = &tp->rxbuffers[idx]; in typhoon_recycle_rx_skb()
1564 struct basic_ring *ring = &tp->rxBuffRing; in typhoon_recycle_rx_skb()
1587 typhoon_alloc_rx_skb(struct typhoon *tp, u32 idx) in typhoon_alloc_rx_skb() argument
1589 struct typhoon_indexes *indexes = tp->indexes; in typhoon_alloc_rx_skb()
1590 struct rxbuff_ent *rxb = &tp->rxbuffers[idx]; in typhoon_alloc_rx_skb()
1591 struct basic_ring *ring = &tp->rxBuffRing; in typhoon_alloc_rx_skb()
1602 skb = netdev_alloc_skb(tp->dev, PKT_BUF_SZ); in typhoon_alloc_rx_skb()
1613 dma_addr = pci_map_single(tp->pdev, skb->data, in typhoon_alloc_rx_skb()
1633 typhoon_rx(struct typhoon *tp, struct basic_ring *rxRing, volatile __le32 * ready, in typhoon_rx() argument
1653 rxb = &tp->rxbuffers[idx]; in typhoon_rx()
1660 typhoon_recycle_rx_skb(tp, idx); in typhoon_rx()
1667 (new_skb = netdev_alloc_skb(tp->dev, pkt_len + 2)) != NULL) { in typhoon_rx()
1669 pci_dma_sync_single_for_cpu(tp->pdev, dma_addr, in typhoon_rx()
1673 pci_dma_sync_single_for_device(tp->pdev, dma_addr, in typhoon_rx()
1677 typhoon_recycle_rx_skb(tp, idx); in typhoon_rx()
1681 pci_unmap_single(tp->pdev, dma_addr, PKT_BUF_SZ, in typhoon_rx()
1683 typhoon_alloc_rx_skb(tp, idx); in typhoon_rx()
1685 new_skb->protocol = eth_type_trans(new_skb, tp->dev); in typhoon_rx()
1710 typhoon_fill_free_ring(struct typhoon *tp) in typhoon_fill_free_ring() argument
1715 struct rxbuff_ent *rxb = &tp->rxbuffers[i]; in typhoon_fill_free_ring()
1718 if(typhoon_alloc_rx_skb(tp, i) < 0) in typhoon_fill_free_ring()
1726 struct typhoon *tp = container_of(napi, struct typhoon, napi); in typhoon_poll() local
1727 struct typhoon_indexes *indexes = tp->indexes; in typhoon_poll()
1731 if(!tp->awaiting_resp && indexes->respReady != indexes->respCleared) in typhoon_poll()
1732 typhoon_process_response(tp, 0, NULL); in typhoon_poll()
1734 if(le32_to_cpu(indexes->txLoCleared) != tp->txLoRing.lastRead) in typhoon_poll()
1735 typhoon_tx_complete(tp, &tp->txLoRing, &indexes->txLoCleared); in typhoon_poll()
1740 work_done += typhoon_rx(tp, &tp->rxHiRing, &indexes->rxHiReady, in typhoon_poll()
1745 work_done += typhoon_rx(tp, &tp->rxLoRing, &indexes->rxLoReady, in typhoon_poll()
1749 if(le32_to_cpu(indexes->rxBuffCleared) == tp->rxBuffRing.lastWrite) { in typhoon_poll()
1751 typhoon_fill_free_ring(tp); in typhoon_poll()
1757 tp->ioaddr + TYPHOON_REG_INTR_MASK); in typhoon_poll()
1758 typhoon_post_pci_writes(tp->ioaddr); in typhoon_poll()
1768 struct typhoon *tp = netdev_priv(dev); in typhoon_interrupt() local
1769 void __iomem *ioaddr = tp->ioaddr; in typhoon_interrupt()
1778 if (napi_schedule_prep(&tp->napi)) { in typhoon_interrupt()
1781 __napi_schedule(&tp->napi); in typhoon_interrupt()
1789 typhoon_free_rx_rings(struct typhoon *tp) in typhoon_free_rx_rings() argument
1794 struct rxbuff_ent *rxb = &tp->rxbuffers[i]; in typhoon_free_rx_rings()
1796 pci_unmap_single(tp->pdev, rxb->dma_addr, PKT_BUF_SZ, in typhoon_free_rx_rings()
1805 typhoon_sleep(struct typhoon *tp, pci_power_t state, __le16 events) in typhoon_sleep() argument
1807 struct pci_dev *pdev = tp->pdev; in typhoon_sleep()
1808 void __iomem *ioaddr = tp->ioaddr; in typhoon_sleep()
1814 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_sleep()
1816 netdev_err(tp->dev, "typhoon_sleep(): wake events cmd err %d\n", in typhoon_sleep()
1822 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_sleep()
1824 netdev_err(tp->dev, "typhoon_sleep(): sleep cmd err %d\n", err); in typhoon_sleep()
1834 netif_carrier_off(tp->dev); in typhoon_sleep()
1836 pci_enable_wake(tp->pdev, state, 1); in typhoon_sleep()
1842 typhoon_wakeup(struct typhoon *tp, int wait_type) in typhoon_wakeup() argument
1844 struct pci_dev *pdev = tp->pdev; in typhoon_wakeup()
1845 void __iomem *ioaddr = tp->ioaddr; in typhoon_wakeup()
1856 (tp->capabilities & TYPHOON_WAKEUP_NEEDS_RESET)) in typhoon_wakeup()
1863 typhoon_start_runtime(struct typhoon *tp) in typhoon_start_runtime() argument
1865 struct net_device *dev = tp->dev; in typhoon_start_runtime()
1866 void __iomem *ioaddr = tp->ioaddr; in typhoon_start_runtime()
1870 typhoon_init_rings(tp); in typhoon_start_runtime()
1871 typhoon_fill_free_ring(tp); in typhoon_start_runtime()
1873 err = typhoon_download_firmware(tp); in typhoon_start_runtime()
1875 netdev_err(tp->dev, "cannot load runtime on 3XP\n"); in typhoon_start_runtime()
1879 if(typhoon_boot_3XP(tp, TYPHOON_STATUS_WAITING_FOR_BOOT) < 0) { in typhoon_start_runtime()
1880 netdev_err(tp->dev, "cannot boot 3XP\n"); in typhoon_start_runtime()
1887 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_start_runtime()
1894 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_start_runtime()
1903 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_start_runtime()
1908 xp_cmd.parm1 = tp->xcvr_select; in typhoon_start_runtime()
1909 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_start_runtime()
1915 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_start_runtime()
1920 xp_cmd.parm2 = tp->offload; in typhoon_start_runtime()
1921 xp_cmd.parm3 = tp->offload; in typhoon_start_runtime()
1922 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_start_runtime()
1929 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_start_runtime()
1934 err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_start_runtime()
1938 tp->card_state = Running; in typhoon_start_runtime()
1949 typhoon_free_rx_rings(tp); in typhoon_start_runtime()
1950 typhoon_init_rings(tp); in typhoon_start_runtime()
1955 typhoon_stop_runtime(struct typhoon *tp, int wait_type) in typhoon_stop_runtime() argument
1957 struct typhoon_indexes *indexes = tp->indexes; in typhoon_stop_runtime()
1958 struct transmit_ring *txLo = &tp->txLoRing; in typhoon_stop_runtime()
1959 void __iomem *ioaddr = tp->ioaddr; in typhoon_stop_runtime()
1970 typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_stop_runtime()
1982 netdev_err(tp->dev, "halt timed out waiting for Tx to complete\n"); in typhoon_stop_runtime()
1985 typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_stop_runtime()
1990 tp->card_state = Sleeping; in typhoon_stop_runtime()
1992 typhoon_do_get_stats(tp); in typhoon_stop_runtime()
1993 memcpy(&tp->stats_saved, &tp->dev->stats, sizeof(struct net_device_stats)); in typhoon_stop_runtime()
1996 typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); in typhoon_stop_runtime()
1999 netdev_err(tp->dev, "timed out waiting for 3XP to halt\n"); in typhoon_stop_runtime()
2002 netdev_err(tp->dev, "unable to reset 3XP\n"); in typhoon_stop_runtime()
2009 typhoon_clean_tx(tp, &tp->txLoRing, &indexes->txLoCleared); in typhoon_stop_runtime()
2018 struct typhoon *tp = netdev_priv(dev); in typhoon_tx_timeout() local
2020 if(typhoon_reset(tp->ioaddr, WaitNoSleep) < 0) { in typhoon_tx_timeout()
2026 typhoon_clean_tx(tp, &tp->txLoRing, &tp->indexes->txLoCleared); in typhoon_tx_timeout()
2027 typhoon_free_rx_rings(tp); in typhoon_tx_timeout()
2029 if(typhoon_start_runtime(tp) < 0) { in typhoon_tx_timeout()
2039 typhoon_reset(tp->ioaddr, NoWait); in typhoon_tx_timeout()
2046 struct typhoon *tp = netdev_priv(dev); in typhoon_open() local
2049 err = typhoon_request_firmware(tp); in typhoon_open()
2053 err = typhoon_wakeup(tp, WaitSleep); in typhoon_open()
2064 napi_enable(&tp->napi); in typhoon_open()
2066 err = typhoon_start_runtime(tp); in typhoon_open()
2068 napi_disable(&tp->napi); in typhoon_open()
2079 if(typhoon_boot_3XP(tp, TYPHOON_STATUS_WAITING_FOR_HOST) < 0) { in typhoon_open()
2081 typhoon_reset(tp->ioaddr, NoWait); in typhoon_open()
2085 if(typhoon_sleep(tp, PCI_D3hot, 0) < 0) in typhoon_open()
2095 struct typhoon *tp = netdev_priv(dev); in typhoon_close() local
2098 napi_disable(&tp->napi); in typhoon_close()
2100 if(typhoon_stop_runtime(tp, WaitSleep) < 0) in typhoon_close()
2106 typhoon_free_rx_rings(tp); in typhoon_close()
2107 typhoon_init_rings(tp); in typhoon_close()
2109 if(typhoon_boot_3XP(tp, TYPHOON_STATUS_WAITING_FOR_HOST) < 0) in typhoon_close()
2112 if(typhoon_sleep(tp, PCI_D3hot, 0) < 0) in typhoon_close()
2123 struct typhoon *tp = netdev_priv(dev); in typhoon_resume() local
2130 if(typhoon_wakeup(tp, WaitNoSleep) < 0) { in typhoon_resume()
2135 if(typhoon_start_runtime(tp) < 0) { in typhoon_resume()
2144 typhoon_reset(tp->ioaddr, NoWait); in typhoon_resume()
2152 struct typhoon *tp = netdev_priv(dev); in typhoon_suspend() local
2161 if(tp->wol_events & TYPHOON_WAKE_MAGIC_PKT) in typhoon_suspend()
2166 if(typhoon_stop_runtime(tp, WaitNoSleep) < 0) { in typhoon_suspend()
2171 typhoon_free_rx_rings(tp); in typhoon_suspend()
2172 typhoon_init_rings(tp); in typhoon_suspend()
2174 if(typhoon_boot_3XP(tp, TYPHOON_STATUS_WAITING_FOR_HOST) < 0) { in typhoon_suspend()
2182 if(typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL) < 0) { in typhoon_suspend()
2189 if(typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL) < 0) { in typhoon_suspend()
2194 if(typhoon_sleep(tp, pci_choose_state(pdev, state), tp->wol_events) < 0) { in typhoon_suspend()
2268 struct typhoon *tp; in typhoon_init_one() local
2278 dev = alloc_etherdev(sizeof(*tp)); in typhoon_init_one()
2356 tp = netdev_priv(dev); in typhoon_init_one()
2357 tp->shared = shared; in typhoon_init_one()
2358 tp->shared_dma = shared_dma; in typhoon_init_one()
2359 tp->pdev = pdev; in typhoon_init_one()
2360 tp->tx_pdev = pdev; in typhoon_init_one()
2361 tp->ioaddr = ioaddr; in typhoon_init_one()
2362 tp->tx_ioaddr = ioaddr; in typhoon_init_one()
2363 tp->dev = dev; in typhoon_init_one()
2385 typhoon_init_interface(tp); in typhoon_init_one()
2386 typhoon_init_rings(tp); in typhoon_init_one()
2388 err = typhoon_boot_3XP(tp, TYPHOON_STATUS_WAITING_FOR_HOST); in typhoon_init_one()
2395 err = typhoon_issue_command(tp, 1, &xp_cmd, 1, xp_resp); in typhoon_init_one()
2414 err = typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp); in typhoon_init_one()
2420 tp->capabilities = typhoon_card_info[card_id].capabilities; in typhoon_init_one()
2421 tp->xcvr_select = TYPHOON_XCVR_AUTONEG; in typhoon_init_one()
2430 tp->capabilities |= TYPHOON_WAKEUP_NEEDS_RESET; in typhoon_init_one()
2432 err = typhoon_sleep(tp, PCI_D3hot, 0); in typhoon_init_one()
2440 netif_napi_add(dev, &tp->napi, typhoon_poll, 16); in typhoon_init_one()
2522 struct typhoon *tp = netdev_priv(dev); in typhoon_remove_one() local
2527 typhoon_reset(tp->ioaddr, NoWait); in typhoon_remove_one()
2528 pci_iounmap(pdev, tp->ioaddr); in typhoon_remove_one()
2530 tp->shared, tp->shared_dma); in typhoon_remove_one()