Date: Mon, 21 Mar 2016 21:02:57 +0000 (UTC) From: Andriy Voskoboinyk <avos@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297165 - head/sys/dev/usb/wlan Message-ID: <201603212102.u2LL2vu3023587@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avos Date: Mon Mar 21 21:02:57 2016 New Revision: 297165 URL: https://svnweb.freebsd.org/changeset/base/297165 Log: rum: separate some microcontroller vendor-specific requests into rum_do_mcu_request() This change should be no-op. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5542 Modified: head/sys/dev/usb/wlan/if_rum.c Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Mon Mar 21 20:52:09 2016 (r297164) +++ head/sys/dev/usb/wlan/if_rum.c Mon Mar 21 21:02:57 2016 (r297165) @@ -154,6 +154,7 @@ static usb_callback_t rum_bulk_write_cal static usb_error_t rum_do_request(struct rum_softc *sc, struct usb_device_request *req, void *data); +static usb_error_t rum_do_mcu_request(struct rum_softc *sc, int); static struct ieee80211vap *rum_vap_create(struct ieee80211com *, const char [IFNAMSIZ], int, enum ieee80211_opmode, int, const uint8_t [IEEE80211_ADDR_LEN], @@ -629,6 +630,20 @@ rum_do_request(struct rum_softc *sc, return (err); } +static usb_error_t +rum_do_mcu_request(struct rum_softc *sc, int request) +{ + struct usb_device_request req; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = RT2573_MCU_CNTL; + USETW(req.wValue, request); + USETW(req.wIndex, 0); + USETW(req.wLength, 0); + + return (rum_do_request(sc, &req, NULL)); +} + static struct ieee80211vap * rum_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, enum ieee80211_opmode opmode, int flags, @@ -2460,7 +2475,6 @@ rum_stop(struct rum_softc *sc) static void rum_load_microcode(struct rum_softc *sc, const uint8_t *ucode, size_t size) { - struct usb_device_request req; uint16_t reg = RT2573_MCU_CODE_BASE; usb_error_t err; @@ -2475,14 +2489,8 @@ rum_load_microcode(struct rum_softc *sc, } } - req.bmRequestType = UT_WRITE_VENDOR_DEVICE; - req.bRequest = RT2573_MCU_CNTL; - USETW(req.wValue, RT2573_MCU_RUN); - USETW(req.wIndex, 0); - USETW(req.wLength, 0); - - err = rum_do_request(sc, &req, NULL); - if (err != 0) { + err = rum_do_mcu_request(sc, RT2573_MCU_RUN); + if (err != USB_ERR_NORMAL_COMPLETION) { device_printf(sc->sc_dev, "could not run firmware: %s\n", usbd_errstr(err)); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603212102.u2LL2vu3023587>