if_mn.c (69781) | if_mn.c (69922) |
---|---|
1/* 2 * ---------------------------------------------------------------------------- 3 * "THE BEER-WARE LICENSE" (Revision 42): 4 * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you 5 * can do whatever you want with this stuff. If we meet some day, and you think 6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 7 * ---------------------------------------------------------------------------- 8 * --- 7 unchanged lines hidden (view full) --- 16 * The driver supports E1 mode with up to 31 channels. We send CRC4 but don't 17 * check it coming in. 18 * 19 * The FALC54 and MUNICH32X have far too many registers and weird modes for 20 * comfort, so I have not bothered typing it all into a "fooreg.h" file, 21 * you will (badly!) need the documentation anyway if you want to mess with 22 * this gadget. 23 * | 1/* 2 * ---------------------------------------------------------------------------- 3 * "THE BEER-WARE LICENSE" (Revision 42): 4 * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you 5 * can do whatever you want with this stuff. If we meet some day, and you think 6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 7 * ---------------------------------------------------------------------------- 8 * --- 7 unchanged lines hidden (view full) --- 16 * The driver supports E1 mode with up to 31 channels. We send CRC4 but don't 17 * check it coming in. 18 * 19 * The FALC54 and MUNICH32X have far too many registers and weird modes for 20 * comfort, so I have not bothered typing it all into a "fooreg.h" file, 21 * you will (badly!) need the documentation anyway if you want to mess with 22 * this gadget. 23 * |
24 * $FreeBSD: head/sys/pci/if_mn.c 69781 2000-12-08 21:51:06Z dwmalone $ | 24 * $FreeBSD: head/sys/pci/if_mn.c 69922 2000-12-12 18:52:14Z julian $ |
25 */ 26 27/* 28 * Stuff to describe the MUNIC32X and FALC54 chips. 29 */ 30 31#define M32_CHAN 32 /* We have 32 channels */ 32#define M32_TS 32 /* We have 32 timeslots */ --- 459 unchanged lines hidden (view full) --- 492#endif /* notyet */ 493 494/* 495 * OUTPUT 496 */ 497 498static int 499ngmn_rcvdata(hook_p hook, struct mbuf *m, meta_p meta, | 25 */ 26 27/* 28 * Stuff to describe the MUNIC32X and FALC54 chips. 29 */ 30 31#define M32_CHAN 32 /* We have 32 channels */ 32#define M32_TS 32 /* We have 32 timeslots */ --- 459 unchanged lines hidden (view full) --- 492#endif /* notyet */ 493 494/* 495 * OUTPUT 496 */ 497 498static int 499ngmn_rcvdata(hook_p hook, struct mbuf *m, meta_p meta, |
500 struct mbuf **ret_m, meta_p *ret_meta) | 500 struct mbuf **ret_m, meta_p *ret_meta, struct ng_mesg **resp) |
501{ 502 struct mbuf *m2; 503 struct trxd *dp, *dp2; 504 struct schan *sch; 505 struct softc *sc; 506 int chan, pitch, len; 507 508 sch = hook->private; --- 139 unchanged lines hidden (view full) --- 648 /* Initialize this channel */ 649 sc->m32_mem.ccb = 0x00008000 + (chan << 8); 650 sc->m32x->cmd = 0x1; 651 DELAY(1000); 652 u = sc->m32x->stat; 653 if (!(u & 1)) 654 printf("%s: init chan %d stat %08x\n", sc->name, chan, u); 655 sc->m32x->stat = 1; | 501{ 502 struct mbuf *m2; 503 struct trxd *dp, *dp2; 504 struct schan *sch; 505 struct softc *sc; 506 int chan, pitch, len; 507 508 sch = hook->private; --- 139 unchanged lines hidden (view full) --- 648 /* Initialize this channel */ 649 sc->m32_mem.ccb = 0x00008000 + (chan << 8); 650 sc->m32x->cmd = 0x1; 651 DELAY(1000); 652 u = sc->m32x->stat; 653 if (!(u & 1)) 654 printf("%s: init chan %d stat %08x\n", sc->name, chan, u); 655 sc->m32x->stat = 1; |
656 /* probably not at splnet, force outward queueing */ 657 hook->peer->flags |= HK_QUEUE; |
|
656 657 return (0); 658} 659 660/* 661 * CLOSE 662 */ 663static int --- 361 unchanged lines hidden (view full) --- 1025 dp = sch->r1; 1026 if (vtophys(dp) == sc->m32_mem.crxd[chan]) 1027 return; 1028 m = dp->m; 1029 dp->m = 0; 1030 m->m_pkthdr.len = m->m_len = (dp->status >> 16) & 0x1fff; 1031 err = (dp->status >> 8) & 0xff; 1032 if (!err) { | 658 659 return (0); 660} 661 662/* 663 * CLOSE 664 */ 665static int --- 361 unchanged lines hidden (view full) --- 1027 dp = sch->r1; 1028 if (vtophys(dp) == sc->m32_mem.crxd[chan]) 1029 return; 1030 m = dp->m; 1031 dp->m = 0; 1032 m->m_pkthdr.len = m->m_len = (dp->status >> 16) & 0x1fff; 1033 err = (dp->status >> 8) & 0xff; 1034 if (!err) { |
1033 ng_queue_data(sch->hook, m, NULL); | 1035 int error; 1036 NG_SEND_DATA_ONLY(error, sch->hook, m); |
1034 sch->last_recv = time_second; | 1037 sch->last_recv = time_second; |
1035 m = 0; | |
1036 /* we could be down by now... */ 1037 if (sch->state != UP) 1038 return; 1039 } else if (err & 0x40) { 1040 sch->short_error++; 1041 } else if (err & 0x10) { 1042 sch->crc_error++; 1043 } else if (err & 0x08) { --- 303 unchanged lines hidden --- | 1038 /* we could be down by now... */ 1039 if (sch->state != UP) 1040 return; 1041 } else if (err & 0x40) { 1042 sch->short_error++; 1043 } else if (err & 0x10) { 1044 sch->crc_error++; 1045 } else if (err & 0x08) { --- 303 unchanged lines hidden --- |