Lines Matching +full:2 +full:mb

70 static void queue_llc_rx(struct s_smc *smc, SMbuf *mb);
71 static void smt_to_llc(struct s_smc *smc, SMbuf *mb);
74 static void queue_txd_mb(struct s_smc *smc, SMbuf *mb);
133 void smt_free_mbuf(struct s_smc *smc, SMbuf *mb);
273 smc->os.hwm.mbuf_pool.mb_start=(SMbuf *)(&smc->os.hwm.mbuf_pool.mb[0]) ; in mac_drv_init()
296 * Sets hardware modul specific values for the mode register 2
416 SMbuf *mb ; in init_fddi_driver() local
426 mb = smc->os.hwm.mbuf_pool.mb_start ; in init_fddi_driver()
429 mb->sm_use_count = 1 ; in init_fddi_driver()
430 smt_free_mbuf(smc,mb) ; in init_fddi_driver()
431 mb++ ; in init_fddi_driver()
434 mb = mb_start ; in init_fddi_driver()
438 mb->sm_use_count = 1 ; in init_fddi_driver()
439 smt_free_mbuf(smc,mb) ; in init_fddi_driver()
440 mb++ ; in init_fddi_driver()
480 register SMbuf *mb ; in smt_get_mbuf() local
483 mb = smc->os.hwm.mbuf_pool.mb_free ; in smt_get_mbuf()
485 mb = mb_free ; in smt_get_mbuf()
487 if (mb) { in smt_get_mbuf()
489 smc->os.hwm.mbuf_pool.mb_free = mb->sm_next ; in smt_get_mbuf()
491 mb_free = mb->sm_next ; in smt_get_mbuf()
493 mb->sm_off = 8 ; in smt_get_mbuf()
494 mb->sm_use_count = 1 ; in smt_get_mbuf()
496 DB_GEN(3, "get SMbuf: mb = %p", mb); in smt_get_mbuf()
497 return mb; /* May be NULL */ in smt_get_mbuf()
500 void smt_free_mbuf(struct s_smc *smc, SMbuf *mb) in smt_free_mbuf() argument
503 if (mb) { in smt_free_mbuf()
504 mb->sm_use_count-- ; in smt_free_mbuf()
505 DB_GEN(3, "free_mbuf: sm_use_count = %d", mb->sm_use_count); in smt_free_mbuf()
511 if (!mb->sm_use_count) { in smt_free_mbuf()
512 DB_GEN(3, "free SMbuf: mb = %p", mb); in smt_free_mbuf()
514 mb->sm_next = smc->os.hwm.mbuf_pool.mb_free ; in smt_free_mbuf()
515 smc->os.hwm.mbuf_pool.mb_free = mb ; in smt_free_mbuf()
517 mb->sm_next = mb_free ; in smt_free_mbuf()
518 mb_free = mb ; in smt_free_mbuf()
705 SMbuf *mb ; in fddi_isr() local
765 if (is & IS_TIMINT) { /* Timer 82C54-2 */ in fddi_isr()
841 while ((mb = get_llc_rx(smc))) { in fddi_isr()
842 smt_to_llc(smc,mb) ; in fddi_isr()
848 while (!offDepth && (mb = get_llc_rx(smc))) { in fddi_isr()
849 smt_to_llc(smc,mb) ; in fddi_isr()
901 * = 2: RX_DISABLE_ALLMULTI disable "enable all multicasts"
1047 SMbuf *mb ; in process_receive() local
1133 /* may be next 2 DRV_BUF_FLUSH() can be skipped, because */ in process_receive()
1174 DB_RX(2, "Frame aborted by the FORMAC"); in process_receive()
1181 DB_RX(2, "E-Indicator set"); in process_receive()
1185 DB_RX(2, "CRC error"); in process_receive()
1189 DB_RX(2, "Implementer frame"); in process_receive()
1195 DB_RX(2, "Frame too long error"); in process_receive()
1204 DB_RX(2, "Frame length = 0"); in process_receive()
1218 DB_RX(2, "FC = %x", *virt); in process_receive()
1222 virt[9] == MA[2] && in process_receive()
1242 virt[3] != MA[2] || in process_receive()
1243 virt[2] != MA[1] || in process_receive()
1245 DB_RX(2, "DA != MA and not multi- or broadcast"); in process_receive()
1258 if (!(mb = smt_get_mbuf(smc))) { in process_receive()
1263 data = smtod(mb,char *) - 1 ; in process_receive()
1273 DB_RX(6, "cp SMT frame to mb: len = %d", n); in process_receive()
1277 data = smtod(mb,char *) - 1 ; in process_receive()
1279 fc = *(char *)mb->sm_data = *data ; in process_receive()
1280 mb->sm_len = len - 1 ; /* len - fc */ in process_receive()
1301 smt_received_pack(smc,mb,(int)(rfsw>>25)) ; in process_receive()
1322 smt_received_pack(smc,mb,(int)(rfsw>>25)) ; in process_receive()
1334 smt_free_mbuf(smc,mb) ; in process_receive()
1340 DB_RX(2, "unknown FC error"); in process_receive()
1341 smt_free_mbuf(smc,mb) ; in process_receive()
1372 static void smt_to_llc(struct s_smc *smc, SMbuf *mb) in smt_to_llc() argument
1377 smc->os.hwm.r.len = mb->sm_len ; in smt_to_llc()
1378 smc->os.hwm.r.mb_pos = smtod(mb,char *) ; in smt_to_llc()
1380 (void)mac_drv_rx_init(smc,(int)mb->sm_len,(int)fc, in smt_to_llc()
1381 smc->os.hwm.r.mb_pos,(int)mb->sm_len) ; in smt_to_llc()
1382 smt_free_mbuf(smc,mb) ; in smt_to_llc()
1414 DB_RX(2, "hwm_rx_frag: len = %d, frame_status = %x", len, frame_status); in hwm_rx_frag()
1572 DB_TX(2, "Ring is down: terminate LAN_TX"); in hwm_tx_init()
1578 DB_TX(2, "Out of TxDs, terminate LAN_TX"); in hwm_tx_init()
1583 DB_TX(2, "Out of TxDs, terminate LAN_TX"); in hwm_tx_init()
1637 DB_TX(2, "hwm_tx_frag: len = %d, frame_status = %x", len, frame_status); in hwm_tx_frag()
1726 static void queue_llc_rx(struct s_smc *smc, SMbuf *mb) in queue_llc_rx() argument
1728 DB_GEN(4, "queue_llc_rx: mb = %p", mb); in queue_llc_rx()
1730 mb->sm_next = (SMbuf *)NULL ; in queue_llc_rx()
1732 smc->os.hwm.llc_rx_pipe = mb ; in queue_llc_rx()
1735 smc->os.hwm.llc_rx_tail->sm_next = mb ; in queue_llc_rx()
1737 smc->os.hwm.llc_rx_tail = mb ; in queue_llc_rx()
1752 SMbuf *mb ; in get_llc_rx() local
1754 if ((mb = smc->os.hwm.llc_rx_pipe)) { in get_llc_rx()
1756 smc->os.hwm.llc_rx_pipe = mb->sm_next ; in get_llc_rx()
1758 DB_GEN(4, "get_llc_rx: mb = 0x%p", mb); in get_llc_rx()
1759 return mb; in get_llc_rx()
1766 static void queue_txd_mb(struct s_smc *smc, SMbuf *mb) in queue_txd_mb() argument
1768 DB_GEN(4, "_rx: queue_txd_mb = %p", mb); in queue_txd_mb()
1770 mb->sm_next = (SMbuf *)NULL ; in queue_txd_mb()
1772 smc->os.hwm.txd_tx_pipe = mb ; in queue_txd_mb()
1775 smc->os.hwm.txd_tx_tail->sm_next = mb ; in queue_txd_mb()
1777 smc->os.hwm.txd_tx_tail = mb ; in queue_txd_mb()
1785 SMbuf *mb ; in get_txd_mb() local
1787 if ((mb = smc->os.hwm.txd_tx_pipe)) { in get_txd_mb()
1789 smc->os.hwm.txd_tx_pipe = mb->sm_next ; in get_txd_mb()
1791 DB_GEN(4, "get_txd_mb: mb = 0x%p", mb); in get_txd_mb()
1792 return mb; in get_txd_mb()
1798 void smt_send_mbuf(struct s_smc *smc, SMbuf *mb, int fc) in smt_send_mbuf() argument
1813 NDD_TRACE("THSB",mb,fc,0) ; in smt_send_mbuf()
1814 DB_TX(4, "smt_send_mbuf: mb = 0x%p, fc = 0x%x", mb, fc); in smt_send_mbuf()
1816 mb->sm_off-- ; /* set to fc */ in smt_send_mbuf()
1817 mb->sm_len++ ; /* + fc */ in smt_send_mbuf()
1818 data = smtod(mb,char *) ; in smt_send_mbuf()
1827 len = mb->sm_len ; in smt_send_mbuf()
1858 DB_TX(2, "Ring is down: terminate LAN_TX"); in smt_send_mbuf()
1861 DB_TX(2, "Ring is down: terminate transmission"); in smt_send_mbuf()
1862 smt_free_mbuf(smc,mb) ; in smt_send_mbuf()
1869 mb->sm_use_count = 2 ; in smt_send_mbuf()
1880 (((__u32)(mb->sm_len-1)&3) << 27)) ; in smt_send_mbuf()
1903 queue_txd_mb(smc,mb) ; in smt_send_mbuf()
1908 queue_llc_rx(smc,mb) ; in smt_send_mbuf()
1938 SMbuf *mb ; in mac_drv_clear_txd() local
1978 mb = get_txd_mb(smc) ; in mac_drv_clear_txd()
1979 smt_free_mbuf(smc,mb) ; in mac_drv_clear_txd()
2101 * = 2: debug.d_smt