export print_sense_internal
PATCH 1/1 export print_sense_internal
Currently, we have scsi_print_sense and scsi_print_req_sense, but the linux-iscsi driver receives async messages from a target that may contain SCSI sense data and these messages are not tied to any specific command. So that we can use the scsi-ml sense printing capabilities the attached patch exports exports print_sense_internal and renames it to __scsi_print_sense.
Signed-off-by Mike Christie <[email protected]>
Oh yeah we are working to gettting the driver in mainline so there will be a user of the the interface soon (I hope soon).
drivers/scsi/constants.c +14 -10
@@ -1156,17 +1156,14 @@ scsi_show_extd_sense(unsigned char asc, }/* Print sense information */ -static void -print_sense_internal (const char *devclass, -const unsigned char *sense_buffer, -int sense_len, -struct request *req) +void +__scsi_print_sense (const char *name,const unsigned char *sense_buffer, +int sense_len) {int k, num, res;unsigned int info;const char *error;const char *sense_txt; -const char *name = req->rq_disk ? req->rq_disk->disk_name : devclass;struct scsi_sense_hdr ssh; res =scsi_normalize_sense (sense_buffer, sense_len, &ssh);
@@ -1254,18 +1251,25 @@ print_sense_internal(const char *devclasprintk ("\n" ); } } +EXPORT_SYMBOL (__scsi_print_sense);void scsi_print_sense (const char *devclass,struct scsi_cmnd *cmd) { -print_sense_internal (devclass, cmd->sense_buffer, -SCSI_SENSE_BUFFERSIZE , cmd->request); +const char *name = devclass; + +if (cmd->request->rq_disk) + name = cmd->request->rq_disk->disk_name; +__scsi_print_sense (name, cmd->sense_buffer,SCSI_SENSE_BUFFERSIZE ); }EXPORT_SYMBOL (scsi_print_sense);void scsi_print_req_sense (const char *devclass,struct scsi_request *sreq) { -print_sense_internal (devclass, sreq->sr_sense_buffer, -SCSI_SENSE_BUFFERSIZE , sreq->sr_request); +const char *name = devclass; + +if (sreq->sr_request->rq_disk) + name = sreq->sr_request->rq_disk->disk_name; +__scsi_print_sense (name, sreq->sr_sense_buffer,SCSI_SENSE_BUFFERSIZE ); }EXPORT_SYMBOL (scsi_print_req_sense);
include/scsi/scsi_dbg.h +3 -0
@@ -8,6 +8,9 @@ extern void scsi_print_command(struct scextern void __scsi_print_command (unsigned char *);extern void scsi_print_sense (const char *,struct scsi_cmnd *);extern void scsi_print_req_sense (const char *,struct scsi_request *); +extern void __scsi_print_sense (const char *name, +const unsigned char *sense_buffer, +int sense_len);extern void scsi_print_driverbyte (int );extern void scsi_print_hostbyte (int );extern void scsi_print_status (unsigned char );