diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2005-03-17 09:01:44 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2005-03-17 09:01:44 +0000 |
commit | 20bbfa6368838da3e991afa70f6b97a95a76b3ad (patch) | |
tree | 11c6c31ef76fa685d850b7a915409d1cd8fb6ccc /sys/dev | |
parent | 2d1edf079f81c3f0ca775b7cd3a8caa6cb791ab4 (diff) |
- fix ralink url
- add usb events for attach/detach
- pre-allocate rx buffers so they are not allocated in an interrupt
context
- let ural_free_rx_list() do the cleanup
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/usb/if_ral.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sys/dev/usb/if_ral.c b/sys/dev/usb/if_ral.c index 0fac256b8f2..00f4e257a53 100644 --- a/sys/dev/usb/if_ral.c +++ b/sys/dev/usb/if_ral.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ral.c,v 1.2 2005/03/16 21:21:39 damien Exp $ */ +/* $OpenBSD: if_ral.c,v 1.3 2005/03/17 09:01:43 damien Exp $ */ /*- * Copyright (c) 2005 @@ -19,7 +19,7 @@ /*- * Ralink Technology RT2500USB chipset driver - * http://www.uralinktech.com/ + * http://www.ralinktech.com/ */ #include "bpfilter.h" @@ -465,6 +465,9 @@ USB_ATTACH(ural) sc->sc_txtap.wt_ihdr.it_present = htole32(RAL_TX_RADIOTAP_PRESENT); #endif + usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, + USBDEV(sc->sc_dev)); + USB_ATTACH_SUCCESS_RETURN; } @@ -482,6 +485,9 @@ USB_DETACH(ural) ieee80211_ifdetach(ifp); if_detach(ifp); + usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev, + USBDEV(sc->sc_dev)); + return 0; } @@ -563,6 +569,13 @@ ural_alloc_rx_list(struct ural_softc *sc) goto fail; } + if (usbd_alloc_buffer(data->xfer, MCLBYTES) == NULL) { + printf("%s: could not allocate rx buffer\n", + USBDEVNAME(sc->sc_dev)); + error = ENOMEM; + goto fail; + } + MGETHDR(data->m, M_DONTWAIT, MT_DATA); if (data->m == NULL) { printf("%s: could not allocate rx mbuf\n", @@ -573,8 +586,6 @@ ural_alloc_rx_list(struct ural_softc *sc) MCLGET(data->m, M_DONTWAIT); if (!(data->m->m_flags & M_EXT)) { - m_freem(data->m); - data->m = NULL; printf("%s: could not allocate rx mbuf cluster\n", USBDEVNAME(sc->sc_dev)); error = ENOMEM; |