What do these SCSI errors mean?

Linux / Kernel experts,

Please help. I'm getting errors with various return codes, similar to:

kernel: SCSI error : <0 0 5 165> return code = 0x8000002

I would like to know how / where to lookup the definition of the numbers between the angle brackets, and the return code itself.

I checked scsi.h, sg.h, and scsi_ioctl.h, i've got a feeling that the answer is within these files but I'm not a programmer and that's just a hunch.

in sg.h:

 
/* Turn on error sense trace (1..8), dump this device to log/console (9)
   or dump all sg device states ( >9 ) to log/console.  */
#define SG_SET_DEBUG            0x227e  /* 0 -> turn off debug */
#define SG_NEXT_CMD_LEN         0x2283  /* Override SCSI command length with given
                                           number on the next write() on this file
                                           descriptor.  */

if what im thinking is right, the errors i'm seeing and these entries are related, but i dont know how to reconcile them, and where else to look.

please advice

thanks,
Bee

this thread suggests it may have something to do with SATA hotplug. If you're not hotplugging, maybe a cable?

thanks, but I'm interested in what the actual return code means, similar to this post:

Meaning of SCSI return codes? - open-iscsi | Google Groups

In the Unix stuff I deal with the <0 0 5 portion would likely mean host adapter 0, bus 0, ID 5, which generally would be a CD or Tape unit, depending on how the hardware is set up.