Lines Matching refs:msg

112 	dprintk(DBGLVL_BUS, "Dumping msg structure:\n");
134 int saa7164_bus_set(struct saa7164_dev *dev, struct tmComResInfo* msg,
142 if (!msg) {
143 printk(KERN_ERR "%s() !msg\n", __func__);
151 msg->size = cpu_to_le16(msg->size);
152 msg->command = cpu_to_le32(msg->command);
153 msg->controlselector = cpu_to_le16(msg->controlselector);
155 if (msg->size > dev->bus.m_wMaxReqSize) {
161 if ((msg->size > 0) && (buf == NULL)) {
169 bytes_to_write = sizeof(*msg) + msg->size;
192 /* Process the msg and write the content onto the bus */
239 dprintk(DBGLVL_BUS, "%s() sizeof(*msg) = %d\n", __func__,
240 (u32)sizeof(*msg));
242 if (space_rem < sizeof(*msg)) {
245 /* Split the msg into pieces as the ring wraps */
246 memcpy(bus->m_pdwSetRing + curr_swp, msg, space_rem);
247 memcpy(bus->m_pdwSetRing, (u8 *)msg + space_rem,
248 sizeof(*msg) - space_rem);
250 memcpy(bus->m_pdwSetRing + sizeof(*msg) - space_rem,
251 buf, msg->size);
253 } else if (space_rem == sizeof(*msg)) {
257 memcpy(bus->m_pdwSetRing + curr_swp, msg, sizeof(*msg));
258 memcpy(bus->m_pdwSetRing, buf, msg->size);
262 memcpy(bus->m_pdwSetRing + curr_swp, msg, sizeof(*msg));
263 if (msg->size > 0) {
265 sizeof(*msg), buf, space_rem -
266 sizeof(*msg));
268 space_rem - sizeof(*msg),
279 memcpy(bus->m_pdwSetRing + curr_swp, msg, sizeof(*msg));
280 memcpy(bus->m_pdwSetRing + curr_swp + sizeof(*msg), buf,
281 msg->size);
307 int saa7164_bus_get(struct saa7164_dev *dev, struct tmComResInfo* msg,
318 if (msg == NULL)
321 if (msg->size > dev->bus.m_wMaxReqSize) {
327 if ((peekonly == 0) && (msg->size > 0) && (buf == NULL)) {
329 "%s() Missing msg buf, size should be %d bytes\n",
330 __func__, msg->size);
336 /* Peek the bus to see if a msg exists, if it's not what we're expecting
347 bytes_to_read = sizeof(*msg);
384 memcpy(msg, &msg_tmp, sizeof(*msg));
389 if ((msg_tmp.id != msg->id) || (msg_tmp.command != msg->command) ||
390 (msg_tmp.controlselector != msg->controlselector) ||
391 (msg_tmp.seqno != msg->seqno) || (msg_tmp.size != msg->size)) {
393 printk(KERN_ERR "%s() Unexpected msg miss-match\n", __func__);
394 saa7164_bus_dumpmsg(dev, msg, buf);
401 buf_size = msg->size;
403 bytes_to_read = sizeof(*msg) + msg->size;
414 printk(KERN_ERR "%s() Invalid bus state, missing msg "
428 if (space_rem < sizeof(*msg)) {
429 /* msg wraps around the ring */
430 memcpy(msg, bus->m_pdwGetRing + curr_grp, space_rem);
431 memcpy((u8 *)msg + space_rem, bus->m_pdwGetRing,
432 sizeof(*msg) - space_rem);
434 memcpy(buf, bus->m_pdwGetRing + sizeof(*msg) -
437 } else if (space_rem == sizeof(*msg)) {
438 memcpy(msg, bus->m_pdwGetRing + curr_grp, sizeof(*msg));
443 memcpy(msg, bus->m_pdwGetRing + curr_grp, sizeof(*msg));
446 sizeof(*msg), space_rem - sizeof(*msg));
447 memcpy(buf + space_rem - sizeof(*msg),
456 memcpy(msg, bus->m_pdwGetRing + curr_grp, sizeof(*msg));
458 memcpy(buf, bus->m_pdwGetRing + curr_grp + sizeof(*msg),
466 msg->size = le16_to_cpu(msg->size);
467 msg->command = le32_to_cpu(msg->command);
468 msg->controlselector = le16_to_cpu(msg->controlselector);