Lines Matching refs:us
35 static void pdump(struct us_data *us, void *ibuffer, int length);
110 static int init_freecom(struct us_data *us);
152 freecom_readdata (struct scsi_cmnd *srb, struct us_data *us, in freecom_readdata() argument
156 (struct freecom_xfer_wrap *) us->iobuf; in freecom_readdata()
164 usb_stor_dbg(us, "Read data Freecom! (c=%d)\n", count); in freecom_readdata()
167 result = usb_stor_bulk_transfer_buf (us, opipe, fxfr, in freecom_readdata()
170 usb_stor_dbg(us, "Freecom readdata transport error\n"); in freecom_readdata()
175 usb_stor_dbg(us, "Start of read\n"); in freecom_readdata()
176 result = usb_stor_bulk_srb(us, ipipe, srb); in freecom_readdata()
177 usb_stor_dbg(us, "freecom_readdata done!\n"); in freecom_readdata()
185 freecom_writedata (struct scsi_cmnd *srb, struct us_data *us, in freecom_writedata() argument
189 (struct freecom_xfer_wrap *) us->iobuf; in freecom_writedata()
197 usb_stor_dbg(us, "Write data Freecom! (c=%d)\n", count); in freecom_writedata()
200 result = usb_stor_bulk_transfer_buf (us, opipe, fxfr, in freecom_writedata()
203 usb_stor_dbg(us, "Freecom writedata transport error\n"); in freecom_writedata()
208 usb_stor_dbg(us, "Start of write\n"); in freecom_writedata()
209 result = usb_stor_bulk_srb(us, opipe, srb); in freecom_writedata()
211 usb_stor_dbg(us, "freecom_writedata done!\n"); in freecom_writedata()
221 static int freecom_transport(struct scsi_cmnd *srb, struct us_data *us) in freecom_transport() argument
230 fcb = (struct freecom_cb_wrap *) us->iobuf; in freecom_transport()
231 fst = (struct freecom_status *) us->iobuf; in freecom_transport()
233 usb_stor_dbg(us, "Freecom TRANSPORT STARTED\n"); in freecom_transport()
236 opipe = us->send_bulk_pipe; in freecom_transport()
237 ipipe = us->recv_bulk_pipe; in freecom_transport()
245 US_DEBUG(pdump(us, srb->cmnd, 12)); in freecom_transport()
248 result = usb_stor_bulk_transfer_buf (us, opipe, fcb, in freecom_transport()
257 usb_stor_dbg(us, "freecom transport error\n"); in freecom_transport()
265 result = usb_stor_bulk_transfer_buf (us, ipipe, fst, in freecom_transport()
267 usb_stor_dbg(us, "foo Status result %d %u\n", result, partial); in freecom_transport()
271 US_DEBUG(pdump(us, (void *)fst, partial)); in freecom_transport()
283 usb_stor_dbg(us, "20 second USB/ATAPI bridge TIMEOUT occurred!\n"); in freecom_transport()
284 usb_stor_dbg(us, "fst->Status is %x\n", fst->Status); in freecom_transport()
293 result = usb_stor_bulk_transfer_buf (us, opipe, fcb, in freecom_transport()
302 usb_stor_dbg(us, "freecom transport error\n"); in freecom_transport()
307 result = usb_stor_bulk_transfer_buf (us, ipipe, fst, in freecom_transport()
310 usb_stor_dbg(us, "bar Status result %d %u\n", result, partial); in freecom_transport()
314 US_DEBUG(pdump(us, (void *)fst, partial)); in freecom_transport()
320 usb_stor_dbg(us, "operation failed\n"); in freecom_transport()
329 usb_stor_dbg(us, "Device indicates that it has %d bytes available\n", in freecom_transport()
331 usb_stor_dbg(us, "SCSI requested %d\n", scsi_bufflen(srb)); in freecom_transport()
348 usb_stor_dbg(us, "Truncating request to match buffer length: %d\n", in freecom_transport()
357 switch (us->srb->sc_data_direction) { in freecom_transport()
367 usb_stor_dbg(us, "SCSI wants data, drive doesn't have any\n"); in freecom_transport()
370 result = freecom_readdata (srb, us, ipipe, opipe, length); in freecom_transport()
374 usb_stor_dbg(us, "Waiting for status\n"); in freecom_transport()
375 result = usb_stor_bulk_transfer_buf (us, ipipe, fst, in freecom_transport()
377 US_DEBUG(pdump(us, (void *)fst, partial)); in freecom_transport()
382 usb_stor_dbg(us, "operation failed\n"); in freecom_transport()
386 usb_stor_dbg(us, "Drive seems still hungry\n"); in freecom_transport()
389 usb_stor_dbg(us, "Transfer happy\n"); in freecom_transport()
401 result = freecom_writedata (srb, us, ipipe, opipe, length); in freecom_transport()
405 usb_stor_dbg(us, "Waiting for status\n"); in freecom_transport()
406 result = usb_stor_bulk_transfer_buf (us, ipipe, fst, in freecom_transport()
412 usb_stor_dbg(us, "operation failed\n"); in freecom_transport()
416 usb_stor_dbg(us, "Drive seems still hungry\n"); in freecom_transport()
420 usb_stor_dbg(us, "Transfer happy\n"); in freecom_transport()
430 usb_stor_dbg(us, "freecom unimplemented direction: %d\n", in freecom_transport()
431 us->srb->sc_data_direction); in freecom_transport()
440 static int init_freecom(struct us_data *us) in init_freecom() argument
443 char *buffer = us->iobuf; in init_freecom()
450 result = usb_stor_control_msg(us, us->recv_ctrl_pipe, in init_freecom()
453 usb_stor_dbg(us, "String returned from FC init is: %s\n", buffer); in init_freecom()
463 result = usb_stor_control_msg(us, us->send_ctrl_pipe, in init_freecom()
465 usb_stor_dbg(us, "result from activate reset is %d\n", result); in init_freecom()
471 result = usb_stor_control_msg(us, us->send_ctrl_pipe, in init_freecom()
473 usb_stor_dbg(us, "result from clear reset is %d\n", result); in init_freecom()
481 static int usb_stor_freecom_reset(struct us_data *us) in usb_stor_freecom_reset() argument
490 static void pdump(struct us_data *us, void *ibuffer, int length) in pdump() argument
510 usb_stor_dbg(us, "%s\n", line); in pdump()
537 usb_stor_dbg(us, "%s\n", line); in pdump()
547 struct us_data *us; in freecom_probe() local
550 result = usb_stor_probe1(&us, intf, id, in freecom_probe()
556 us->transport_name = "Freecom"; in freecom_probe()
557 us->transport = freecom_transport; in freecom_probe()
558 us->transport_reset = usb_stor_freecom_reset; in freecom_probe()
559 us->max_lun = 0; in freecom_probe()
561 result = usb_stor_probe2(us); in freecom_probe()