Lines Matching defs:msg

98 	dprintk(DBGLVL_BUS, "Dumping msg structure:\n");
120 int saa7164_bus_set(struct saa7164_dev *dev, struct tmComResInfo* msg,
129 if (!msg) {
130 printk(KERN_ERR "%s() !msg\n", __func__);
138 if (msg->size > dev->bus.m_wMaxReqSize) {
144 if ((msg->size > 0) && (buf == NULL)) {
152 bytes_to_write = sizeof(*msg) + msg->size;
175 /* Process the msg and write the content onto the bus */
210 * Make a copy of msg->size before it is converted to le16 since it is
213 size = msg->size;
215 msg->size = (__force u16)cpu_to_le16(msg->size);
216 msg->command = (__force u32)cpu_to_le32(msg->command);
217 msg->controlselector = (__force u16)cpu_to_le16(msg->controlselector);
232 dprintk(DBGLVL_BUS, "%s() sizeof(*msg) = %d\n", __func__,
233 (u32)sizeof(*msg));
235 if (space_rem < sizeof(*msg)) {
238 /* Split the msg into pieces as the ring wraps */
239 memcpy_toio(bus->m_pdwSetRing + curr_swp, msg, space_rem);
240 memcpy_toio(bus->m_pdwSetRing, (u8 *)msg + space_rem,
241 sizeof(*msg) - space_rem);
243 memcpy_toio(bus->m_pdwSetRing + sizeof(*msg) - space_rem,
246 } else if (space_rem == sizeof(*msg)) {
250 memcpy_toio(bus->m_pdwSetRing + curr_swp, msg, sizeof(*msg));
255 memcpy_toio(bus->m_pdwSetRing + curr_swp, msg, sizeof(*msg));
258 sizeof(*msg), buf, space_rem -
259 sizeof(*msg));
261 space_rem - sizeof(*msg),
272 memcpy_toio(bus->m_pdwSetRing + curr_swp, msg, sizeof(*msg));
273 memcpy_toio(bus->m_pdwSetRing + curr_swp + sizeof(*msg), buf,
282 /* Convert back to cpu after writing the msg to the ringbuffer. */
283 msg->size = le16_to_cpu((__force __le16)msg->size);
284 msg->command = le32_to_cpu((__force __le32)msg->command);
285 msg->controlselector = le16_to_cpu((__force __le16)msg->controlselector);
305 int saa7164_bus_get(struct saa7164_dev *dev, struct tmComResInfo* msg,
316 if (msg == NULL)
319 if (msg->size > dev->bus.m_wMaxReqSize) {
325 if ((peekonly == 0) && (msg->size > 0) && (buf == NULL)) {
327 "%s() Missing msg buf, size should be %d bytes\n",
328 __func__, msg->size);
334 /* Peek the bus to see if a msg exists, if it's not what we're expecting
345 bytes_to_read = sizeof(*msg);
382 memcpy(msg, &msg_tmp, sizeof(*msg));
391 if ((msg_tmp.id != msg->id) || (msg_tmp.command != msg->command) ||
392 (msg_tmp.controlselector != msg->controlselector) ||
393 (msg_tmp.seqno != msg->seqno) || (msg_tmp.size != msg->size)) {
395 printk(KERN_ERR "%s() Unexpected msg miss-match\n", __func__);
396 saa7164_bus_dumpmsg(dev, msg, buf);
403 buf_size = msg->size;
405 bytes_to_read = sizeof(*msg) + msg->size;
416 printk(KERN_ERR "%s() Invalid bus state, missing msg or mangled ring, faulty H/W / bad code?\n",
430 if (space_rem < sizeof(*msg)) {
432 memcpy_fromio(buf, bus->m_pdwGetRing + sizeof(*msg) -
435 } else if (space_rem == sizeof(*msg)) {
442 sizeof(*msg), space_rem - sizeof(*msg));
443 memcpy_fromio(buf + space_rem - sizeof(*msg),
453 memcpy_fromio(buf, bus->m_pdwGetRing + curr_grp + sizeof(*msg),