Garbage collect legacy upgt driver now that it is available in the new

USB implementation.

Garbage collect legacy USB ethernet framework now that it is unused.
This commit is contained in:
Robert Watson 2009-05-13 17:11:25 +00:00
parent 8553eea5ce
commit c834e61abd
4 changed files with 0 additions and 3211 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,462 +0,0 @@
/* $OpenBSD: if_upgtvar.h,v 1.14 2008/02/02 13:48:44 mglocker Exp $ */
/* $FreeBSD$ */
/*
* Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
struct upgt_softc;
/*
* General values.
*/
#define UPGT_IFACE_INDEX 0
#define UPGT_CONFIG_NO 1
#define UPGT_USB_TIMEOUT 1000
#define UPGT_FIRMWARE_TIMEOUT 10
#define UPGT_MEMADDR_FIRMWARE_START 0x00020000 /* 512 bytes large */
#define UPGT_MEMSIZE_FRAME_HEAD 0x0070
#define UPGT_MEMSIZE_RX 0x3500
#define UPGT_TX_COUNT 2
/* device flags */
#define UPGT_DEVICE_ATTACHED (1 << 0)
/* leds */
#define UPGT_LED_OFF 0
#define UPGT_LED_ON 1
#define UPGT_LED_BLINK 2
/*
* Firmware.
*/
#define UPGT_FW_BLOCK_SIZE 512
#define UPGT_BRA_FWTYPE_SIZE 4
#define UPGT_BRA_FWTYPE_LM86 "LM86"
#define UPGT_BRA_FWTYPE_LM87 "LM87"
enum upgt_fw_type {
UPGT_FWTYPE_LM86,
UPGT_FWTYPE_LM87
};
#define UPGT_BRA_TYPE_FW 0x80000001
#define UPGT_BRA_TYPE_VERSION 0x80000002
#define UPGT_BRA_TYPE_DEPIF 0x80000003
#define UPGT_BRA_TYPE_EXPIF 0x80000004
#define UPGT_BRA_TYPE_DESCR 0x80000101
#define UPGT_BRA_TYPE_END 0xff0000ff
struct upgt_fw_bra_option {
uint32_t type;
uint32_t len;
uint8_t data[];
} __packed;
struct upgt_fw_bra_descr {
uint32_t unknown1;
uint32_t memaddr_space_start;
uint32_t memaddr_space_end;
uint32_t unknown2;
uint32_t unknown3;
uint8_t rates[20];
} __packed;
#define UPGT_X2_SIGNATURE_SIZE 4
#define UPGT_X2_SIGNATURE "x2 "
struct upgt_fw_x2_header {
uint8_t signature[4];
uint32_t startaddr;
uint32_t len;
uint32_t crc;
} __packed;
/*
* EEPROM.
*/
#define UPGT_EEPROM_SIZE 8192
#define UPGT_EEPROM_BLOCK_SIZE 1020
struct upgt_eeprom_header {
/* 14 bytes */
uint32_t magic;
uint16_t pad1;
uint16_t preamble_len;
uint32_t pad2;
/* data */
} __packed;
#define UPGT_EEPROM_TYPE_END 0x0000
#define UPGT_EEPROM_TYPE_NAME 0x0001
#define UPGT_EEPROM_TYPE_SERIAL 0x0003
#define UPGT_EEPROM_TYPE_MAC 0x0101
#define UPGT_EEPROM_TYPE_HWRX 0x1001
#define UPGT_EEPROM_TYPE_CHIP 0x1002
#define UPGT_EEPROM_TYPE_FREQ3 0x1903
#define UPGT_EEPROM_TYPE_FREQ4 0x1904
#define UPGT_EEPROM_TYPE_FREQ5 0x1905
#define UPGT_EEPROM_TYPE_FREQ6 0x1906
#define UPGT_EEPROM_TYPE_OFF 0xffff
struct upgt_eeprom_option {
uint16_t len;
uint16_t type;
uint8_t data[];
/* data */
} __packed;
#define UPGT_EEPROM_RX_CONST 0x88
struct upgt_eeprom_option_hwrx {
uint32_t pad1;
uint8_t rxfilter;
uint8_t pad2[15];
} __packed;
struct upgt_eeprom_freq3_header {
uint8_t flags;
uint8_t elements;
} __packed;
struct upgt_eeprom_freq4_header {
uint8_t flags;
uint8_t elements;
uint8_t settings;
uint8_t type;
} __packed;
struct upgt_eeprom_freq4_1 {
uint16_t freq;
uint8_t data[50];
} __packed;
struct upgt_eeprom_freq4_2 {
uint16_t head;
uint8_t subtails[4];
uint8_t tail;
} __packed;
/*
* LMAC protocol.
*/
struct upgt_lmac_mem {
uint32_t addr;
uint32_t chksum;
} __packed;
#define UPGT_H1_FLAGS_TX_MGMT 0x00 /* for TX: mgmt frame */
#define UPGT_H1_FLAGS_TX_NO_CALLBACK 0x01 /* for TX: no USB callback */
#define UPGT_H1_FLAGS_TX_DATA 0x10 /* for TX: data frame */
#define UPGT_H1_TYPE_RX_DATA 0x00 /* 802.11 RX data frame */
#define UPGT_H1_TYPE_RX_DATA_MGMT 0x04 /* 802.11 RX mgmt frame */
#define UPGT_H1_TYPE_TX_DATA 0x40 /* 802.11 TX data frame */
#define UPGT_H1_TYPE_CTRL 0x80 /* control frame */
struct upgt_lmac_h1 {
/* 4 bytes */
uint8_t flags;
uint8_t type;
uint16_t len;
} __packed;
#define UPGT_H2_TYPE_TX_ACK_NO 0x0000
#define UPGT_H2_TYPE_TX_ACK_YES 0x0001
#define UPGT_H2_TYPE_MACFILTER 0x0000
#define UPGT_H2_TYPE_CHANNEL 0x0001
#define UPGT_H2_TYPE_TX_DONE 0x0008
#define UPGT_H2_TYPE_STATS 0x000a
#define UPGT_H2_TYPE_EEPROM 0x000c
#define UPGT_H2_TYPE_LED 0x000d
#define UPGT_H2_FLAGS_TX_ACK_NO 0x0101
#define UPGT_H2_FLAGS_TX_ACK_YES 0x0707
struct upgt_lmac_h2 {
/* 8 bytes */
uint32_t reqid;
uint16_t type;
uint16_t flags;
} __packed;
struct upgt_lmac_header {
/* 12 bytes */
struct upgt_lmac_h1 header1;
struct upgt_lmac_h2 header2;
} __packed;
struct upgt_lmac_eeprom {
/* 16 bytes */
struct upgt_lmac_h1 header1;
struct upgt_lmac_h2 header2;
uint16_t offset;
uint16_t len;
/* data */
} __packed;
#define UPGT_FILTER_TYPE_NONE 0x0000
#define UPGT_FILTER_TYPE_STA 0x0001
#define UPGT_FILTER_TYPE_IBSS 0x0002
#define UPGT_FILTER_TYPE_HOSTAP 0x0004
#define UPGT_FILTER_TYPE_MONITOR 0x0010
#define UPGT_FILTER_TYPE_RESET 0x0020
#define UPGT_FILTER_UNKNOWN1 0x0002
#define UPGT_FILTER_UNKNOWN2 0x0ca8
#define UPGT_FILTER_UNKNOWN3 0xffff
#define UPGT_FILTER_MONITOR_UNKNOWN1 0x0000
#define UPGT_FILTER_MONITOR_UNKNOWN2 0x0000
#define UPGT_FILTER_MONITOR_UNKNOWN3 0x0000
struct upgt_lmac_filter {
struct upgt_lmac_h1 header1;
struct upgt_lmac_h2 header2;
/* 32 bytes */
uint16_t type;
uint8_t dst[IEEE80211_ADDR_LEN];
uint8_t src[IEEE80211_ADDR_LEN];
uint16_t unknown1;
uint32_t rxaddr;
uint16_t unknown2;
uint32_t rxhw;
uint16_t unknown3;
uint32_t unknown4;
} __packed;
/* frequence 3 data */
struct upgt_lmac_freq3 {
uint16_t freq;
uint8_t data[6];
} __packed;
/* frequence 4 data */
struct upgt_lmac_freq4 {
struct upgt_eeprom_freq4_2 cmd;
uint8_t pad;
};
/* frequence 6 data */
struct upgt_lmac_freq6 {
uint16_t freq;
uint8_t data[8];
} __packed;
#define UPGT_CHANNEL_UNKNOWN1 0x0001
#define UPGT_CHANNEL_UNKNOWN2 0x0000
#define UPGT_CHANNEL_UNKNOWN3 0x48
struct upgt_lmac_channel {
struct upgt_lmac_h1 header1;
struct upgt_lmac_h2 header2;
/* 112 bytes */
uint16_t unknown1;
uint16_t unknown2;
uint8_t pad1[20];
struct upgt_lmac_freq6 freq6;
uint8_t settings;
uint8_t unknown3;
uint8_t freq3_1[4];
struct upgt_lmac_freq4 freq4[8];
uint8_t freq3_2[4];
uint32_t pad2;
} __packed;
#define UPGT_LED_MODE_SET 0x0003
#define UPGT_LED_ACTION_OFF 0x0002
#define UPGT_LED_ACTION_ON 0x0003
#define UPGT_LED_ACTION_TMP_DUR 100 /* ms */
struct upgt_lmac_led {
struct upgt_lmac_h1 header1;
struct upgt_lmac_h2 header2;
uint16_t mode;
uint16_t action_fix;
uint16_t action_tmp;
uint16_t action_tmp_dur;
} __packed;
struct upgt_lmac_stats {
struct upgt_lmac_h1 header1;
struct upgt_lmac_h2 header2;
uint8_t data[76];
} __packed;
struct upgt_lmac_rx_desc {
struct upgt_lmac_h1 header1;
/* 16 bytes */
uint16_t freq;
uint8_t unknown1;
uint8_t rate;
uint8_t rssi;
uint8_t pad;
uint16_t unknown2;
uint32_t timestamp;
uint32_t unknown3;
uint8_t data[];
} __packed;
#define UPGT_TX_DESC_KEY_EXISTS 0x01
struct upgt_lmac_tx_desc_wep {
uint8_t key_exists;
uint8_t key_len;
uint8_t key_val[16];
} __packed;
#define UPGT_TX_DESC_TYPE_BEACON 0x00000000
#define UPGT_TX_DESC_TYPE_PROBE 0x00000001
#define UPGT_TX_DESC_TYPE_MGMT 0x00000002
#define UPGT_TX_DESC_TYPE_DATA 0x00000004
#define UPGT_TX_DESC_PAD3_SIZE 2
struct upgt_lmac_tx_desc {
struct upgt_lmac_h1 header1;
struct upgt_lmac_h2 header2;
uint8_t rates[8];
uint16_t pad1;
struct upgt_lmac_tx_desc_wep wep_key;
uint32_t type;
uint32_t pad2;
uint32_t unknown1;
uint32_t unknown2;
uint8_t pad3[2];
/* 802.11 frame data */
} __packed;
#define UPGT_TX_DONE_DESC_STATUS_OK 0x0001
struct upgt_lmac_tx_done_desc {
struct upgt_lmac_h1 header1;
struct upgt_lmac_h2 header2;
uint16_t status;
uint16_t rssi;
uint16_t seq;
uint16_t unknown;
} __packed;
/*
* USB xfers.
*/
struct upgt_data {
struct upgt_softc *sc;
usbd_xfer_handle xfer;
uint8_t *buf;
struct ieee80211_node *ni;
struct mbuf *m;
uint32_t addr;
uint8_t use;
};
/*
* Prism memory.
*/
struct upgt_memory_page {
uint8_t used;
uint32_t addr;
} __packed;
#define UPGT_MEMORY_MAX_PAGES 8
struct upgt_memory {
uint8_t pages;
struct upgt_memory_page page[UPGT_MEMORY_MAX_PAGES];
} __packed;
/*
* BPF
*/
struct upgt_rx_radiotap_header {
struct ieee80211_radiotap_header wr_ihdr;
uint8_t wr_flags;
uint8_t wr_rate;
uint16_t wr_chan_freq;
uint16_t wr_chan_flags;
int8_t wr_antsignal;
} __packed;
#define UPGT_RX_RADIOTAP_PRESENT \
((1 << IEEE80211_RADIOTAP_FLAGS) | \
(1 << IEEE80211_RADIOTAP_RATE) | \
(1 << IEEE80211_RADIOTAP_CHANNEL) | \
(1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL))
struct upgt_tx_radiotap_header {
struct ieee80211_radiotap_header wt_ihdr;
uint8_t wt_flags;
uint8_t wt_rate;
uint16_t wt_chan_freq;
uint16_t wt_chan_flags;
} __packed;
#define UPGT_TX_RADIOTAP_PRESENT \
((1 << IEEE80211_RADIOTAP_FLAGS) | \
(1 << IEEE80211_RADIOTAP_RATE) | \
(1 << IEEE80211_RADIOTAP_CHANNEL))
struct upgt_vap {
struct ieee80211vap vap;
int (*newstate)(struct ieee80211vap *,
enum ieee80211_state, int);
};
#define UPGT_VAP(vap) ((struct upgt_vap *)(vap))
struct upgt_softc {
device_t sc_dev;
struct ifnet *sc_ifp;
usbd_device_handle sc_udev;
usbd_interface_handle sc_iface;
struct mtx sc_mtx;
int sc_if_flags;
int sc_debug;
struct usb_task sc_mcasttask;
struct usb_task sc_task;
struct usb_task sc_scantask;
#define UPGT_SET_CHANNEL 2
int sc_scan_action;
enum ieee80211_state sc_state;
int sc_arg;
int sc_led_blink;
struct callout sc_led_ch;
uint8_t sc_cur_rateset[8];
/* watchdog */
int sc_tx_timer;
struct callout sc_watchdog_ch;
/* Firmware. */
int sc_fw_type;
/* memory addresses on device */
uint32_t sc_memaddr_frame_start;
uint32_t sc_memaddr_frame_end;
uint32_t sc_memaddr_rx_start;
struct upgt_memory sc_memory;
/* data which we found in the EEPROM */
uint8_t sc_eeprom[UPGT_EEPROM_SIZE];
uint16_t sc_eeprom_hwrx;
struct upgt_lmac_freq3 sc_eeprom_freq3[IEEE80211_CHAN_MAX];
struct upgt_lmac_freq4 sc_eeprom_freq4[IEEE80211_CHAN_MAX][8];
struct upgt_lmac_freq6 sc_eeprom_freq6[IEEE80211_CHAN_MAX];
uint8_t sc_eeprom_freq6_settings;
/* RX/TX */
int sc_rx_no;
int sc_tx_no;
usbd_pipe_handle sc_rx_pipeh;
usbd_pipe_handle sc_tx_pipeh;
struct upgt_data tx_data[UPGT_TX_COUNT];
struct upgt_data rx_data;
struct upgt_data cmd_data;
int tx_queued;
struct usb_task sc_task_tx;
/* BPF */
struct upgt_rx_radiotap_header sc_rxtap;
int sc_rxtap_len;
struct upgt_tx_radiotap_header sc_txtap;
int sc_txtap_len;
};
#define UPGT_LOCK(sc) mtx_lock(&(sc)->sc_mtx)
#define UPGT_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx)

View File

@ -1,283 +0,0 @@
/*-
* Copyright (c) 1997, 1998, 1999, 2000
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Bill Paul.
* 4. Neither the name of the author nor the names of any co-contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* Callbacks in the USB code operate at splusb() (actually splbio()
* in FreeBSD). However adding packets to the input queues has to be
* done at splimp(). It is conceivable that this arrangement could
* trigger a condition where the splimp() is ignored and the input
* queues could get trampled in spite of our best effors to prevent
* it. To work around this, we implement a special input queue for
* USB ethernet adapter drivers. Rather than passing the frames directly
* to ether_input(), we pass them here, then schedule a soft interrupt
* to hand them to ether_input() later, outside of the USB interrupt
* context.
*
* It's questional as to whether this code should be expanded to
* handle other kinds of devices, or handle USB transfer callbacks
* in general. Right now, I need USB network interfaces to work
* properly.
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
#include <sys/mbuf.h>
#include <sys/malloc.h>
#include <sys/socket.h>
#include <sys/taskqueue.h>
#include <net/if.h>
#include <net/if_types.h>
#include <net/if_arp.h>
#include <net/ethernet.h>
#include <net/netisr.h>
#include <net/bpf.h>
#include <dev/usb/usb.h>
#include <dev/usb/usb_ethersubr.h>
static struct ifqueue usbq_rx;
static struct ifqueue usbq_tx;
static int mtx_inited = 0;
static void usbintr (void);
static void
usbintr(void)
{
struct mbuf *m;
struct usb_qdat *q;
struct ifnet *ifp;
mtx_lock(&Giant);
/* Check the RX queue */
while(1) {
IF_DEQUEUE(&usbq_rx, m);
if (m == NULL)
break;
q = (struct usb_qdat *)m->m_pkthdr.rcvif;
ifp = q->ifp;
m->m_pkthdr.rcvif = ifp;
(*ifp->if_input)(ifp, m);
/* Re-arm the receiver */
(*q->if_rxstart)(ifp);
if (ifp->if_snd.ifq_head != NULL)
(*ifp->if_start)(ifp);
}
/* Check the TX queue */
while(1) {
IF_DEQUEUE(&usbq_tx, m);
if (m == NULL)
break;
ifp = m->m_pkthdr.rcvif;
m_freem(m);
if (ifp->if_snd.ifq_head != NULL)
(*ifp->if_start)(ifp);
}
mtx_unlock(&Giant);
return;
}
void
usb_register_netisr(void)
{
if (mtx_inited)
return;
netisr_register(NETISR_USB, (netisr_t *)usbintr, NULL,
NETISR_FORCEQUEUE);
mtx_init(&usbq_tx.ifq_mtx, "usbq_tx_mtx", NULL, MTX_DEF);
mtx_init(&usbq_rx.ifq_mtx, "usbq_rx_mtx", NULL, MTX_DEF);
mtx_inited++;
return;
}
/*
* Must be called at splusb() (actually splbio()). This should be
* the case when called from a transfer callback routine.
*/
void
usb_ether_input(m)
struct mbuf *m;
{
IF_ENQUEUE(&usbq_rx, m);
schednetisr(NETISR_USB);
return;
}
void
usb_tx_done(m)
struct mbuf *m;
{
IF_ENQUEUE(&usbq_tx, m);
schednetisr(NETISR_USB);
return;
}
struct mbuf *
usb_ether_newbuf(void)
{
struct mbuf *m_new;
m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
if (m_new == NULL)
return (NULL);
m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
m_adj(m_new, ETHER_ALIGN);
return (m_new);
}
int
usb_ether_rx_list_init(void *sc, struct ue_cdata *cd,
usbd_device_handle ue_udev)
{
struct ue_chain *c;
int i;
for (i = 0; i < UE_RX_LIST_CNT; i++) {
c = &cd->ue_rx_chain[i];
c->ue_sc = sc;
c->ue_idx = i;
c->ue_mbuf = usb_ether_newbuf();
if (c->ue_mbuf == NULL)
return (ENOBUFS);
if (c->ue_xfer == NULL) {
c->ue_xfer = usbd_alloc_xfer(ue_udev);
if (c->ue_xfer == NULL)
return (ENOBUFS);
c->ue_buf = usbd_alloc_buffer(c->ue_xfer, UE_BUFSZ);
if (c->ue_buf == NULL)
return (ENOBUFS);
}
}
return (0);
}
int
usb_ether_tx_list_init(void *sc, struct ue_cdata *cd,
usbd_device_handle ue_udev)
{
struct ue_chain *c;
int i;
for (i = 0; i < UE_TX_LIST_CNT; i++) {
c = &cd->ue_tx_chain[i];
c->ue_sc = sc;
c->ue_idx = i;
c->ue_mbuf = NULL;
if (c->ue_xfer == NULL) {
c->ue_xfer = usbd_alloc_xfer(ue_udev);
if (c->ue_xfer == NULL)
return (ENOBUFS);
c->ue_buf = usbd_alloc_buffer(c->ue_xfer, UE_BUFSZ);
if (c->ue_buf == NULL)
return (ENOBUFS);
}
}
return (0);
}
void
usb_ether_rx_list_free(struct ue_cdata *cd)
{
int i;
for (i = 0; i < UE_RX_LIST_CNT; i++) {
if (cd->ue_rx_chain[i].ue_mbuf != NULL) {
m_freem(cd->ue_rx_chain[i].ue_mbuf);
cd->ue_rx_chain[i].ue_mbuf = NULL;
}
if (cd->ue_rx_chain[i].ue_xfer != NULL) {
usbd_free_xfer(cd->ue_rx_chain[i].ue_xfer);
cd->ue_rx_chain[i].ue_xfer = NULL;
}
}
}
void
usb_ether_tx_list_free(struct ue_cdata *cd)
{
int i;
for (i = 0; i < UE_RX_LIST_CNT; i++) {
if (cd->ue_tx_chain[i].ue_mbuf != NULL) {
m_freem(cd->ue_tx_chain[i].ue_mbuf);
cd->ue_tx_chain[i].ue_mbuf = NULL;
}
if (cd->ue_tx_chain[i].ue_xfer != NULL) {
usbd_free_xfer(cd->ue_tx_chain[i].ue_xfer);
cd->ue_tx_chain[i].ue_xfer = NULL;
}
}
}
void
usb_ether_task_init(device_t dev, int flags, struct usb_taskqueue *tq)
{
/* nothing for now. */
}
void
usb_ether_task_enqueue(struct usb_taskqueue *tq, struct task *task)
{
taskqueue_enqueue(taskqueue_thread, task);
}
void
usb_ether_task_drain(struct usb_taskqueue *tq, struct task *task)
{
taskqueue_drain(taskqueue_thread, task);
}
void
usb_ether_task_destroy(struct usb_taskqueue *tq)
{
/* nothing for now */
}

View File

@ -1,91 +0,0 @@
/*-
* Copyright (c) 1997, 1998, 1999, 2000
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Bill Paul.
* 4. Neither the name of the author nor the names of any co-contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifndef _USB_ETHERSUBR_H_
#define _USB_ETHERSUBR_H_
#include <sys/bus.h>
#include <sys/module.h>
#include <dev/usb/usbdi.h>
#define UE_TX_LIST_CNT 1
#define UE_RX_LIST_CNT 1
#define UE_BUFSZ 1536
struct usb_qdat {
struct ifnet *ifp;
void (*if_rxstart) (struct ifnet *);
};
struct ue_chain {
void *ue_sc;
usbd_xfer_handle ue_xfer;
char *ue_buf;
struct mbuf *ue_mbuf;
int ue_idx;
usbd_status ue_status;
};
struct ue_cdata {
struct ue_chain ue_tx_chain[UE_TX_LIST_CNT];
struct ue_chain ue_rx_chain[UE_RX_LIST_CNT];
void *ue_ibuf;
int ue_tx_prod;
int ue_tx_cons;
int ue_tx_cnt;
int ue_rx_prod;
};
void usb_register_netisr (void);
void usb_ether_input (struct mbuf *);
void usb_tx_done (struct mbuf *);
struct mbuf *usb_ether_newbuf (void);
int usb_ether_rx_list_init (void *, struct ue_cdata *,
usbd_device_handle);
int usb_ether_tx_list_init (void *, struct ue_cdata *,
usbd_device_handle);
void usb_ether_rx_list_free (struct ue_cdata *);
void usb_ether_tx_list_free (struct ue_cdata *);
struct usb_taskqueue {
int dummy;
};
void usb_ether_task_init(device_t, int, struct usb_taskqueue *);
void usb_ether_task_enqueue(struct usb_taskqueue *, struct task *);
void usb_ether_task_drain(struct usb_taskqueue *, struct task *);
void usb_ether_task_destroy(struct usb_taskqueue *);
#endif /* _USB_ETHERSUBR_H_ */