Author: mav
Date: Thu Feb  1 16:33:15 2018
New Revision: 328679
URL: https://svnweb.freebsd.org/changeset/base/328679

Log:
  MFC r303123 (by imp): Fix mismerge and include the nvme support.
  Also, print out the name of any CCB's functions that's not supported.

Modified:
  stable/11/sys/cam/cam_xpt.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cam/cam_xpt.c
==============================================================================
--- stable/11/sys/cam/cam_xpt.c Thu Feb  1 16:27:50 2018        (r328678)
+++ stable/11/sys/cam/cam_xpt.c Thu Feb  1 16:33:15 2018        (r328679)
@@ -1034,6 +1034,8 @@ xpt_announce_periph(struct cam_periph *periph, char *a
        else if (path->device->protocol == PROTO_SEMB)
                semb_print_ident(
                    (struct sep_identify_data *)&path->device->ident_data);
+       else if (path->device->protocol == PROTO_NVME)
+               nvme_print_ident(path->device->nvme_cdata, 
path->device->nvme_data);
        else
                printf("Unknown protocol device\n");
        if (path->device->serial_num_len > 0) {
@@ -1087,6 +1089,8 @@ xpt_denounce_periph(struct cam_periph *periph)
        else if (path->device->protocol == PROTO_SEMB)
                semb_print_ident_short(
                    (struct sep_identify_data *)&path->device->ident_data);
+       else if (path->device->protocol == PROTO_NVME)
+               nvme_print_ident(path->device->nvme_cdata, 
path->device->nvme_data);
        else
                printf("Unknown protocol device");
        if (path->device->serial_num_len > 0)
@@ -2540,6 +2544,10 @@ xpt_action_default(union ccb *start_ccb)
                if (start_ccb->ccb_h.func_code == XPT_ATA_IO)
                        start_ccb->ataio.resid = 0;
                /* FALLTHROUGH */
+       case XPT_NVME_IO:
+               if (start_ccb->ccb_h.func_code == XPT_NVME_IO)
+                       start_ccb->nvmeio.resid = 0;
+               /* FALLTHROUGH */
        case XPT_RESET_DEV:
        case XPT_ENG_EXEC:
        case XPT_SMP_IO:
@@ -2685,6 +2693,8 @@ call_sim:
                        cgd->inq_data = dev->inq_data;
                        cgd->ident_data = dev->ident_data;
                        cgd->inq_flags = dev->inq_flags;
+                       cgd->nvme_data = dev->nvme_data;
+                       cgd->nvme_cdata = dev->nvme_cdata;
                        cgd->ccb_h.status = CAM_REQ_CMP;
                        cgd->serial_num_len = dev->serial_num_len;
                        if ((dev->serial_num_len > 0)
@@ -3030,8 +3040,10 @@ call_sim:
        case XPT_TERM_IO:
        case XPT_ENG_INQ:
                /* XXX Implement */
-               printf("%s: CCB type %#x not supported\n", __func__,
-                      start_ccb->ccb_h.func_code);
+               xpt_print_path(start_ccb->ccb_h.path);
+               printf("%s: CCB type %#x %s not supported\n", __func__,
+                   start_ccb->ccb_h.func_code,
+                   xpt_action_name(start_ccb->ccb_h.func_code));
                start_ccb->ccb_h.status = CAM_PROVIDE_FAIL;
                if (start_ccb->ccb_h.func_code & XPT_FC_DEV_QUEUED) {
                        xpt_done(start_ccb);
@@ -3340,6 +3352,13 @@ xpt_run_devq(struct cam_devq *devq)
                             ata_cmd_string(&work_ccb->ataio.cmd,
                                            cdb_str, sizeof(cdb_str))));
                        break;
+               case XPT_NVME_IO:
+                       CAM_DEBUG(work_ccb->ccb_h.path,
+                           CAM_DEBUG_CDB,("%s. NCB: %s\n",
+                            nvme_op_string(&work_ccb->nvmeio.cmd),
+                            nvme_cmd_string(&work_ccb->nvmeio.cmd,
+                                           cdb_str, sizeof(cdb_str))));
+                       break;
                default:
                        break;
                }
@@ -3927,6 +3946,9 @@ xpt_bus_register(struct cam_sim *sim, device_t parent,
                case XPORT_ATA:
                case XPORT_SATA:
                        new_bus->xport = ata_get_xport();
+                       break;
+               case XPORT_NVME:
+                       new_bus->xport = nvme_get_xport();
                        break;
                default:
                        new_bus->xport = &xport_default;
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to