diff options
Diffstat (limited to 'drivers/scsi/bfa/bfad_im.c')
-rw-r--r-- | drivers/scsi/bfa/bfad_im.c | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c index f788c2a0ab07..f9fc67a25bf2 100644 --- a/drivers/scsi/bfa/bfad_im.c +++ b/drivers/scsi/bfa/bfad_im.c | |||
@@ -43,11 +43,11 @@ bfa_cb_ioim_done(void *drv, struct bfad_ioim_s *dio, | |||
43 | struct bfad_s *bfad = drv; | 43 | struct bfad_s *bfad = drv; |
44 | struct bfad_itnim_data_s *itnim_data; | 44 | struct bfad_itnim_data_s *itnim_data; |
45 | struct bfad_itnim_s *itnim; | 45 | struct bfad_itnim_s *itnim; |
46 | u8 host_status = DID_OK; | ||
46 | 47 | ||
47 | switch (io_status) { | 48 | switch (io_status) { |
48 | case BFI_IOIM_STS_OK: | 49 | case BFI_IOIM_STS_OK: |
49 | bfa_trc(bfad, scsi_status); | 50 | bfa_trc(bfad, scsi_status); |
50 | cmnd->result = ScsiResult(DID_OK, scsi_status); | ||
51 | scsi_set_resid(cmnd, 0); | 51 | scsi_set_resid(cmnd, 0); |
52 | 52 | ||
53 | if (sns_len > 0) { | 53 | if (sns_len > 0) { |
@@ -56,8 +56,18 @@ bfa_cb_ioim_done(void *drv, struct bfad_ioim_s *dio, | |||
56 | sns_len = SCSI_SENSE_BUFFERSIZE; | 56 | sns_len = SCSI_SENSE_BUFFERSIZE; |
57 | memcpy(cmnd->sense_buffer, sns_info, sns_len); | 57 | memcpy(cmnd->sense_buffer, sns_info, sns_len); |
58 | } | 58 | } |
59 | if (residue > 0) | 59 | if (residue > 0) { |
60 | bfa_trc(bfad, residue); | ||
60 | scsi_set_resid(cmnd, residue); | 61 | scsi_set_resid(cmnd, residue); |
62 | if (!sns_len && (scsi_status == SAM_STAT_GOOD) && | ||
63 | (scsi_bufflen(cmnd) - residue) < | ||
64 | cmnd->underflow) { | ||
65 | bfa_trc(bfad, 0); | ||
66 | host_status = DID_ERROR; | ||
67 | } | ||
68 | } | ||
69 | cmnd->result = ScsiResult(host_status, scsi_status); | ||
70 | |||
61 | break; | 71 | break; |
62 | 72 | ||
63 | case BFI_IOIM_STS_ABORTED: | 73 | case BFI_IOIM_STS_ABORTED: |
@@ -167,17 +177,15 @@ bfad_im_info(struct Scsi_Host *shost) | |||
167 | static char bfa_buf[256]; | 177 | static char bfa_buf[256]; |
168 | struct bfad_im_port_s *im_port = | 178 | struct bfad_im_port_s *im_port = |
169 | (struct bfad_im_port_s *) shost->hostdata[0]; | 179 | (struct bfad_im_port_s *) shost->hostdata[0]; |
170 | struct bfa_ioc_attr_s ioc_attr; | ||
171 | struct bfad_s *bfad = im_port->bfad; | 180 | struct bfad_s *bfad = im_port->bfad; |
181 | char model[BFA_ADAPTER_MODEL_NAME_LEN]; | ||
172 | 182 | ||
173 | memset(&ioc_attr, 0, sizeof(ioc_attr)); | 183 | bfa_get_adapter_model(&bfad->bfa, model); |
174 | bfa_get_attr(&bfad->bfa, &ioc_attr); | ||
175 | 184 | ||
176 | memset(bfa_buf, 0, sizeof(bfa_buf)); | 185 | memset(bfa_buf, 0, sizeof(bfa_buf)); |
177 | snprintf(bfa_buf, sizeof(bfa_buf), | 186 | snprintf(bfa_buf, sizeof(bfa_buf), |
178 | "Brocade FC/FCOE Adapter, " "model: %s hwpath: %s driver: %s", | 187 | "Brocade FC/FCOE Adapter, " "model: %s hwpath: %s driver: %s", |
179 | ioc_attr.adapter_attr.model, bfad->pci_name, | 188 | model, bfad->pci_name, BFAD_DRIVER_VERSION); |
180 | BFAD_DRIVER_VERSION); | ||
181 | return bfa_buf; | 189 | return bfa_buf; |
182 | } | 190 | } |
183 | 191 | ||
@@ -501,16 +509,6 @@ void bfa_fcb_itnim_tov(struct bfad_itnim_s *itnim) | |||
501 | } | 509 | } |
502 | 510 | ||
503 | /** | 511 | /** |
504 | * Path TOV processing begin notification -- dummy for linux | ||
505 | */ | ||
506 | void | ||
507 | bfa_fcb_itnim_tov_begin(struct bfad_itnim_s *itnim) | ||
508 | { | ||
509 | } | ||
510 | |||
511 | |||
512 | |||
513 | /** | ||
514 | * Allocate a Scsi_Host for a port. | 512 | * Allocate a Scsi_Host for a port. |
515 | */ | 513 | */ |
516 | int | 514 | int |
@@ -931,10 +929,9 @@ bfad_os_fc_host_init(struct bfad_im_port_s *im_port) | |||
931 | struct Scsi_Host *host = im_port->shost; | 929 | struct Scsi_Host *host = im_port->shost; |
932 | struct bfad_s *bfad = im_port->bfad; | 930 | struct bfad_s *bfad = im_port->bfad; |
933 | struct bfad_port_s *port = im_port->port; | 931 | struct bfad_port_s *port = im_port->port; |
934 | union attr { | 932 | struct bfa_pport_attr_s pattr; |
935 | struct bfa_pport_attr_s pattr; | 933 | char model[BFA_ADAPTER_MODEL_NAME_LEN]; |
936 | struct bfa_ioc_attr_s ioc_attr; | 934 | char fw_ver[BFA_VERSION_LEN]; |
937 | } attr; | ||
938 | 935 | ||
939 | fc_host_node_name(host) = | 936 | fc_host_node_name(host) = |
940 | bfa_os_htonll((bfa_fcs_port_get_nwwn(port->fcs_port))); | 937 | bfa_os_htonll((bfa_fcs_port_get_nwwn(port->fcs_port))); |
@@ -954,20 +951,18 @@ bfad_os_fc_host_init(struct bfad_im_port_s *im_port) | |||
954 | /* For fibre channel services type 0x20 */ | 951 | /* For fibre channel services type 0x20 */ |
955 | fc_host_supported_fc4s(host)[7] = 1; | 952 | fc_host_supported_fc4s(host)[7] = 1; |
956 | 953 | ||
957 | memset(&attr.ioc_attr, 0, sizeof(attr.ioc_attr)); | 954 | bfa_get_adapter_model(&bfad->bfa, model); |
958 | bfa_get_attr(&bfad->bfa, &attr.ioc_attr); | 955 | bfa_get_adapter_fw_ver(&bfad->bfa, fw_ver); |
959 | sprintf(fc_host_symbolic_name(host), "Brocade %s FV%s DV%s", | 956 | sprintf(fc_host_symbolic_name(host), "Brocade %s FV%s DV%s", |
960 | attr.ioc_attr.adapter_attr.model, | 957 | model, fw_ver, BFAD_DRIVER_VERSION); |
961 | attr.ioc_attr.adapter_attr.fw_ver, BFAD_DRIVER_VERSION); | ||
962 | 958 | ||
963 | fc_host_supported_speeds(host) = 0; | 959 | fc_host_supported_speeds(host) = 0; |
964 | fc_host_supported_speeds(host) |= | 960 | fc_host_supported_speeds(host) |= |
965 | FC_PORTSPEED_8GBIT | FC_PORTSPEED_4GBIT | FC_PORTSPEED_2GBIT | | 961 | FC_PORTSPEED_8GBIT | FC_PORTSPEED_4GBIT | FC_PORTSPEED_2GBIT | |
966 | FC_PORTSPEED_1GBIT; | 962 | FC_PORTSPEED_1GBIT; |
967 | 963 | ||
968 | memset(&attr.pattr, 0, sizeof(attr.pattr)); | 964 | bfa_fcport_get_attr(&bfad->bfa, &pattr); |
969 | bfa_pport_get_attr(&bfad->bfa, &attr.pattr); | 965 | fc_host_maxframe_size(host) = pattr.pport_cfg.maxfrsize; |
970 | fc_host_maxframe_size(host) = attr.pattr.pport_cfg.maxfrsize; | ||
971 | } | 966 | } |
972 | 967 | ||
973 | static void | 968 | static void |