summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-03-07 11:03:11 -0300
committerRenato Botelho <renato@netgate.com>2016-03-07 11:03:11 -0300
commit81ca6de1be9c20d444d1a292655e4732a9c76539 (patch)
treef3d51afe9a1f2b88dea2c5e10289db1f3f2ed5d1 /sys/dev
parent124a553c4366e5f98bf66430356250b0db8eb135 (diff)
parent81dfa2bb6c9e62b96e6586a82c13db809c03fd20 (diff)
downloadFreeBSD-src-81ca6de1be9c20d444d1a292655e4732a9c76539.zip
FreeBSD-src-81ca6de1be9c20d444d1a292655e4732a9c76539.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ata/ata-all.c100
-rw-r--r--sys/dev/usb/controller/xhci.c13
-rw-r--r--sys/dev/usb/controller/xhci.h1
-rw-r--r--sys/dev/usb/net/if_smsc.c2
-rw-r--r--sys/dev/usb/usb_hid.c3
5 files changed, 109 insertions, 10 deletions
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c
index 80bb804..8313e8c 100644
--- a/sys/dev/ata/ata-all.c
+++ b/sys/dev/ata/ata-all.c
@@ -497,7 +497,18 @@ ata_cmd2str(struct ata_request *request)
}
} else {
switch (request->u.ata.command) {
- case 0x00: return ("NOP");
+ case 0x00:
+ switch (request->u.ata.feature) {
+ case 0x00: return ("NOP FLUSHQUEUE");
+ case 0x01: return ("NOP AUTOPOLL");
+ }
+ return ("NOP");
+ case 0x03: return ("CFA_REQUEST_EXTENDED_ERROR");
+ case 0x06:
+ switch (request->u.ata.feature) {
+ case 0x01: return ("DSM TRIM");
+ }
+ return "DSM";
case 0x08: return ("DEVICE_RESET");
case 0x20: return ("READ");
case 0x24: return ("READ48");
@@ -505,18 +516,65 @@ ata_cmd2str(struct ata_request *request)
case 0x26: return ("READ_DMA_QUEUED48");
case 0x27: return ("READ_NATIVE_MAX_ADDRESS48");
case 0x29: return ("READ_MUL48");
+ case 0x2a: return ("READ_STREAM_DMA48");
+ case 0x2b: return ("READ_STREAM48");
+ case 0x2f: return ("READ_LOG_EXT");
case 0x30: return ("WRITE");
case 0x34: return ("WRITE48");
case 0x35: return ("WRITE_DMA48");
case 0x36: return ("WRITE_DMA_QUEUED48");
case 0x37: return ("SET_MAX_ADDRESS48");
case 0x39: return ("WRITE_MUL48");
+ case 0x3a: return ("WRITE_STREAM_DMA48");
+ case 0x3b: return ("WRITE_STREAM48");
+ case 0x3d: return ("WRITE_DMA_FUA48");
+ case 0x3e: return ("WRITE_DMA_QUEUED_FUA48");
+ case 0x3f: return ("WRITE_LOG_EXT");
+ case 0x40: return ("READ_VERIFY");
+ case 0x42: return ("READ_VERIFY48");
+ case 0x45:
+ switch (request->u.ata.feature) {
+ case 0x55: return ("WRITE_UNCORRECTABLE48 PSEUDO");
+ case 0xaa: return ("WRITE_UNCORRECTABLE48 FLAGGED");
+ }
+ return "WRITE_UNCORRECTABLE48";
+ case 0x51: return ("CONFIGURE_STREAM");
+ case 0x60: return ("READ_FPDMA_QUEUED");
+ case 0x61: return ("WRITE_FPDMA_QUEUED");
+ case 0x63: return ("NCQ_NON_DATA");
+ case 0x64: return ("SEND_FPDMA_QUEUED");
+ case 0x65: return ("RECEIVE_FPDMA_QUEUED");
+ case 0x67:
+ if (request->u.ata.feature == 0xec)
+ return ("SEP_ATTN IDENTIFY");
+ switch (request->u.ata.lba) {
+ case 0x00: return ("SEP_ATTN READ BUFFER");
+ case 0x02: return ("SEP_ATTN RECEIVE DIAGNOSTIC RESULTS");
+ case 0x80: return ("SEP_ATTN WRITE BUFFER");
+ case 0x82: return ("SEP_ATTN SEND DIAGNOSTIC");
+ }
+ return ("SEP_ATTN");
case 0x70: return ("SEEK");
- case 0xa0: return ("PACKET_CMD");
+ case 0x87: return ("CFA_TRANSLATE_SECTOR");
+ case 0x90: return ("EXECUTE_DEVICE_DIAGNOSTIC");
+ case 0x92: return ("DOWNLOAD_MICROCODE");
+ case 0xa0: return ("PACKET");
case 0xa1: return ("ATAPI_IDENTIFY");
case 0xa2: return ("SERVICE");
- case 0xb0: return ("SMART");
- case 0xc0: return ("CFA ERASE");
+ case 0xb0:
+ switch(request->u.ata.feature) {
+ case 0xd0: return ("SMART READ ATTR VALUES");
+ case 0xd1: return ("SMART READ ATTR THRESHOLDS");
+ case 0xd3: return ("SMART SAVE ATTR VALUES");
+ case 0xd4: return ("SMART EXECUTE OFFLINE IMMEDIATE");
+ case 0xd5: return ("SMART READ LOG DATA");
+ case 0xd8: return ("SMART ENABLE OPERATION");
+ case 0xd9: return ("SMART DISABLE OPERATION");
+ case 0xda: return ("SMART RETURN STATUS");
+ }
+ return ("SMART");
+ case 0xb1: return ("DEVICE CONFIGURATION");
+ case 0xc0: return ("CFA_ERASE");
case 0xc4: return ("READ_MUL");
case 0xc5: return ("WRITE_MUL");
case 0xc6: return ("SET_MULTI");
@@ -524,22 +582,48 @@ ata_cmd2str(struct ata_request *request)
case 0xc8: return ("READ_DMA");
case 0xca: return ("WRITE_DMA");
case 0xcc: return ("WRITE_DMA_QUEUED");
+ case 0xcd: return ("CFA_WRITE_MULTIPLE_WITHOUT_ERASE");
+ case 0xce: return ("WRITE_MUL_FUA48");
+ case 0xd1: return ("CHECK_MEDIA_CARD_TYPE");
+ case 0xda: return ("GET_MEDIA_STATUS");
+ case 0xde: return ("MEDIA_LOCK");
+ case 0xdf: return ("MEDIA_UNLOCK");
+ case 0xe0: return ("STANDBY_IMMEDIATE");
+ case 0xe1: return ("IDLE_IMMEDIATE");
+ case 0xe2: return ("STANDBY");
+ case 0xe3: return ("IDLE");
+ case 0xe4: return ("READ_BUFFER/PM");
+ case 0xe5: return ("CHECK_POWER_MODE");
case 0xe6: return ("SLEEP");
case 0xe7: return ("FLUSHCACHE");
+ case 0xe8: return ("WRITE_PM");
case 0xea: return ("FLUSHCACHE48");
case 0xec: return ("ATA_IDENTIFY");
+ case 0xed: return ("MEDIA_EJECT");
case 0xef:
switch (request->u.ata.feature) {
case 0x03: return ("SETFEATURES SET TRANSFER MODE");
case 0x02: return ("SETFEATURES ENABLE WCACHE");
case 0x82: return ("SETFEATURES DISABLE WCACHE");
+ case 0x06: return ("SETFEATURES ENABLE PUIS");
+ case 0x86: return ("SETFEATURES DISABLE PUIS");
+ case 0x07: return ("SETFEATURES SPIN-UP");
+ case 0x10: return ("SETFEATURES ENABLE SATA FEATURE");
+ case 0x90: return ("SETFEATURES DISABLE SATA FEATURE");
case 0xaa: return ("SETFEATURES ENABLE RCACHE");
case 0x55: return ("SETFEATURES DISABLE RCACHE");
+ case 0x5d: return ("SETFEATURES ENABLE RELIRQ");
+ case 0xdd: return ("SETFEATURES DISABLE RELIRQ");
+ case 0x5e: return ("SETFEATURES ENABLE SRVIRQ");
+ case 0xde: return ("SETFEATURES DISABLE SRVIRQ");
}
- sprintf(buffer, "SETFEATURES 0x%02x",
- request->u.ata.feature);
- return (buffer);
- case 0xf5: return ("SECURITY_FREE_LOCK");
+ return "SETFEATURES";
+ case 0xf1: return ("SECURITY_SET_PASSWORD");
+ case 0xf2: return ("SECURITY_UNLOCK");
+ case 0xf3: return ("SECURITY_ERASE_PREPARE");
+ case 0xf4: return ("SECURITY_ERASE_UNIT");
+ case 0xf5: return ("SECURITY_FREEZE_LOCK");
+ case 0xf6: return ("SECURITY_DISABLE_PASSWORD");
case 0xf8: return ("READ_NATIVE_MAX_ADDRESS");
case 0xf9: return ("SET_MAX_ADDRESS");
}
diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c
index 3853ed1..18f871e 100644
--- a/sys/dev/usb/controller/xhci.c
+++ b/sys/dev/usb/controller/xhci.c
@@ -2363,6 +2363,8 @@ xhci_configure_endpoint(struct usb_device *udev,
/* store endpoint mode */
pepext->trb_ep_mode = ep_mode;
+ /* store bMaxPacketSize for control endpoints */
+ pepext->trb_ep_maxp = edesc->wMaxPacketSize[0];
usb_pc_cpu_flush(pepext->page_cache);
if (ep_mode == USB_EP_MODE_STREAMS) {
@@ -2909,6 +2911,17 @@ xhci_transfer_insert(struct usb_xfer *xfer)
return (USB_ERR_NOMEM);
}
+ /* check if bMaxPacketSize changed */
+ if (xfer->flags_int.control_xfr != 0 &&
+ pepext->trb_ep_maxp != xfer->endpoint->edesc->wMaxPacketSize[0]) {
+
+ DPRINTFN(8, "Reconfigure control endpoint\n");
+
+ /* force driver to reconfigure endpoint */
+ pepext->trb_halted = 1;
+ pepext->trb_running = 0;
+ }
+
/* check for stopped condition, after putting transfer on interrupt queue */
if (pepext->trb_running == 0) {
struct xhci_softc *sc = XHCI_BUS2SC(xfer->xroot->bus);
diff --git a/sys/dev/usb/controller/xhci.h b/sys/dev/usb/controller/xhci.h
index ac21c0f..af5b913 100644
--- a/sys/dev/usb/controller/xhci.h
+++ b/sys/dev/usb/controller/xhci.h
@@ -383,6 +383,7 @@ struct xhci_endpoint_ext {
uint8_t trb_halted;
uint8_t trb_running;
uint8_t trb_ep_mode;
+ uint8_t trb_ep_maxp;
};
enum {
diff --git a/sys/dev/usb/net/if_smsc.c b/sys/dev/usb/net/if_smsc.c
index c8f2202..34c3ae9 100644
--- a/sys/dev/usb/net/if_smsc.c
+++ b/sys/dev/usb/net/if_smsc.c
@@ -1341,7 +1341,7 @@ smsc_chip_init(struct smsc_softc *sc)
/* Reset the PHY */
smsc_write_reg(sc, SMSC_PM_CTRL, SMSC_PM_CTRL_PHY_RST);
- if ((err = smsc_wait_for_bits(sc, SMSC_PM_CTRL, SMSC_PM_CTRL_PHY_RST) != 0)) {
+ if ((err = smsc_wait_for_bits(sc, SMSC_PM_CTRL, SMSC_PM_CTRL_PHY_RST)) != 0) {
smsc_warn_printf(sc, "timed-out waiting for phy reset to complete\n");
goto init_failed;
}
diff --git a/sys/dev/usb/usb_hid.c b/sys/dev/usb/usb_hid.c
index e6361a6..dc0ce99 100644
--- a/sys/dev/usb/usb_hid.c
+++ b/sys/dev/usb/usb_hid.c
@@ -354,7 +354,8 @@ hid_get_item(struct hid_data *s, struct hid_item *h)
/* range check usage count */
if (c->loc.count > 255) {
DPRINTFN(0, "Number of "
- "items truncated to 255\n");
+ "items(%u) truncated to 255\n",
+ (unsigned)(c->loc.count));
s->ncount = 255;
} else
s->ncount = c->loc.count;
OpenPOWER on IntegriCloud