svn commit: r287896 - head/sys/dev/usb/wlan

Adrian Chadd adrian at FreeBSD.org
Thu Sep 17 03:19:11 UTC 2015


Author: adrian
Date: Thu Sep 17 03:19:09 2015
New Revision: 287896
URL: https://svnweb.freebsd.org/changeset/base/287896

Log:
  Use the H2C endpoint for sending firmware commands, rather than the voice
  data queues.
  
  This is similar to the openbsd and rtlwifi/r92su drivers.
  
  Note: this driver still assumes it's a 4-endpoint device; I'll enforce
  that in a follow-up commit.

Modified:
  head/sys/dev/usb/wlan/if_rsu.c
  head/sys/dev/usb/wlan/if_rsureg.h

Modified: head/sys/dev/usb/wlan/if_rsu.c
==============================================================================
--- head/sys/dev/usb/wlan/if_rsu.c	Thu Sep 17 03:13:01 2015	(r287895)
+++ head/sys/dev/usb/wlan/if_rsu.c	Thu Sep 17 03:19:09 2015	(r287896)
@@ -151,6 +151,7 @@ static device_attach_t  rsu_attach;
 static device_detach_t  rsu_detach;
 static usb_callback_t   rsu_bulk_tx_callback_be_bk;
 static usb_callback_t   rsu_bulk_tx_callback_vi_vo;
+static usb_callback_t   rsu_bulk_tx_callback_h2c;
 static usb_callback_t   rsu_bulk_rx_callback;
 static usb_error_t	rsu_do_request(struct rsu_softc *,
 			    struct usb_device_request *, void *);
@@ -245,6 +246,9 @@ static uint8_t rsu_wme_ac_xfer_map[4] = 
 	[WME_AC_VO] = RSU_BULK_TX_VI_VO,
 };
 
+/* XXX hard-coded */
+#define	RSU_H2C_ENDPOINT	3
+
 static const struct usb_config rsu_config[RSU_N_TRANSFER] = {
 	[RSU_BULK_RX] = {
 		.type = UE_BULK,
@@ -283,6 +287,19 @@ static const struct usb_config rsu_confi
 		.callback = rsu_bulk_tx_callback_vi_vo,
 		.timeout = RSU_TX_TIMEOUT
 	},
+	[RSU_BULK_TX_H2C] = {
+		.type = UE_BULK,
+		.endpoint = 0x0d,
+		.direction = UE_DIR_OUT,
+		.bufsize = RSU_TXBUFSZ,
+		.flags = {
+			.ext_buffer = 1,
+			.pipe_bof = 1,
+			.short_xfer_ok = 1
+		},
+		.callback = rsu_bulk_tx_callback_h2c,
+		.timeout = RSU_TX_TIMEOUT
+	},
 };
 
 static int
@@ -891,7 +908,7 @@ rsu_read_rom(struct rsu_softc *sc)
 static int
 rsu_fw_cmd(struct rsu_softc *sc, uint8_t code, void *buf, int len)
 {
-	const uint8_t which = rsu_wme_ac_xfer_map[WME_AC_VO];
+	const uint8_t which = RSU_H2C_ENDPOINT;
 	struct rsu_data *data;
 	struct r92s_tx_desc *txd;
 	struct r92s_fw_cmd_hdr *cmd;
@@ -1712,6 +1729,12 @@ rsu_bulk_tx_callback_vi_vo(struct usb_xf
 	rsu_bulk_tx_callback_sub(xfer, error, RSU_BULK_TX_VI_VO);
 }
 
+static void
+rsu_bulk_tx_callback_h2c(struct usb_xfer *xfer, usb_error_t error)
+{
+	rsu_bulk_tx_callback_sub(xfer, error, RSU_BULK_TX_H2C);
+}
+
 static int
 rsu_tx_start(struct rsu_softc *sc, struct ieee80211_node *ni, 
     struct mbuf *m0, struct rsu_data *data)

Modified: head/sys/dev/usb/wlan/if_rsureg.h
==============================================================================
--- head/sys/dev/usb/wlan/if_rsureg.h	Thu Sep 17 03:13:01 2015	(r287895)
+++ head/sys/dev/usb/wlan/if_rsureg.h	Thu Sep 17 03:19:09 2015	(r287896)
@@ -700,6 +700,7 @@ enum {
 	RSU_BULK_RX,
 	RSU_BULK_TX_BE_BK,	/* = WME_AC_BE/BK */
 	RSU_BULK_TX_VI_VO,	/* = WME_AC_VI/VO */
+	RSU_BULK_TX_H2C,	/* H2C */
 	RSU_N_TRANSFER,
 };
 


More information about the svn-src-head mailing list