Add a flag to run's device list which uses a standard scsi eject.
The flag indicates that the mcu doesn't need to load firmware. Tested by: Alex Deiter <alex dot deiter at gmail.com>, myself Tested on: ASUS USB-N66
This commit is contained in:
parent
b37cb98186
commit
5c5e99d273
@ -100,7 +100,8 @@ SYSCTL_INT(_hw_usb_run, OID_AUTO, debug, CTLFLAG_RW, &run_debug, 0,
|
||||
static const STRUCT_USB_HOST_ID run_devs[] = {
|
||||
#define RUN_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) }
|
||||
#define RUN_DEV_EJECT(v,p) \
|
||||
{ USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, 0) }
|
||||
{ USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, RUN_EJECT) }
|
||||
#define RUN_EJECT 1
|
||||
RUN_DEV(ABOCOM, RT2770),
|
||||
RUN_DEV(ABOCOM, RT2870),
|
||||
RUN_DEV(ABOCOM, RT3070),
|
||||
@ -315,7 +316,7 @@ static const STRUCT_USB_HOST_ID run_devs[] = {
|
||||
RUN_DEV(ZINWELL, RT3072_2),
|
||||
RUN_DEV(ZYXEL, RT2870_1),
|
||||
RUN_DEV(ZYXEL, RT2870_2),
|
||||
RUN_DEV(ZYXEL, NWD2705),
|
||||
RUN_DEV_EJECT(ZYXEL, NWD2705),
|
||||
RUN_DEV_EJECT(RALINK, RT_STOR),
|
||||
#undef RUN_DEV_EJECT
|
||||
#undef RUN_DEV
|
||||
@ -707,6 +708,8 @@ run_attach(device_t self)
|
||||
device_set_usb_desc(self);
|
||||
sc->sc_udev = uaa->device;
|
||||
sc->sc_dev = self;
|
||||
if (USB_GET_DRIVER_INFO(uaa) != RUN_EJECT)
|
||||
sc->sc_flags |= RUN_FLAG_FWLOAD_NEEDED;
|
||||
|
||||
mtx_init(&sc->sc_mtx, device_get_nameunit(sc->sc_dev),
|
||||
MTX_NETWORK_LOCK, MTX_DEF);
|
||||
@ -1151,7 +1154,7 @@ run_load_microcode(struct run_softc *sc)
|
||||
}
|
||||
|
||||
/* write microcode image */
|
||||
if (sc->mac_ver != 0x3593) {
|
||||
if (sc->sc_flags & RUN_FLAG_FWLOAD_NEEDED) {
|
||||
run_write_region_1(sc, RT2870_FW_BASE, base, 4096);
|
||||
run_write(sc, RT2860_H2M_MAILBOX_CID, 0xffffffff);
|
||||
run_write(sc, RT2860_H2M_MAILBOX_STATUS, 0xffffffff);
|
||||
|
@ -154,6 +154,11 @@ struct run_softc {
|
||||
device_t sc_dev;
|
||||
struct usb_device *sc_udev;
|
||||
struct ifnet *sc_ifp;
|
||||
int sc_need_fwload;
|
||||
|
||||
int sc_flags;
|
||||
#define RUN_FLAG_FWLOAD_NEEDED 0x01
|
||||
|
||||
uint16_t wcid_stats[RT2870_WCID_MAX + 1][3];
|
||||
#define RUN_TXCNT 0
|
||||
#define RUN_SUCCESS 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user