? Makefile.fwdevs ? devlist2h.awk ? firewire.diff ? fwdevs ? sbp_targ.c Index: files.ieee1394 =================================================================== RCS file: /cvsroot/src/sys/dev/ieee1394/files.ieee1394,v retrieving revision 1.10 diff -u -p -r1.10 files.ieee1394 --- files.ieee1394 30 Apr 2006 12:11:58 -0000 1.10 +++ files.ieee1394 25 Apr 2010 05:33:22 -0000 @@ -18,3 +18,7 @@ file dev/ieee1394/if_fwip.c fwip device sbp { }: scsi attach sbp at ieee1394if file dev/ieee1394/sbp.c sbp + +device sbp_targ { }: scsi +attach sbp_targ at ieee1394if +file dev/ieee1394/sbp_targ.c sbp_targ Index: firewire.c =================================================================== RCS file: /cvsroot/src/sys/dev/ieee1394/firewire.c,v retrieving revision 1.30 diff -u -p -r1.30 firewire.c --- firewire.c 6 Apr 2010 10:45:15 -0000 1.30 +++ firewire.c 25 Apr 2010 05:33:22 -0000 @@ -1910,7 +1910,8 @@ fw_explore(struct firewire_comm *fc) fwsid = fw_find_self_id(fc, node); if (!fwsid || !fwsid->p0.link_active) { if (firewire_debug) - printf("node%d: link down\n", node); + aprint_error_dev(fc->bdev, + "node%d: link down\n", node); continue; } nodes[todo++] = node; Index: fwdev.c =================================================================== RCS file: /cvsroot/src/sys/dev/ieee1394/fwdev.c,v retrieving revision 1.18 diff -u -p -r1.18 fwdev.c --- fwdev.c 29 Mar 2010 03:05:27 -0000 1.18 +++ fwdev.c 25 Apr 2010 05:33:22 -0000 @@ -511,7 +511,7 @@ fw_ioctl(dev_t dev, u_long cmd, void *da break; } - memcpy((void *)&xfer->send.hdr, fp, tinfo->hdr_len); + memcpy(&xfer->send.hdr, fp, tinfo->hdr_len); if (pay_len > 0) memcpy((void *)xfer->send.payload, (char *)fp + tinfo->hdr_len, pay_len); Index: fwdma.c =================================================================== RCS file: /cvsroot/src/sys/dev/ieee1394/fwdma.c,v retrieving revision 1.13 diff -u -p -r1.13 fwdma.c --- fwdma.c 29 Mar 2010 03:05:27 -0000 1.13 +++ fwdma.c 25 Apr 2010 05:33:23 -0000 @@ -141,7 +141,8 @@ fwdma_malloc_multiseg(struct firewire_co struct fwdma_alloc_multi *am; struct fwdma_seg *seg; bus_size_t ssize; - int nseg, size; + size_t size; + int nseg; if (esize > PAGE_SIZE) { /* round up to PAGE_SIZE */ @@ -154,12 +155,11 @@ fwdma_malloc_multiseg(struct firewire_co } size = sizeof(struct fwdma_alloc_multi) + sizeof(struct fwdma_seg) * nseg; - am = (struct fwdma_alloc_multi *)malloc(size, M_FW, M_WAITOK); + am = (struct fwdma_alloc_multi *)malloc(size, M_FW, M_ZERO | M_WAITOK); if (am == NULL) { aprint_error_dev(fc->dev, "malloc failed\n"); return NULL; } - memset(am, 0, size); am->ssize = ssize; am->esize = esize; am->nseg = 0; Index: fwohci.c =================================================================== RCS file: /cvsroot/src/sys/dev/ieee1394/fwohci.c,v retrieving revision 1.124 diff -u -p -r1.124 fwohci.c --- fwohci.c 19 Apr 2010 07:00:58 -0000 1.124 +++ fwohci.c 25 Apr 2010 05:33:23 -0000 @@ -2010,7 +2010,7 @@ fwohci_intr_core(struct fwohci_softc *sc /* allow from all nodes */ OWRITE(sc, OHCI_PREQHI, 0x7fffffff); OWRITE(sc, OHCI_PREQLO, 0xffffffff); - /* 0 to 4GB regison */ + /* 0 to 4GB region */ OWRITE(sc, OHCI_PREQUPPER, 0x10000); } /* Set ATRetries register */ @@ -2027,7 +2027,8 @@ fwohci_intr_core(struct fwohci_softc *sc aprint_normal_dev(fc->dev, "node_id=0x%08x, gen=%d, ", node_id, (plen >> 16) & 0xff); if (!(node_id & OHCI_NODE_VALID)) { - aprint_error("Bus reset failure\n"); + aprint_error_dev(fc->dev, "%s: Bus reset failure\n", + __func__); goto sidout; } Index: sbp.c =================================================================== RCS file: /cvsroot/src/sys/dev/ieee1394/sbp.c,v retrieving revision 1.29 diff -u -p -r1.29 sbp.c --- sbp.c 29 Mar 2010 03:05:28 -0000 1.29 +++ sbp.c 25 Apr 2010 05:33:23 -0000 @@ -93,7 +93,7 @@ __KERNEL_RCSID(0, "$NetBSD: sbp.c,v 1.29 */ #define SBP_BIND_HI 0x1 #define SBP_DEV2ADDR(u, l) \ - (((u_int64_t)SBP_BIND_HI << 32) \ + (((uint64_t)SBP_BIND_HI << 32) \ | (((u) & 0x3fff) << 10) \ | (((l) & 0xff) << 2)) #define SBP_ADDR2UNIT(a) (((a) >> 10) & 0x3fff) @@ -937,7 +937,7 @@ sbp_probe_target(void *arg) int i; SBP_DEBUG(1) - printf("sbp_probe_target %d\n", target->target_id); + printf("%s %d\n", __func__, target->target_id); END_DEBUG sbp_alloc_lun(target); @@ -1484,7 +1484,7 @@ sbp_mgm_orb(struct sbp_dev *sdev, int fu ocb->flags = OCB_ACT_MGM; ocb->sdev = sdev; - memset((void *)ocb->orb, 0, sizeof(ocb->orb)); + memset(ocb->orb, 0, sizeof(ocb->orb)); ocb->orb[6] = htonl((nid << 16) | SBP_BIND_HI); ocb->orb[7] = htonl(SBP_DEV2ADDR(dv_unit, sdev->lun_id)); @@ -1579,8 +1579,7 @@ static void sbp_scsi_status(struct sbp_status *sbp_status, struct sbp_ocb *ocb) { struct sbp_cmd_status *sbp_cmd_status; - scsi3_sense_data_t sense = - (scsi3_sense_data_t)&ocb->xs->sense.scsi_sense; + struct scsi_sense_data *sense = &ocb->xs->sense.scsi_sense; sbp_cmd_status = (struct sbp_cmd_status *)sbp_status->data; @@ -1608,7 +1607,7 @@ END_DEBUG else sense->response_code = SSD_RCODE_DEFERRED; if (sbp_cmd_status->valid) - sense->response_code |= SSD_RESPONSE_CODE_VALID; + sense->response_code |= SSD_RCODE_VALID; sense->flags = sbp_cmd_status->s_key; if (sbp_cmd_status->mark) sense->flags |= SSD_FILEMARK; @@ -1617,25 +1616,25 @@ END_DEBUG if (sbp_cmd_status->ill_len) sense->flags |= SSD_ILI; - memcpy(sense->information, &sbp_cmd_status->info, 4); + memcpy(sense->info, &sbp_cmd_status->info, 4); if (sbp_status->len <= 1) /* XXX not scsi status. shouldn't be happened */ - sense->asl = 0; + sense->extra_len = 0; else if (sbp_status->len <= 4) /* add_sense_code(_qual), info, cmd_spec_info */ - sense->asl = 6; + sense->extra_len = 6; else /* fru, sense_key_spec */ - sense->asl = 10; + sense->extra_len = 10; memcpy(sense->csi, &sbp_cmd_status->cdb, 4); sense->asc = sbp_cmd_status->s_code; sense->ascq = sbp_cmd_status->s_qlfr; - sense->fruc = sbp_cmd_status->fru; + sense->fru = sbp_cmd_status->fru; - memcpy(sense->sks, sbp_cmd_status->s_keydep, 3); + memcpy(sense->sks.sks_bytes, sbp_cmd_status->s_keydep, 3); ocb->xs->error = XS_SENSE; ocb->xs->xs_status = sbp_cmd_status->status; /* @@ -1663,7 +1662,7 @@ sbp_fix_inq_data(struct sbp_ocb *ocb) { struct scsipi_xfer *xs = ocb->xs; struct sbp_dev *sdev; - scsi3_inquiry_data_t inq = (scsi3_inquiry_data_t)xs->data; + struct scsipi_inquiry_data *inq = (struct scsipi_inquiry_data *)xs->data; sdev = ocb->sdev; @@ -1709,9 +1708,9 @@ END_DEBUG * XXX CAM also checks SCP_QUEUE_DQUE flag in the control mode page. */ if (sbp_tags > 0) - inq->flags[1] |= SID_CmdQue; + inq->flags3 |= SID_CmdQue; else if (sbp_tags < 0) - inq->flags[1] &= ~SID_CmdQue; + inq->flags3 &= ~SID_CmdQue; } @@ -1818,7 +1817,7 @@ SBP_DEBUG(0) END_DEBUG printf("%s:%s\n", device_xname(sc->sc_fd.dev), sdev->bustgtlun); status = sbp_status->status; - switch(sbp_status->resp) { + switch (sbp_status->resp) { case SBP_REQ_CMP: if (status > MAX_ORB_STATUS0) printf("%s\n", orb_status0[MAX_ORB_STATUS0]); @@ -1853,17 +1852,17 @@ END_DEBUG if (ocb == NULL) goto done; - switch(ntohl(ocb->orb[4]) & ORB_FMT_MSK) { + switch (ntohl(ocb->orb[4]) & ORB_FMT_MSK) { case ORB_FMT_NOP: break; case ORB_FMT_VED: break; case ORB_FMT_STD: - switch(ocb->flags) { + switch (ocb->flags) { case OCB_ACT_MGM: orb_fun = ntohl(ocb->orb[4]) & ORB_FUN_MSK; reset_agent = 0; - switch(orb_fun) { + switch (orb_fun) { case ORB_FUN_LGI: { const struct fwdma_alloc *dma = &sdev->dma; @@ -2023,7 +2022,7 @@ SBP_DEBUG(0) printf("sbp_logout_all\n"); END_DEBUG target = &sbp->sc_target; - if (target->luns != NULL) + if (target->luns != NULL) { for (i = 0; i < target->num_lun; i++) { sdev = target->luns[i]; if (sdev == NULL) @@ -2033,6 +2032,7 @@ END_DEBUG sdev->status <= SBP_DEV_ATTACHED) sbp_mgm_orb(sdev, ORB_FUN_LGO, NULL); } + } return 0; } @@ -2152,7 +2152,7 @@ sbp_target_reset(struct sbp_dev *sdev, i if (method == 2) tsdev->status = SBP_DEV_LOGIN; } - switch(method) { + switch (method) { case 1: aprint_error("target reset\n"); sbp_mgm_orb(sdev, ORB_FUN_RST, NULL); Index: sbp.h =================================================================== RCS file: /cvsroot/src/sys/dev/ieee1394/sbp.h,v retrieving revision 1.4 diff -u -p -r1.4 sbp.h --- sbp.h 29 Mar 2010 03:05:28 -0000 1.4 +++ sbp.h 25 Apr 2010 05:33:23 -0000 @@ -200,36 +200,4 @@ struct sbp_cmd_status{ /* E */ "LOGICAL UNIT RESET", \ /* F */ "TARGET RESET" - -struct scsi3_inquiry_data { - uint8_t device; - uint8_t reserved0; - uint8_t version; - uint8_t rdf; /* Response data format */ - uint8_t additional_length; - uint8_t reserved1; - uint8_t flags[2]; - char vendor[8]; - char product[16]; - char revision[4]; - u_int8_t vendor_specific[20]; -}; -typedef struct scsi3_inquiry_data *scsi3_inquiry_data_t; - -struct scsi3_sense_data { - uint8_t response_code; -#define SSD_RESPONSE_CODE_VALID 0x80 - uint8_t segment_number; - uint8_t flags; - uint8_t information[4]; - uint8_t asl; /* Additional sense length */ - uint8_t csi[4]; /* Command-specific information */ - uint8_t asc; /* Additional sense code */ - uint8_t ascq; /* Additional sense code qualifier */ - uint8_t fruc; /* Field replaceable unit code */ - uint8_t sks[3]; /* Sense-key specific */ - uint8_t asb[14]; /* Additional sense bytes */ -}; -typedef struct scsi3_sense_data *scsi3_sense_data_t; - #endif /* _SBP_H_ */