Lines Matching refs: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()
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
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()
1047 SMbuf *mb ; in process_receive() local
1258 if (!(mb = smt_get_mbuf(smc))) { in process_receive()
1263 data = smtod(mb,char *) - 1 ; 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()
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()
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()
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()