Lines Matching +full:com +full:- +full:seq

1 // SPDX-License-Identifier: GPL-2.0+
5 * (c) 2006 Bob Copeland <me@bobcopeland.com>
6 * (c) 2006 Keith Bennett <keith@mcs.st-and.ac.uk>
21 #define DRV_NAME "ums-karma"
24 MODULE_AUTHOR("Bob Copeland <me@bobcopeland.com>, Keith Bennett <keith@mcs.st-and.ac.uk>");
89 * with a 512-byte packet with the high four bits set and everything
98 static unsigned char seq = 1; in rio_karma_send_command() local
99 struct karma_data *data = (struct karma_data *) us->extra; in rio_karma_send_command()
102 memset(us->iobuf, 0, RIO_SEND_LEN); in rio_karma_send_command()
103 memcpy(us->iobuf, RIO_PREFIX, RIO_PREFIX_LEN); in rio_karma_send_command()
104 us->iobuf[5] = cmd; in rio_karma_send_command()
105 us->iobuf[6] = seq; in rio_karma_send_command()
109 result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, in rio_karma_send_command()
110 us->iobuf, RIO_SEND_LEN, NULL); in rio_karma_send_command()
114 result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, in rio_karma_send_command()
115 data->recv, RIO_RECV_LEN, NULL); in rio_karma_send_command()
119 if (data->recv[5] == seq) in rio_karma_send_command()
125 us->iobuf[4] = 0x80; in rio_karma_send_command()
126 us->iobuf[5] = 0; in rio_karma_send_command()
130 seq++; in rio_karma_send_command()
131 if (seq == 0) in rio_karma_send_command()
132 seq = 1; in rio_karma_send_command()
142 * Trap START_STOP and READ_10 to leave/re-enter storage mode.
148 struct karma_data *data = (struct karma_data *) us->extra; in rio_karma_transport()
150 if (srb->cmnd[0] == READ_10 && !data->in_storage) { in rio_karma_transport()
155 data->in_storage = 1; in rio_karma_transport()
157 } else if (srb->cmnd[0] == START_STOP) { in rio_karma_transport()
162 data->in_storage = 0; in rio_karma_transport()
172 kfree(data->recv); in rio_karma_destructor()
180 return -ENOMEM; in rio_karma_init()
182 data->recv = kmalloc(RIO_RECV_LEN, GFP_NOIO); in rio_karma_init()
183 if (!data->recv) { in rio_karma_init()
185 return -ENOMEM; in rio_karma_init()
188 us->extra = data; in rio_karma_init()
189 us->extra_destructor = rio_karma_destructor; in rio_karma_init()
191 return -EIO; in rio_karma_init()
193 data->in_storage = 1; in rio_karma_init()
207 (id - karma_usb_ids) + karma_unusual_dev_list, in karma_probe()
212 us->transport_name = "Rio Karma/Bulk"; in karma_probe()
213 us->transport = rio_karma_transport; in karma_probe()
214 us->transport_reset = usb_stor_Bulk_reset; in karma_probe()