1/*
2 * ng_bt3c_pccard.c
3 *
4 * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
--- 12 unchanged lines hidden (view full) ---
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $Id: ng_bt3c_pccard.c,v 1.2 2002/11/12 00:51:45 max Exp $
29 * $FreeBSD: head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c 107120 2002-11-20 23:01:59Z julian $
30 *
31 * XXX XXX XX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
32 *
33 * Based on information obrained from: Jose Orlando Pereira <jop@di.uminho.pt>
34 * and disassembled w2k driver.
35 *
36 * XXX XXX XX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
37 *
--- 789 unchanged lines hidden (view full) ---
827 bt3c_set_address(sc, 0x7480);
828
829 for (i = 0; i < count; i++) {
830 /* Allocate new mbuf if needed */
831 if (sc->m == NULL) {
832 sc->state = NG_BT3C_W4_PKT_IND;
833 sc->want = 1;
834
835 MGETHDR(sc->m, M_DONTWAIT, MT_DATA);
836 if (sc->m == NULL) {
837 NG_BT3C_ERR(sc->dev, "Could not get mbuf\n");
838 NG_BT3C_STAT_IERROR(sc->stat);
839
840 break; /* XXX lost of sync */
841 }
842
843 sc->m->m_len = sc->m->m_pkthdr.len = 0;
--- 147 unchanged lines hidden (view full) ---
991 else {
992 len = MLEN;
993
994 while (m->m_next != NULL)
995 m = m->m_next;
996 }
997
998 if (m->m_len >= len) {
999 MGET(m->m_next, M_DONTWAIT, m0->m_type);
1000 if (m->m_next == NULL)
1001 return (ENOBUFS);
1002
1003 m = m->m_next;
1004 m->m_len = 0;
1005 }
1006
1007 m->m_data[m->m_len ++] = (char) c;
--- 240 unchanged lines hidden ---
2 * ng_bt3c_pccard.c
3 *
4 * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
--- 12 unchanged lines hidden (view full) ---
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $Id: ng_bt3c_pccard.c,v 1.2 2002/11/12 00:51:45 max Exp $
29 * $FreeBSD: head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c 107120 2002-11-20 23:01:59Z julian $
30 *
31 * XXX XXX XX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
32 *
33 * Based on information obrained from: Jose Orlando Pereira <jop@di.uminho.pt>
34 * and disassembled w2k driver.
35 *
36 * XXX XXX XX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
37 *
--- 789 unchanged lines hidden (view full) ---
827 bt3c_set_address(sc, 0x7480);
828
829 for (i = 0; i < count; i++) {
830 /* Allocate new mbuf if needed */
831 if (sc->m == NULL) {
832 sc->state = NG_BT3C_W4_PKT_IND;
833 sc->want = 1;
834
835 MGETHDR(sc->m, M_DONTWAIT, MT_DATA);
836 if (sc->m == NULL) {
837 NG_BT3C_ERR(sc->dev, "Could not get mbuf\n");
838 NG_BT3C_STAT_IERROR(sc->stat);
839
840 break; /* XXX lost of sync */
841 }
842
843 sc->m->m_len = sc->m->m_pkthdr.len = 0;
--- 147 unchanged lines hidden (view full) ---
991 else {
992 len = MLEN;
993
994 while (m->m_next != NULL)
995 m = m->m_next;
996 }
997
998 if (m->m_len >= len) {
999 MGET(m->m_next, M_DONTWAIT, m0->m_type);
1000 if (m->m_next == NULL)
1001 return (ENOBUFS);
1002
1003 m = m->m_next;
1004 m->m_len = 0;
1005 }
1006
1007 m->m_data[m->m_len ++] = (char) c;
--- 240 unchanged lines hidden ---