75#define USBETH_MAXUNITS 4
84 unit = usbeth_units[idx];
108 unit = usbeth_units[idx];
110 if (unit->
softc == softc) {
122static int usb_ether_open(cfe_devctx_t *ctx)
127static int usb_ether_read( cfe_devctx_t *ctx, iocb_buffer_t *buffer )
133 return CFE_ERR_NOTREADY;
142static int usb_ether_inpstat( cfe_devctx_t *ctx, iocb_inpstat_t *inpstat )
148 inpstat->inp_status = 0;
158static int usb_ether_write(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
164 return CFE_ERR_NOTREADY;
174static int usb_ether_ioctl(cfe_devctx_t *ctx,iocb_buffer_t *buffer)
181 return CFE_ERR_UNSUPPORTED;
184 switch( (
int)buffer->buf_ioctlcmd ) {
185 case IOCTL_ETHER_GETHWADDR:
189 retval = CFE_ERR_UNSUPPORTED;
196static int usb_ether_close(cfe_devctx_t *ctx)
201static void usb_ether_probe(cfe_driver_t *drv,
202 unsigned long probe_a,
unsigned long probe_b,
210 unit->
unit = (int)probe_a;
212 usbeth_units[unit->
unit] = unit;
214 xsprintf(descr,
"USB Ethernet unit %d",(
int)probe_a);
215 cfe_attach(drv,unit,
NULL,descr);
221const static cfe_devdisp_t usb_ether_dispatch =
235 "USB-Ethernet Device",
#define KMALLOC(size, align)
int(* read)(void *, hsaddr_t buf)
int(* write)(void *, hsaddr_t buf, int len)
int(* getaddr)(void *, hsaddr_t addr)
const cfe_driver_t usb_ether
int usbeth_register(usbeth_disp_t *disp, void *softc)
struct usbeth_unit_s usbeth_unit_t
void usbeth_unregister(void *softc)