Lines Matching refs:smc
112 static void send_queued_packets(struct s_smc *smc);
114 static void ResetAdapter(struct s_smc *smc);
118 void *mac_drv_get_space(struct s_smc *smc, u_int size);
119 void *mac_drv_get_desc_mem(struct s_smc *smc, u_int size);
120 unsigned long mac_drv_virt2phys(struct s_smc *smc, void *virt);
121 unsigned long dma_master(struct s_smc *smc, void *virt, int len, int flag);
122 void dma_complete(struct s_smc *smc, volatile union s_fp_descr *descr,
124 void mac_drv_tx_complete(struct s_smc *smc, volatile struct s_smt_fp_txd *txd);
125 void llc_restart_tx(struct s_smc *smc);
126 void mac_drv_rx_complete(struct s_smc *smc, volatile struct s_smt_fp_rxd *rxd,
128 void mac_drv_requeue_rxd(struct s_smc *smc, volatile struct s_smt_fp_rxd *rxd,
130 void mac_drv_fill_rxd(struct s_smc *smc);
131 void mac_drv_clear_rxd(struct s_smc *smc, volatile struct s_smt_fp_rxd *rxd,
133 int mac_drv_rx_init(struct s_smc *smc, int len, int fc, char *look_ahead,
139 extern int mac_drv_init(struct s_smc *smc);
140 extern void hwm_tx_frag(struct s_smc *smc, char far * virt, u_long phys,
142 extern int hwm_tx_init(struct s_smc *smc, u_char fc, int frag_count,
144 extern void fddi_isr(struct s_smc *smc);
145 extern void hwm_rx_frag(struct s_smc *smc, char far * virt, u_long phys,
147 extern void mac_drv_rx_mode(struct s_smc *smc, int mode);
148 extern void mac_drv_clear_rx_queue(struct s_smc *smc);
149 extern void enable_tx_irq(struct s_smc *smc, u_short queue);
206 struct s_smc *smc; /* board pointer */ in skfp_init_one() local
263 smc = netdev_priv(dev); in skfp_init_one()
264 smc->os.dev = dev; in skfp_init_one()
265 smc->os.bus_type = SK_BUS_TYPE_PCI; in skfp_init_one()
266 smc->os.pdev = *pdev; in skfp_init_one()
267 smc->os.QueueSkb = MAX_TX_QUEUE_LEN; in skfp_init_one()
268 smc->os.MaxFrameSize = MAX_FRAME_SIZE; in skfp_init_one()
269 smc->os.dev = dev; in skfp_init_one()
270 smc->hw.slot = -1; in skfp_init_one()
271 smc->hw.iop = mem; in skfp_init_one()
272 smc->os.ResetRequested = FALSE; in skfp_init_one()
273 skb_queue_head_init(&smc->os.SendSkbQueue); in skfp_init_one()
298 if (smc->os.SharedMemAddr) in skfp_init_one()
299 dma_free_coherent(&pdev->dev, smc->os.SharedMemSize, in skfp_init_one()
300 smc->os.SharedMemAddr, in skfp_init_one()
301 smc->os.SharedMemDMA); in skfp_init_one()
303 smc->os.LocalRxBuffer, smc->os.LocalRxBufferDMA); in skfp_init_one()
381 struct s_smc *smc = netdev_priv(dev); in skfp_driver_init() local
382 skfddi_priv *bp = &smc->os; in skfp_driver_init()
391 smc->hw.irq = dev->irq; in skfp_driver_init()
428 card_stop(smc); // Reset adapter. in skfp_driver_init()
431 if (mac_drv_init(smc) != 0) { in skfp_driver_init()
435 read_address(smc, NULL); in skfp_driver_init()
436 pr_debug("HW-Addr: %pMF\n", smc->hw.fddi_canon_addr.a); in skfp_driver_init()
437 eth_hw_addr_set(dev, smc->hw.fddi_canon_addr.a); in skfp_driver_init()
439 smt_reset_defaults(smc, 0); in skfp_driver_init()
483 struct s_smc *smc = netdev_priv(dev); in skfp_open() local
503 read_address(smc, NULL); in skfp_open()
504 eth_hw_addr_set(dev, smc->hw.fddi_canon_addr.a); in skfp_open()
506 init_smt(smc, NULL); in skfp_open()
507 smt_online(smc, 1); in skfp_open()
511 mac_clear_multicast(smc); in skfp_open()
514 mac_drv_rx_mode(smc, RX_DISABLE_PROMISC); in skfp_open()
550 struct s_smc *smc = netdev_priv(dev); in skfp_close() local
551 skfddi_priv *bp = &smc->os; in skfp_close()
554 smt_reset_defaults(smc, 1); in skfp_close()
555 card_stop(smc); in skfp_close()
556 mac_drv_clear_tx_queue(smc); in skfp_close()
557 mac_drv_clear_rx_queue(smc); in skfp_close()
608 struct s_smc *smc; /* private board structure pointer */ in skfp_interrupt() local
611 smc = netdev_priv(dev); in skfp_interrupt()
612 bp = &smc->os; in skfp_interrupt()
620 if ((inpd(ISR_A) & smc->hw.is_imask) == 0) { // IRQ? in skfp_interrupt()
628 fddi_isr(smc); in skfp_interrupt()
630 if (smc->os.ResetRequested) { in skfp_interrupt()
631 ResetAdapter(smc); in skfp_interrupt()
632 smc->os.ResetRequested = FALSE; in skfp_interrupt()
838 struct s_smc *smc = netdev_priv(dev); in skfp_ctl_set_multicast_list() local
839 skfddi_priv *bp = &smc->os; in skfp_ctl_set_multicast_list()
851 struct s_smc *smc = netdev_priv(dev); in skfp_ctl_set_multicast_list_wo_lock() local
856 mac_drv_rx_mode(smc, RX_ENABLE_PROMISC); in skfp_ctl_set_multicast_list_wo_lock()
861 mac_drv_rx_mode(smc, RX_DISABLE_PROMISC); in skfp_ctl_set_multicast_list_wo_lock()
865 mac_clear_multicast(smc); in skfp_ctl_set_multicast_list_wo_lock()
866 mac_drv_rx_mode(smc, RX_DISABLE_ALLMULTI); in skfp_ctl_set_multicast_list_wo_lock()
869 mac_drv_rx_mode(smc, RX_ENABLE_ALLMULTI); in skfp_ctl_set_multicast_list_wo_lock()
877 mac_add_multicast(smc, in skfp_ctl_set_multicast_list_wo_lock()
887 mac_drv_rx_mode(smc, RX_ENABLE_ALLMULTI); in skfp_ctl_set_multicast_list_wo_lock()
896 mac_update_multicast(smc); in skfp_ctl_set_multicast_list_wo_lock()
922 struct s_smc *smc = netdev_priv(dev); in skfp_ctl_set_mac_address() local
924 skfddi_priv *bp = &smc->os; in skfp_ctl_set_mac_address()
930 ResetAdapter(smc); in skfp_ctl_set_mac_address()
962 struct s_smc *smc = netdev_priv(dev); in skfp_siocdevprivate() local
963 skfddi_priv *lp = &smc->os; in skfp_siocdevprivate()
1046 struct s_smc *smc = netdev_priv(dev); in skfp_send_pkt() local
1047 skfddi_priv *bp = &smc->os; in skfp_send_pkt()
1106 static void send_queued_packets(struct s_smc *smc) in send_queued_packets() argument
1108 skfddi_priv *bp = &smc->os; in send_queued_packets()
1136 if (!smc->ess.sync_bw_available) in send_queued_packets()
1141 if (smc->mib.fddiESSSynchTxMode) { in send_queued_packets()
1148 frame_status = hwm_tx_init(smc, fc, 1, skb->len, queue); in send_queued_packets()
1174 CheckSourceAddress(skb->data, smc->hw.fddi_canon_addr.a); in send_queued_packets()
1176 txd = (struct s_smt_fp_txd *) HWM_GET_CURR_TXD(smc, queue); in send_queued_packets()
1184 hwm_tx_frag(smc, skb->data, dma_address, skb->len, in send_queued_packets()
1233 static void ResetAdapter(struct s_smc *smc) in ResetAdapter() argument
1240 card_stop(smc); // Stop all activity. in ResetAdapter()
1243 mac_drv_clear_tx_queue(smc); in ResetAdapter()
1244 mac_drv_clear_rx_queue(smc); in ResetAdapter()
1248 smt_reset_defaults(smc, 1); // Initialize the SMT module. in ResetAdapter()
1250 init_smt(smc, (smc->os.dev)->dev_addr); // Initialize the hardware. in ResetAdapter()
1252 smt_online(smc, 1); // Insert into the ring again. in ResetAdapter()
1256 skfp_ctl_set_multicast_list_wo_lock(smc->os.dev); in ResetAdapter()
1278 void llc_restart_tx(struct s_smc *smc) in llc_restart_tx() argument
1280 skfddi_priv *bp = &smc->os; in llc_restart_tx()
1286 send_queued_packets(smc); in llc_restart_tx()
1308 void *mac_drv_get_space(struct s_smc *smc, unsigned int size) in mac_drv_get_space() argument
1313 virt = (void *) (smc->os.SharedMemAddr + smc->os.SharedMemHeap); in mac_drv_get_space()
1315 if ((smc->os.SharedMemHeap + size) > smc->os.SharedMemSize) { in mac_drv_get_space()
1319 smc->os.SharedMemHeap += size; // Move heap pointer. in mac_drv_get_space()
1324 (smc->os.SharedMemDMA + in mac_drv_get_space()
1325 ((char *) virt - (char *)smc->os.SharedMemAddr))); in mac_drv_get_space()
1348 void *mac_drv_get_desc_mem(struct s_smc *smc, unsigned int size) in mac_drv_get_desc_mem() argument
1357 virt = mac_drv_get_space(smc, size); in mac_drv_get_desc_mem()
1365 if (!mac_drv_get_space(smc, size)) { in mac_drv_get_desc_mem()
1386 unsigned long mac_drv_virt2phys(struct s_smc *smc, void *virt) in mac_drv_virt2phys() argument
1388 return smc->os.SharedMemDMA + in mac_drv_virt2phys()
1389 ((char *) virt - (char *)smc->os.SharedMemAddr); in mac_drv_virt2phys()
1421 u_long dma_master(struct s_smc * smc, void *virt, int len, int flag) in dma_master() argument
1423 return smc->os.SharedMemDMA + in dma_master()
1424 ((char *) virt - (char *)smc->os.SharedMemAddr); in dma_master()
1449 void dma_complete(struct s_smc *smc, volatile union s_fp_descr *descr, int flag) in dma_complete() argument
1464 skfddi_priv *bp = &smc->os; in dma_complete()
1494 void mac_drv_tx_complete(struct s_smc *smc, volatile struct s_smt_fp_txd *txd) in mac_drv_tx_complete() argument
1508 dma_unmap_single(&(&smc->os.pdev)->dev, txd->txd_os.dma_addr, in mac_drv_tx_complete()
1512 smc->os.MacStat.gen.tx_packets++; // Count transmitted packets. in mac_drv_tx_complete()
1513 smc->os.MacStat.gen.tx_bytes+=skb->len; // Count bytes in mac_drv_tx_complete()
1562 void mac_drv_rx_complete(struct s_smc *smc, volatile struct s_smt_fp_rxd *rxd, in mac_drv_rx_complete() argument
1565 skfddi_priv *bp = &smc->os; in mac_drv_rx_complete()
1581 smc->os.MacStat.gen.rx_errors++; in mac_drv_rx_complete()
1634 smc->os.MacStat.gen.rx_packets++; // Count indicated receive in mac_drv_rx_complete()
1636 smc->os.MacStat.gen.rx_bytes+=len; // Count bytes. in mac_drv_rx_complete()
1641 smc->os.MacStat.gen.multicast++; in mac_drv_rx_complete()
1651 HWM_RX_CHECK(smc, RX_LOW_WATERMARK); in mac_drv_rx_complete()
1656 mac_drv_requeue_rxd(smc, rxd, frag_count); in mac_drv_rx_complete()
1657 smc->os.MacStat.gen.rx_errors++; // Count receive packets in mac_drv_rx_complete()
1681 void mac_drv_requeue_rxd(struct s_smc *smc, volatile struct s_smt_fp_rxd *rxd, in mac_drv_requeue_rxd() argument
1695 MaxFrameSize = smc->os.MaxFrameSize; in mac_drv_requeue_rxd()
1699 rxd = HWM_GET_CURR_RXD(smc); in mac_drv_requeue_rxd()
1712 b_addr = dma_map_single(&(&smc->os.pdev)->dev, in mac_drv_requeue_rxd()
1720 v_addr = smc->os.LocalRxBuffer; in mac_drv_requeue_rxd()
1721 b_addr = smc->os.LocalRxBufferDMA; in mac_drv_requeue_rxd()
1727 b_addr = dma_map_single(&(&smc->os.pdev)->dev, v_addr, in mac_drv_requeue_rxd()
1731 hwm_rx_frag(smc, v_addr, b_addr, MaxFrameSize, in mac_drv_requeue_rxd()
1755 void mac_drv_fill_rxd(struct s_smc *smc) in mac_drv_fill_rxd() argument
1768 MaxFrameSize = smc->os.MaxFrameSize; in mac_drv_fill_rxd()
1770 while (HWM_GET_RX_FREE(smc) > 0) { in mac_drv_fill_rxd()
1773 rxd = HWM_GET_CURR_RXD(smc); in mac_drv_fill_rxd()
1780 b_addr = dma_map_single(&(&smc->os.pdev)->dev, v_addr, in mac_drv_fill_rxd()
1790 v_addr = smc->os.LocalRxBuffer; in mac_drv_fill_rxd()
1791 b_addr = smc->os.LocalRxBufferDMA; in mac_drv_fill_rxd()
1797 hwm_rx_frag(smc, v_addr, b_addr, MaxFrameSize, in mac_drv_fill_rxd()
1820 void mac_drv_clear_rxd(struct s_smc *smc, volatile struct s_smt_fp_rxd *rxd, in mac_drv_clear_rxd() argument
1835 skfddi_priv *bp = &smc->os; in mac_drv_clear_rxd()
1878 int mac_drv_rx_init(struct s_smc *smc, int len, int fc, in mac_drv_rx_init() argument
1903 skb->protocol = fddi_type_trans(skb, smc->os.dev); in mac_drv_rx_init()
1925 void smt_timer_poll(struct s_smc *smc) in smt_timer_poll() argument
1943 void ring_status_indication(struct s_smc *smc, u_long status) in ring_status_indication() argument
2017 void smt_stat_counter(struct s_smc *smc, int stat) in smt_stat_counter() argument
2028 smc->os.MacStat.gen.rx_errors++; in smt_stat_counter()
2053 void cfm_state_change(struct s_smc *smc, int c_state) in cfm_state_change() argument
2111 void ecm_state_change(struct s_smc *smc, int e_state) in ecm_state_change() argument
2166 void rmt_state_change(struct s_smc *smc, int r_state) in rmt_state_change() argument
2218 void drv_reset_indication(struct s_smc *smc) in drv_reset_indication() argument
2222 smc->os.ResetRequested = TRUE; // Set flag. in drv_reset_indication()