Searched refs:msg (Results 1 - 200 of 1907) sorted by relevance

12345678910

/linux-4.4.14/fs/reiserfs/
H A Dhashes.c44 u32 keyed_hash(const signed char *msg, int len) keyed_hash() argument
59 a = (u32) msg[0] | keyed_hash()
60 (u32) msg[1] << 8 | (u32) msg[2] << 16 | (u32) msg[3] << 24; keyed_hash()
61 b = (u32) msg[4] | keyed_hash()
62 (u32) msg[5] << 8 | (u32) msg[6] << 16 | (u32) msg[7] << 24; keyed_hash()
63 c = (u32) msg[8] | keyed_hash()
64 (u32) msg[9] << 8 | keyed_hash()
65 (u32) msg[10] << 16 | (u32) msg[11] << 24; keyed_hash()
66 d = (u32) msg[12] | keyed_hash()
67 (u32) msg[13] << 8 | keyed_hash()
68 (u32) msg[14] << 16 | (u32) msg[15] << 24; keyed_hash()
73 msg += 16; keyed_hash()
77 a = (u32) msg[0] | keyed_hash()
78 (u32) msg[1] << 8 | (u32) msg[2] << 16 | (u32) msg[3] << 24; keyed_hash()
79 b = (u32) msg[4] | keyed_hash()
80 (u32) msg[5] << 8 | (u32) msg[6] << 16 | (u32) msg[7] << 24; keyed_hash()
81 c = (u32) msg[8] | keyed_hash()
82 (u32) msg[9] << 8 | keyed_hash()
83 (u32) msg[10] << 16 | (u32) msg[11] << 24; keyed_hash()
88 d |= msg[i]; keyed_hash()
91 a = (u32) msg[0] | keyed_hash()
92 (u32) msg[1] << 8 | (u32) msg[2] << 16 | (u32) msg[3] << 24; keyed_hash()
93 b = (u32) msg[4] | keyed_hash()
94 (u32) msg[5] << 8 | (u32) msg[6] << 16 | (u32) msg[7] << 24; keyed_hash()
99 c |= msg[i]; keyed_hash()
102 a = (u32) msg[0] | keyed_hash()
103 (u32) msg[1] << 8 | (u32) msg[2] << 16 | (u32) msg[3] << 24; keyed_hash()
108 b |= msg[i]; keyed_hash()
114 a |= msg[i]; keyed_hash()
128 u32 yura_hash(const signed char *msg, int len) yura_hash() argument
138 a = msg[0] - 48; yura_hash()
140 a = (msg[0] - 48) * pow; yura_hash()
143 c = msg[i] - 48; yura_hash()
167 u32 r5_hash(const signed char *msg, int len) r5_hash() argument
170 while (*msg) { r5_hash()
171 a += *msg << 4; r5_hash()
172 a += *msg >> 4; r5_hash()
174 msg++; r5_hash()
/linux-4.4.14/include/trace/events/
H A Dspi.h46 TP_PROTO(struct spi_message *msg),
48 TP_ARGS(msg),
53 __field( struct spi_message *, msg )
57 __entry->bus_num = msg->spi->master->bus_num;
58 __entry->chip_select = msg->spi->chip_select;
59 __entry->msg = msg;
64 (struct spi_message *)__entry->msg)
69 TP_PROTO(struct spi_message *msg),
71 TP_ARGS(msg)
77 TP_PROTO(struct spi_message *msg),
79 TP_ARGS(msg)
85 TP_PROTO(struct spi_message *msg),
87 TP_ARGS(msg),
92 __field( struct spi_message *, msg )
98 __entry->bus_num = msg->spi->master->bus_num;
99 __entry->chip_select = msg->spi->chip_select;
100 __entry->msg = msg;
101 __entry->frame = msg->frame_length;
102 __entry->actual = msg->actual_length;
107 (struct spi_message *)__entry->msg,
113 TP_PROTO(struct spi_message *msg, struct spi_transfer *xfer),
115 TP_ARGS(msg, xfer),
125 __entry->bus_num = msg->spi->master->bus_num;
126 __entry->chip_select = msg->spi->chip_select;
139 TP_PROTO(struct spi_message *msg, struct spi_transfer *xfer),
141 TP_ARGS(msg, xfer)
147 TP_PROTO(struct spi_message *msg, struct spi_transfer *xfer),
149 TP_ARGS(msg, xfer)
H A Dprintk.h15 __dynamic_array(char, msg, len + 1)
19 memcpy(__get_dynamic_array(msg), text, len);
20 ((char *)__get_dynamic_array(msg))[len] = 0;
23 TP_printk("%s", __get_str(msg))
H A Di2c.h30 TP_PROTO(const struct i2c_adapter *adap, const struct i2c_msg *msg,
32 TP_ARGS(adap, msg, num),
39 __dynamic_array(__u8, buf, msg->len) ),
43 __entry->addr = msg->addr;
44 __entry->flags = msg->flags;
45 __entry->len = msg->len;
46 memcpy(__get_dynamic_array(buf), msg->buf, msg->len);
63 TP_PROTO(const struct i2c_adapter *adap, const struct i2c_msg *msg,
65 TP_ARGS(adap, msg, num),
76 __entry->addr = msg->addr;
77 __entry->flags = msg->flags;
78 __entry->len = msg->len;
94 TP_PROTO(const struct i2c_adapter *adap, const struct i2c_msg *msg,
96 TP_ARGS(adap, msg, num),
103 __dynamic_array(__u8, buf, msg->len) ),
107 __entry->addr = msg->addr;
108 __entry->flags = msg->flags;
109 __entry->len = msg->len;
110 memcpy(__get_dynamic_array(buf), msg->buf, msg->len);
/linux-4.4.14/net/ceph/
H A Dmsgpool.c13 struct ceph_msg *msg; msgpool_alloc() local
15 msg = ceph_msg_new(pool->type, pool->front_len, gfp_mask, true); msgpool_alloc()
16 if (!msg) { msgpool_alloc()
19 dout("msgpool_alloc %s %p\n", pool->name, msg); msgpool_alloc()
20 msg->pool = pool; msgpool_alloc()
22 return msg; msgpool_alloc()
28 struct ceph_msg *msg = element; msgpool_free() local
30 dout("msgpool_release %s %p\n", pool->name, msg); msgpool_free()
31 msg->pool = NULL; msgpool_free()
32 ceph_msg_put(msg); msgpool_free()
57 struct ceph_msg *msg; ceph_msgpool_get() local
68 msg = mempool_alloc(pool->pool, GFP_NOFS); ceph_msgpool_get()
69 dout("msgpool_get %s %p\n", pool->name, msg); ceph_msgpool_get()
70 return msg; ceph_msgpool_get()
73 void ceph_msgpool_put(struct ceph_msgpool *pool, struct ceph_msg *msg) ceph_msgpool_put() argument
75 dout("msgpool_put %s %p\n", pool->name, msg); ceph_msgpool_put()
77 /* reset msg front_len; user may have changed it */ ceph_msgpool_put()
78 msg->front.iov_len = pool->front_len; ceph_msgpool_put()
79 msg->hdr.front_len = cpu_to_le32(pool->front_len); ceph_msgpool_put()
81 kref_init(&msg->kref); /* retake single ref */ ceph_msgpool_put()
82 mempool_free(msg, pool->pool); ceph_msgpool_put()
/linux-4.4.14/drivers/staging/rts5208/
H A Dtrace.c11 struct trace_msg_t *msg = &chip->trace_msg[chip->msg_idx]; _rtsx_trace() local
16 strncpy(msg->file, file, MSG_FILE_LEN - 1); _rtsx_trace()
17 strncpy(msg->func, func, MSG_FUNC_LEN - 1); _rtsx_trace()
18 msg->line = (u16)line; _rtsx_trace()
19 get_current_time(msg->timeval_buf, TIME_VAL_LEN); _rtsx_trace()
20 msg->valid = 1; _rtsx_trace()
/linux-4.4.14/drivers/connector/
H A Dcn_proc.c69 struct cn_msg *msg; proc_fork_connector() local
77 msg = buffer_to_cn_msg(buffer); proc_fork_connector()
78 ev = (struct proc_event *)msg->data; proc_fork_connector()
80 get_seq(&msg->seq, &ev->cpu); proc_fork_connector()
91 memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); proc_fork_connector()
92 msg->ack = 0; /* not used */ proc_fork_connector()
93 msg->len = sizeof(*ev); proc_fork_connector()
94 msg->flags = 0; /* not used */ proc_fork_connector()
96 cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_KERNEL); proc_fork_connector()
101 struct cn_msg *msg; proc_exec_connector() local
108 msg = buffer_to_cn_msg(buffer); proc_exec_connector()
109 ev = (struct proc_event *)msg->data; proc_exec_connector()
111 get_seq(&msg->seq, &ev->cpu); proc_exec_connector()
117 memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); proc_exec_connector()
118 msg->ack = 0; /* not used */ proc_exec_connector()
119 msg->len = sizeof(*ev); proc_exec_connector()
120 msg->flags = 0; /* not used */ proc_exec_connector()
121 cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_KERNEL); proc_exec_connector()
126 struct cn_msg *msg; proc_id_connector() local
134 msg = buffer_to_cn_msg(buffer); proc_id_connector()
135 ev = (struct proc_event *)msg->data; proc_id_connector()
153 get_seq(&msg->seq, &ev->cpu); proc_id_connector()
156 memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); proc_id_connector()
157 msg->ack = 0; /* not used */ proc_id_connector()
158 msg->len = sizeof(*ev); proc_id_connector()
159 msg->flags = 0; /* not used */ proc_id_connector()
160 cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_KERNEL); proc_id_connector()
165 struct cn_msg *msg; proc_sid_connector() local
172 msg = buffer_to_cn_msg(buffer); proc_sid_connector()
173 ev = (struct proc_event *)msg->data; proc_sid_connector()
175 get_seq(&msg->seq, &ev->cpu); proc_sid_connector()
181 memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); proc_sid_connector()
182 msg->ack = 0; /* not used */ proc_sid_connector()
183 msg->len = sizeof(*ev); proc_sid_connector()
184 msg->flags = 0; /* not used */ proc_sid_connector()
185 cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_KERNEL); proc_sid_connector()
190 struct cn_msg *msg; proc_ptrace_connector() local
197 msg = buffer_to_cn_msg(buffer); proc_ptrace_connector()
198 ev = (struct proc_event *)msg->data; proc_ptrace_connector()
200 get_seq(&msg->seq, &ev->cpu); proc_ptrace_connector()
214 memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); proc_ptrace_connector()
215 msg->ack = 0; /* not used */ proc_ptrace_connector()
216 msg->len = sizeof(*ev); proc_ptrace_connector()
217 msg->flags = 0; /* not used */ proc_ptrace_connector()
218 cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_KERNEL); proc_ptrace_connector()
223 struct cn_msg *msg; proc_comm_connector() local
230 msg = buffer_to_cn_msg(buffer); proc_comm_connector()
231 ev = (struct proc_event *)msg->data; proc_comm_connector()
233 get_seq(&msg->seq, &ev->cpu); proc_comm_connector()
240 memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); proc_comm_connector()
241 msg->ack = 0; /* not used */ proc_comm_connector()
242 msg->len = sizeof(*ev); proc_comm_connector()
243 msg->flags = 0; /* not used */ proc_comm_connector()
244 cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_KERNEL); proc_comm_connector()
249 struct cn_msg *msg; proc_coredump_connector() local
256 msg = buffer_to_cn_msg(buffer); proc_coredump_connector()
257 ev = (struct proc_event *)msg->data; proc_coredump_connector()
259 get_seq(&msg->seq, &ev->cpu); proc_coredump_connector()
265 memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); proc_coredump_connector()
266 msg->ack = 0; /* not used */ proc_coredump_connector()
267 msg->len = sizeof(*ev); proc_coredump_connector()
268 msg->flags = 0; /* not used */ proc_coredump_connector()
269 cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_KERNEL); proc_coredump_connector()
274 struct cn_msg *msg; proc_exit_connector() local
281 msg = buffer_to_cn_msg(buffer); proc_exit_connector()
282 ev = (struct proc_event *)msg->data; proc_exit_connector()
284 get_seq(&msg->seq, &ev->cpu); proc_exit_connector()
292 memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); proc_exit_connector()
293 msg->ack = 0; /* not used */ proc_exit_connector()
294 msg->len = sizeof(*ev); proc_exit_connector()
295 msg->flags = 0; /* not used */ proc_exit_connector()
296 cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_KERNEL); proc_exit_connector()
309 struct cn_msg *msg; cn_proc_ack() local
316 msg = buffer_to_cn_msg(buffer); cn_proc_ack()
317 ev = (struct proc_event *)msg->data; cn_proc_ack()
319 msg->seq = rcvd_seq; cn_proc_ack()
324 memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); cn_proc_ack()
325 msg->ack = rcvd_ack + 1; cn_proc_ack()
326 msg->len = sizeof(*ev); cn_proc_ack()
327 msg->flags = 0; /* not used */ cn_proc_ack()
328 cn_netlink_send(msg, 0, CN_IDX_PROC, GFP_KERNEL); cn_proc_ack()
335 static void cn_proc_mcast_ctl(struct cn_msg *msg, cn_proc_mcast_ctl() argument
341 if (msg->len != sizeof(*mc_op)) cn_proc_mcast_ctl()
359 mc_op = (enum proc_cn_mcast_op *)msg->data; cn_proc_mcast_ctl()
373 cn_proc_ack(err, msg->seq, msg->ack); cn_proc_mcast_ctl()
H A Dconnector.c48 * msg->seq and msg->ack are used to determine message genealogy.
67 * If msg->len != len, then additional cn_msg messages are expected following
68 * the first msg.
73 int cn_netlink_send_mult(struct cn_msg *msg, u16 len, u32 portid, u32 __group, cn_netlink_send_mult() argument
91 if (cn_cb_equal(&__cbq->id.id, &msg->id)) { cn_netlink_send_mult()
106 size = sizeof(*msg) + len; cn_netlink_send_mult()
112 nlh = nlmsg_put(skb, 0, msg->seq, NLMSG_DONE, size, 0); cn_netlink_send_mult()
120 memcpy(data, msg, size); cn_netlink_send_mult()
132 /* same as cn_netlink_send_mult except msg->len is used for len */ cn_netlink_send()
133 int cn_netlink_send(struct cn_msg *msg, u32 portid, u32 __group, cn_netlink_send() argument
136 return cn_netlink_send_mult(msg, msg->len, portid, __group, gfp_mask); cn_netlink_send()
148 struct cn_msg *msg = nlmsg_data(nlmsg_hdr(skb)); cn_call_callback() local
152 /* verify msg->len is within skb */ cn_call_callback()
154 if (nlh->nlmsg_len < NLMSG_HDRLEN + sizeof(struct cn_msg) + msg->len) cn_call_callback()
159 if (cn_cb_equal(&i->id.id, &msg->id)) { cn_call_callback()
168 cbq->callback(msg, nsp); cn_call_callback()
180 * It checks skb, netlink header and msg sizes, and calls callback helper.
/linux-4.4.14/drivers/isdn/act2000/
H A Dcapi.c145 m->msg.listen_req.controller = 0; actcapi_listen_req()
146 m->msg.listen_req.infomask = 0x3f; /* All information */ actcapi_listen_req()
147 m->msg.listen_req.eazmask = eazmask; actcapi_listen_req()
148 m->msg.listen_req.simask = (eazmask) ? 0x86 : 0; /* All SI's */ actcapi_listen_req()
166 m->msg.connect_req.controller = 0; actcapi_connect_req()
167 m->msg.connect_req.bchan = 0x83; actcapi_connect_req()
168 m->msg.connect_req.infomask = 0x3f; actcapi_connect_req()
169 m->msg.connect_req.si1 = si1; actcapi_connect_req()
170 m->msg.connect_req.si2 = si2; actcapi_connect_req()
171 m->msg.connect_req.eaz = eaz ? eaz : '0'; actcapi_connect_req()
172 m->msg.connect_req.addr.len = strlen(phone) + 1; actcapi_connect_req()
173 m->msg.connect_req.addr.tnp = 0x81; actcapi_connect_req()
174 memcpy(m->msg.connect_req.addr.num, phone, strlen(phone)); actcapi_connect_req()
188 m->msg.connect_b3_req.plci = chan->plci; actcapi_connect_b3_req()
189 memset(&m->msg.connect_b3_req.ncpi, 0, actcapi_connect_b3_req()
190 sizeof(m->msg.connect_b3_req.ncpi)); actcapi_connect_b3_req()
191 m->msg.connect_b3_req.ncpi.len = 13; actcapi_connect_b3_req()
192 m->msg.connect_b3_req.ncpi.modulo = 8; actcapi_connect_b3_req()
210 m->msg.manufacturer_req_net.manuf_msg = 0x11; actcapi_manufacturer_req_net()
211 m->msg.manufacturer_req_net.controller = 1; actcapi_manufacturer_req_net()
212 m->msg.manufacturer_req_net.nettype = (card->ptype == ISDN_PTYPE_EURO) ? 1 : 0; actcapi_manufacturer_req_net()
239 m->msg.manufacturer_req_v42.manuf_msg = 0x10;
240 m->msg.manufacturer_req_v42.controller = 0;
241 m->msg.manufacturer_req_v42.v42control = (arg ? 1 : 0);
262 m->msg.manufacturer_req_err.manuf_msg = 0x03; actcapi_manufacturer_req_errh()
263 m->msg.manufacturer_req_err.controller = 0; actcapi_manufacturer_req_errh()
289 m->msg.manufacturer_req_msn.manuf_msg = 0x13 + i; actcapi_manufacturer_req_msn()
290 m->msg.manufacturer_req_msn.controller = 0; actcapi_manufacturer_req_msn()
291 m->msg.manufacturer_req_msn.msnmap.eaz = p->eaz; actcapi_manufacturer_req_msn()
292 m->msg.manufacturer_req_msn.msnmap.len = len; actcapi_manufacturer_req_msn()
293 memcpy(m->msg.manufacturer_req_msn.msnmap.msn, p->msn, len); actcapi_manufacturer_req_msn()
309 m->msg.select_b2_protocol_req.plci = chan->plci; actcapi_select_b2_protocol_req()
310 memset(&m->msg.select_b2_protocol_req.dlpd, 0, actcapi_select_b2_protocol_req()
311 sizeof(m->msg.select_b2_protocol_req.dlpd)); actcapi_select_b2_protocol_req()
312 m->msg.select_b2_protocol_req.dlpd.len = 6; actcapi_select_b2_protocol_req()
315 m->msg.select_b2_protocol_req.protocol = 0x03; actcapi_select_b2_protocol_req()
316 m->msg.select_b2_protocol_req.dlpd.dlen = 4000; actcapi_select_b2_protocol_req()
319 m->msg.select_b2_protocol_req.protocol = 0x02; actcapi_select_b2_protocol_req()
320 m->msg.select_b2_protocol_req.dlpd.dlen = 4000; actcapi_select_b2_protocol_req()
325 m->msg.select_b2_protocol_req.protocol = 0x01; actcapi_select_b2_protocol_req()
326 m->msg.select_b2_protocol_req.dlpd.dlen = 4000; actcapi_select_b2_protocol_req()
327 m->msg.select_b2_protocol_req.dlpd.laa = 3; actcapi_select_b2_protocol_req()
328 m->msg.select_b2_protocol_req.dlpd.lab = 1; actcapi_select_b2_protocol_req()
329 m->msg.select_b2_protocol_req.dlpd.win = 7; actcapi_select_b2_protocol_req()
330 m->msg.select_b2_protocol_req.dlpd.modulo = 8; actcapi_select_b2_protocol_req()
344 m->msg.select_b3_protocol_req.plci = chan->plci; actcapi_select_b3_protocol_req()
345 memset(&m->msg.select_b3_protocol_req.ncpd, 0, actcapi_select_b3_protocol_req()
346 sizeof(m->msg.select_b3_protocol_req.ncpd)); actcapi_select_b3_protocol_req()
349 m->msg.select_b3_protocol_req.protocol = 0x04; actcapi_select_b3_protocol_req()
350 m->msg.select_b3_protocol_req.ncpd.len = 13; actcapi_select_b3_protocol_req()
351 m->msg.select_b3_protocol_req.ncpd.modulo = 8; actcapi_select_b3_protocol_req()
365 m->msg.listen_b3_req.plci = chan->plci; actcapi_listen_b3_req()
377 m->msg.disconnect_req.plci = chan->plci; actcapi_disconnect_req()
378 m->msg.disconnect_req.cause = 0; actcapi_disconnect_req()
390 m->msg.disconnect_b3_req.ncci = chan->ncci; actcapi_disconnect_b3_req()
391 memset(&m->msg.disconnect_b3_req.ncpi, 0, actcapi_disconnect_b3_req()
392 sizeof(m->msg.disconnect_b3_req.ncpi)); actcapi_disconnect_b3_req()
393 m->msg.disconnect_b3_req.ncpi.len = 13; actcapi_disconnect_b3_req()
394 m->msg.disconnect_b3_req.ncpi.modulo = 8; actcapi_disconnect_b3_req()
407 m->msg.connect_resp.plci = chan->plci; actcapi_connect_resp()
408 m->msg.connect_resp.rejectcause = cause; actcapi_connect_resp()
425 m->msg.connect_resp.plci = chan->plci; actcapi_connect_active_resp()
439 m->msg.connect_b3_resp.ncci = chan->ncci; actcapi_connect_b3_resp()
440 m->msg.connect_b3_resp.rejectcause = rejectcause; actcapi_connect_b3_resp()
442 memset(&m->msg.connect_b3_resp.ncpi, 0, actcapi_connect_b3_resp()
443 sizeof(m->msg.connect_b3_resp.ncpi)); actcapi_connect_b3_resp()
444 m->msg.connect_b3_resp.ncpi.len = 13; actcapi_connect_b3_resp()
445 m->msg.connect_b3_resp.ncpi.modulo = 8; actcapi_connect_b3_resp()
459 m->msg.connect_b3_active_resp.ncci = chan->ncci; actcapi_connect_b3_active_resp()
472 m->msg.info_resp.plci = chan->plci; actcapi_info_resp()
484 m->msg.disconnect_b3_resp.ncci = chan->ncci; actcapi_disconnect_b3_resp()
498 m->msg.disconnect_resp.plci = chan->plci; actcapi_disconnect_resp()
553 actcapi_msg *msg = (actcapi_msg *)skb->data; actcapi_data_b3_ind() local
555 EVAL_NCCI(msg->msg.data_b3_ind.fakencci, plci, controller, ncci); actcapi_data_b3_ind()
563 blocknr = msg->msg.data_b3_ind.blocknr; actcapi_data_b3_ind()
570 msg = (actcapi_msg *)skb_put(skb, 11); actcapi_data_b3_ind()
571 msg->hdr.len = 11; actcapi_data_b3_ind()
572 msg->hdr.applicationID = 1; actcapi_data_b3_ind()
573 msg->hdr.cmd.cmd = 0x86; actcapi_data_b3_ind()
574 msg->hdr.cmd.subcmd = 0x03; actcapi_data_b3_ind()
575 msg->hdr.msgnum = actcapi_nextsmsg(card); actcapi_data_b3_ind()
576 msg->msg.data_b3_resp.ncci = ncci; actcapi_data_b3_ind()
577 msg->msg.data_b3_resp.blocknr = blocknr; actcapi_data_b3_ind()
605 if ((((m->msg.data_b3_req.fakencci >> 8) & 0xff) == chan->ncci) && handle_ack()
606 (m->msg.data_b3_req.blocknr == blocknr)) { handle_ack()
609 chan->queued -= m->msg.data_b3_req.datalen; handle_ack()
610 if (m->msg.data_b3_req.flags) handle_ack()
611 ret = m->msg.data_b3_req.datalen; handle_ack()
634 actcapi_msg *msg; actcapi_dispatch() local
644 msg = (actcapi_msg *)skb->data; actcapi_dispatch()
645 ccmd = ((msg->hdr.cmd.cmd << 8) | msg->hdr.cmd.subcmd); actcapi_dispatch()
654 chan = find_ncci(card, msg->msg.data_b3_conf.ncci); actcapi_dispatch()
656 if (msg->msg.data_b3_conf.info != 0) actcapi_dispatch()
658 msg->msg.data_b3_conf.info); actcapi_dispatch()
660 msg->msg.data_b3_conf.blocknr); actcapi_dispatch()
672 chan = find_dialing(card, msg->hdr.msgnum); actcapi_dispatch()
674 if (msg->msg.connect_conf.info) { actcapi_dispatch()
682 card->bch[chan].plci = msg->msg.connect_conf.plci; actcapi_dispatch()
688 chan = new_plci(card, msg->msg.connect_ind.plci); actcapi_dispatch()
691 ctmp->plci = msg->msg.connect_ind.plci; actcapi_dispatch()
698 cmd.parm.setup.si1 = msg->msg.connect_ind.si1; actcapi_dispatch()
699 cmd.parm.setup.si2 = msg->msg.connect_ind.si2; actcapi_dispatch()
702 act2000_find_eaz(card, msg->msg.connect_ind.eaz)); actcapi_dispatch()
704 cmd.parm.setup.eazmsn[0] = msg->msg.connect_ind.eaz; actcapi_dispatch()
708 memcpy(cmd.parm.setup.phone, msg->msg.connect_ind.addr.num, actcapi_dispatch()
709 msg->msg.connect_ind.addr.len - 1); actcapi_dispatch()
710 cmd.parm.setup.plan = msg->msg.connect_ind.addr.tnp; actcapi_dispatch()
718 chan = find_plci(card, msg->msg.connect_active_ind.plci); actcapi_dispatch()
732 chan = find_plci(card, msg->msg.connect_b3_ind.plci); actcapi_dispatch()
734 card->bch[chan].ncci = msg->msg.connect_b3_ind.ncci; actcapi_dispatch()
738 ctmp->ncci = msg->msg.connect_b3_ind.ncci; actcapi_dispatch()
744 chan = find_ncci(card, msg->msg.connect_b3_active_ind.ncci); actcapi_dispatch()
755 chan = find_ncci(card, msg->msg.disconnect_b3_ind.ncci); actcapi_dispatch()
780 chan = find_plci(card, msg->msg.disconnect_ind.plci); actcapi_dispatch()
791 ctmp->plci = msg->msg.disconnect_ind.plci; actcapi_dispatch()
797 chan = find_plci(card, msg->msg.select_b2_protocol_conf.plci); actcapi_dispatch()
803 if (msg->msg.select_b2_protocol_conf.info == 0) actcapi_dispatch()
817 chan = find_plci(card, msg->msg.select_b3_protocol_conf.plci); actcapi_dispatch()
823 if (msg->msg.select_b3_protocol_conf.info == 0) actcapi_dispatch()
836 chan = find_plci(card, msg->msg.listen_b3_conf.plci); actcapi_dispatch()
841 if (msg->msg.listen_b3_conf.info == 0) actcapi_dispatch()
853 if (msg->msg.listen_b3_conf.info == 0) { actcapi_dispatch()
872 chan = find_plci(card, msg->msg.connect_b3_conf.plci); actcapi_dispatch()
875 if (msg->msg.connect_b3_conf.info) { actcapi_dispatch()
882 ctmp->ncci = msg->msg.connect_b3_conf.ncci; actcapi_dispatch()
889 chan = find_ncci(card, msg->msg.disconnect_b3_conf.ncci); actcapi_dispatch()
895 chan = find_plci(card, msg->msg.info_ind.plci); actcapi_dispatch()
909 if (msg->msg.manuf_msg == 3) { actcapi_dispatch()
912 &msg->msg.manufacturer_ind_err.errstring, actcapi_dispatch()
913 msg->hdr.len - 16); actcapi_dispatch()
914 if (msg->msg.manufacturer_ind_err.errcode) actcapi_dispatch()
1014 actcapi_msg *msg = (actcapi_msg *)skb->data; actcapi_debug_msg() local
1020 if (msg->hdr.cmd.cmd == 0x86) actcapi_debug_msg()
1028 if ((msg->hdr.cmd.cmd == valid_msg[i].cmd.cmd) && actcapi_debug_msg()
1029 (msg->hdr.cmd.subcmd == valid_msg[i].cmd.subcmd)) { actcapi_debug_msg()
1033 printk(KERN_DEBUG "%s %s msg\n", direction ? "Outgoing" : "Incoming", descr); actcapi_debug_msg()
1034 printk(KERN_DEBUG " ApplID = %d\n", msg->hdr.applicationID); actcapi_debug_msg()
1035 printk(KERN_DEBUG " Len = %d\n", msg->hdr.len); actcapi_debug_msg()
1036 printk(KERN_DEBUG " MsgNum = 0x%04x\n", msg->hdr.msgnum); actcapi_debug_msg()
1037 printk(KERN_DEBUG " Cmd = 0x%02x\n", msg->hdr.cmd.cmd); actcapi_debug_msg()
1038 printk(KERN_DEBUG " SubCmd = 0x%02x\n", msg->hdr.cmd.subcmd); actcapi_debug_msg()
1043 msg->msg.data_b3_ind.blocknr); actcapi_debug_msg()
1048 msg->msg.connect_conf.plci); actcapi_debug_msg()
1050 msg->msg.connect_conf.info); actcapi_debug_msg()
1055 msg->msg.connect_ind.plci); actcapi_debug_msg()
1057 msg->msg.connect_ind.controller); actcapi_debug_msg()
1059 msg->msg.connect_ind.si1); actcapi_debug_msg()
1061 msg->msg.connect_ind.si2); actcapi_debug_msg()
1063 msg->msg.connect_ind.eaz); actcapi_debug_msg()
1064 actcapi_debug_caddr(&msg->msg.connect_ind.addr); actcapi_debug_msg()
1069 msg->msg.connect_active_ind.plci); actcapi_debug_msg()
1070 actcapi_debug_caddr(&msg->msg.connect_active_ind.addr); actcapi_debug_msg()
1075 msg->msg.listen_conf.controller); actcapi_debug_msg()
1077 msg->msg.listen_conf.info); actcapi_debug_msg()
1082 msg->msg.info_ind.plci); actcapi_debug_msg()
1084 msg->msg.info_ind.nr.mask); actcapi_debug_msg()
1085 if (msg->hdr.len > 12) { actcapi_debug_msg()
1086 int l = msg->hdr.len - 12; actcapi_debug_msg()
1090 p += sprintf(p, "%02x ", msg->msg.info_ind.el.display[j]); actcapi_debug_msg()
1097 msg->msg.select_b2_protocol_conf.plci); actcapi_debug_msg()
1099 msg->msg.select_b2_protocol_conf.info); actcapi_debug_msg()
1104 msg->msg.select_b3_protocol_conf.plci); actcapi_debug_msg()
1106 msg->msg.select_b3_protocol_conf.info); actcapi_debug_msg()
1111 msg->msg.listen_b3_conf.plci); actcapi_debug_msg()
1113 msg->msg.listen_b3_conf.info); actcapi_debug_msg()
1118 msg->msg.connect_b3_ind.ncci); actcapi_debug_msg()
1120 msg->msg.connect_b3_ind.plci); actcapi_debug_msg()
1121 actcapi_debug_ncpi(&msg->msg.connect_b3_ind.ncpi); actcapi_debug_msg()
1126 msg->msg.connect_b3_active_ind.ncci); actcapi_debug_msg()
1127 actcapi_debug_ncpi(&msg->msg.connect_b3_active_ind.ncpi); actcapi_debug_msg()
1132 msg->msg.manufacturer_ind_err.manuf_msg); actcapi_debug_msg()
1133 switch (msg->msg.manufacturer_ind_err.manuf_msg) { actcapi_debug_msg()
1136 msg->msg.manufacturer_ind_err.controller); actcapi_debug_msg()
1138 msg->msg.manufacturer_ind_err.errcode); actcapi_debug_msg()
1140 strncpy(tmp, &msg->msg.manufacturer_ind_err.errstring, actcapi_debug_msg()
1141 msg->hdr.len - 16); actcapi_debug_msg()
1149 msg->msg.listen_req.infomask); actcapi_debug_msg()
1151 msg->msg.listen_req.eazmask); actcapi_debug_msg()
1153 msg->msg.listen_req.simask); actcapi_debug_msg()
1158 msg->msg.select_b2_protocol_req.plci); actcapi_debug_msg()
1160 msg->msg.select_b2_protocol_req.protocol); actcapi_debug_msg()
1161 if (msg->hdr.len >= 11) actcapi_debug_msg()
1164 actcapi_debug_dlpd(&msg->msg.select_b2_protocol_req.dlpd); actcapi_debug_msg()
1169 msg->msg.connect_resp.plci); actcapi_debug_msg()
1171 msg->msg.connect_resp.rejectcause); actcapi_debug_msg()
1176 msg->msg.connect_active_resp.plci); actcapi_debug_msg()
/linux-4.4.14/drivers/staging/lustre/lnet/lnet/
H A Dlib-msg.c36 * lnet/lnet/lib-msg.c
61 lnet_build_msg_event(lnet_msg_t *msg, lnet_event_kind_t ev_type) lnet_build_msg_event() argument
63 lnet_hdr_t *hdr = &msg->msg_hdr; lnet_build_msg_event()
64 lnet_event_t *ev = &msg->msg_ev; lnet_build_msg_event()
66 LASSERT(!msg->msg_routing); lnet_build_msg_event()
85 ev->sender = msg->msg_from; lnet_build_msg_event()
86 ev->mlength = msg->msg_wanted; lnet_build_msg_event()
87 ev->offset = msg->msg_offset; lnet_build_msg_event()
95 ev->pt_index = hdr->msg.put.ptl_index; lnet_build_msg_event()
96 ev->match_bits = hdr->msg.put.match_bits; lnet_build_msg_event()
97 ev->hdr_data = hdr->msg.put.hdr_data; lnet_build_msg_event()
101 ev->pt_index = hdr->msg.get.ptl_index; lnet_build_msg_event()
102 ev->match_bits = hdr->msg.get.match_bits; lnet_build_msg_event()
107 ev->match_bits = hdr->msg.ack.match_bits; lnet_build_msg_event()
108 ev->mlength = hdr->msg.ack.mlength; lnet_build_msg_event()
115 if (msg->msg_type == LNET_MSG_PUT) { lnet_build_msg_event()
116 ev->pt_index = le32_to_cpu(hdr->msg.put.ptl_index); lnet_build_msg_event()
117 ev->match_bits = le64_to_cpu(hdr->msg.put.match_bits); lnet_build_msg_event()
118 ev->offset = le32_to_cpu(hdr->msg.put.offset); lnet_build_msg_event()
121 ev->hdr_data = le64_to_cpu(hdr->msg.put.hdr_data); lnet_build_msg_event()
124 LASSERT(msg->msg_type == LNET_MSG_GET); lnet_build_msg_event()
125 ev->pt_index = le32_to_cpu(hdr->msg.get.ptl_index); lnet_build_msg_event()
126 ev->match_bits = le64_to_cpu(hdr->msg.get.match_bits); lnet_build_msg_event()
128 ev->rlength = le32_to_cpu(hdr->msg.get.sink_length); lnet_build_msg_event()
129 ev->offset = le32_to_cpu(hdr->msg.get.src_offset); lnet_build_msg_event()
137 lnet_msg_commit(lnet_msg_t *msg, int cpt) lnet_msg_commit() argument
143 LASSERT(!msg->msg_tx_committed); lnet_msg_commit()
145 if (msg->msg_sending) { lnet_msg_commit()
146 LASSERT(!msg->msg_receiving); lnet_msg_commit()
148 msg->msg_tx_cpt = cpt; lnet_msg_commit()
149 msg->msg_tx_committed = 1; lnet_msg_commit()
150 if (msg->msg_rx_committed) { /* routed message REPLY */ lnet_msg_commit()
151 LASSERT(msg->msg_onactivelist); lnet_msg_commit()
155 LASSERT(!msg->msg_sending); lnet_msg_commit()
156 msg->msg_rx_cpt = cpt; lnet_msg_commit()
157 msg->msg_rx_committed = 1; lnet_msg_commit()
160 LASSERT(!msg->msg_onactivelist); lnet_msg_commit()
161 msg->msg_onactivelist = 1; lnet_msg_commit()
162 list_add(&msg->msg_activelist, &container->msc_active); lnet_msg_commit()
170 lnet_msg_decommit_tx(lnet_msg_t *msg, int status) lnet_msg_decommit_tx() argument
173 lnet_event_t *ev = &msg->msg_ev; lnet_msg_decommit_tx()
175 LASSERT(msg->msg_tx_committed); lnet_msg_decommit_tx()
179 counters = the_lnet.ln_counters[msg->msg_tx_cpt]; lnet_msg_decommit_tx()
182 LASSERT(msg->msg_routing); lnet_msg_decommit_tx()
183 LASSERT(msg->msg_rx_committed); lnet_msg_decommit_tx()
186 counters->route_length += msg->msg_len; lnet_msg_decommit_tx()
192 LASSERT(!msg->msg_rx_committed); lnet_msg_decommit_tx()
194 LASSERT(msg->msg_type == LNET_MSG_ACK); lnet_msg_decommit_tx()
195 msg->msg_type = LNET_MSG_PUT; /* fix type */ lnet_msg_decommit_tx()
199 LASSERT(!msg->msg_rx_committed); lnet_msg_decommit_tx()
200 if (msg->msg_type == LNET_MSG_PUT) lnet_msg_decommit_tx()
201 counters->send_length += msg->msg_len; lnet_msg_decommit_tx()
205 LASSERT(msg->msg_rx_committed); lnet_msg_decommit_tx()
208 LASSERT(msg->msg_type == LNET_MSG_REPLY); lnet_msg_decommit_tx()
209 msg->msg_type = LNET_MSG_GET; /* fix type */ lnet_msg_decommit_tx()
215 lnet_return_tx_credits_locked(msg); lnet_msg_decommit_tx()
216 msg->msg_tx_committed = 0; lnet_msg_decommit_tx()
220 lnet_msg_decommit_rx(lnet_msg_t *msg, int status) lnet_msg_decommit_rx() argument
223 lnet_event_t *ev = &msg->msg_ev; lnet_msg_decommit_rx()
225 LASSERT(!msg->msg_tx_committed); /* decommitted or never committed */ lnet_msg_decommit_rx()
226 LASSERT(msg->msg_rx_committed); lnet_msg_decommit_rx()
231 counters = the_lnet.ln_counters[msg->msg_rx_cpt]; lnet_msg_decommit_rx()
235 LASSERT(msg->msg_routing); lnet_msg_decommit_rx()
239 LASSERT(msg->msg_type == LNET_MSG_ACK); lnet_msg_decommit_rx()
247 LASSERT(msg->msg_type == LNET_MSG_REPLY || lnet_msg_decommit_rx()
248 msg->msg_type == LNET_MSG_GET); lnet_msg_decommit_rx()
249 counters->send_length += msg->msg_wanted; lnet_msg_decommit_rx()
253 LASSERT(msg->msg_type == LNET_MSG_PUT); lnet_msg_decommit_rx()
259 LASSERT(msg->msg_type == LNET_MSG_GET || lnet_msg_decommit_rx()
260 msg->msg_type == LNET_MSG_REPLY); lnet_msg_decommit_rx()
266 counters->recv_length += msg->msg_wanted; lnet_msg_decommit_rx()
269 lnet_return_rx_credits_locked(msg); lnet_msg_decommit_rx()
270 msg->msg_rx_committed = 0; lnet_msg_decommit_rx()
274 lnet_msg_decommit(lnet_msg_t *msg, int cpt, int status) lnet_msg_decommit() argument
278 LASSERT(msg->msg_tx_committed || msg->msg_rx_committed); lnet_msg_decommit()
279 LASSERT(msg->msg_onactivelist); lnet_msg_decommit()
281 if (msg->msg_tx_committed) { /* always decommit for sending first */ lnet_msg_decommit()
282 LASSERT(cpt == msg->msg_tx_cpt); lnet_msg_decommit()
283 lnet_msg_decommit_tx(msg, status); lnet_msg_decommit()
286 if (msg->msg_rx_committed) { lnet_msg_decommit()
287 /* forwarding msg committed for both receiving and sending */ lnet_msg_decommit()
288 if (cpt != msg->msg_rx_cpt) { lnet_msg_decommit()
290 cpt2 = msg->msg_rx_cpt; lnet_msg_decommit()
293 lnet_msg_decommit_rx(msg, status); lnet_msg_decommit()
296 list_del(&msg->msg_activelist); lnet_msg_decommit()
297 msg->msg_onactivelist = 0; lnet_msg_decommit()
308 lnet_msg_attach_md(lnet_msg_t *msg, lnet_libmd_t *md, lnet_msg_attach_md() argument
316 LASSERT(!msg->msg_routing); lnet_msg_attach_md()
318 msg->msg_md = md; lnet_msg_attach_md()
319 if (msg->msg_receiving) { /* committed for receiving */ lnet_msg_attach_md()
320 msg->msg_offset = offset; lnet_msg_attach_md()
321 msg->msg_wanted = mlen; lnet_msg_attach_md()
331 lnet_md2handle(&msg->msg_ev.md_handle, md); lnet_msg_attach_md()
332 lnet_md_deconstruct(md, &msg->msg_ev.md); lnet_msg_attach_md()
336 lnet_msg_detach_md(lnet_msg_t *msg, int status) lnet_msg_detach_md() argument
338 lnet_libmd_t *md = msg->msg_md; lnet_msg_detach_md()
347 msg->msg_ev.status = status; lnet_msg_detach_md()
348 msg->msg_ev.unlinked = unlink; lnet_msg_detach_md()
349 lnet_eq_enqueue_event(md->md_eq, &msg->msg_ev); lnet_msg_detach_md()
355 msg->msg_md = NULL; lnet_msg_detach_md()
359 lnet_complete_msg_locked(lnet_msg_t *msg, int cpt) lnet_complete_msg_locked() argument
363 int status = msg->msg_ev.status; lnet_complete_msg_locked()
365 LASSERT(msg->msg_onactivelist); lnet_complete_msg_locked()
367 if (status == 0 && msg->msg_ack) { lnet_complete_msg_locked()
370 lnet_msg_decommit(msg, cpt, 0); lnet_complete_msg_locked()
372 msg->msg_ack = 0; lnet_complete_msg_locked()
375 LASSERT(msg->msg_ev.type == LNET_EVENT_PUT); lnet_complete_msg_locked()
376 LASSERT(!msg->msg_routing); lnet_complete_msg_locked()
378 ack_wmd = msg->msg_hdr.msg.put.ack_wmd; lnet_complete_msg_locked()
380 lnet_prep_send(msg, LNET_MSG_ACK, msg->msg_ev.initiator, 0, 0); lnet_complete_msg_locked()
382 msg->msg_hdr.msg.ack.dst_wmd = ack_wmd; lnet_complete_msg_locked()
383 msg->msg_hdr.msg.ack.match_bits = msg->msg_ev.match_bits; lnet_complete_msg_locked()
384 msg->msg_hdr.msg.ack.mlength = cpu_to_le32(msg->msg_ev.mlength); lnet_complete_msg_locked()
386 /* NB: we probably want to use NID of msg::msg_from as 3rd lnet_complete_msg_locked()
388 rc = lnet_send(msg->msg_ev.target.nid, msg, LNET_NID_ANY); lnet_complete_msg_locked()
405 (msg->msg_routing && !msg->msg_sending)) { lnet_complete_msg_locked()
407 LASSERT(!msg->msg_receiving); /* called back recv already */ lnet_complete_msg_locked()
410 rc = lnet_send(LNET_NID_ANY, msg, LNET_NID_ANY); lnet_complete_msg_locked()
429 lnet_msg_decommit(msg, cpt, status); lnet_complete_msg_locked()
430 lnet_msg_free(msg); lnet_complete_msg_locked()
435 lnet_finalize(lnet_ni_t *ni, lnet_msg_t *msg, int status) lnet_finalize() argument
445 if (msg == NULL) lnet_finalize()
448 CDEBUG(D_WARNING, "%s msg->%s Flags:%s%s%s%s%s%s%s%s%s%s%s txp %s rxp %s\n", lnet_finalize()
449 lnet_msgtyp2str(msg->msg_type), libcfs_id2str(msg->msg_target), lnet_finalize()
450 msg->msg_target_is_router ? "t" : "", lnet_finalize()
451 msg->msg_routing ? "X" : "", lnet_finalize()
452 msg->msg_ack ? "A" : "", lnet_finalize()
453 msg->msg_sending ? "S" : "", lnet_finalize()
454 msg->msg_receiving ? "R" : "", lnet_finalize()
455 msg->msg_delayed ? "d" : "", lnet_finalize()
456 msg->msg_txcredit ? "C" : "", lnet_finalize()
457 msg->msg_peertxcredit ? "c" : "", lnet_finalize()
458 msg->msg_rtrcredit ? "F" : "", lnet_finalize()
459 msg->msg_peerrtrcredit ? "f" : "", lnet_finalize()
460 msg->msg_onactivelist ? "!" : "", lnet_finalize()
461 msg->msg_txpeer == NULL ? "<none>" : libcfs_nid2str(msg->msg_txpeer->lp_nid), lnet_finalize()
462 msg->msg_rxpeer == NULL ? "<none>" : libcfs_nid2str(msg->msg_rxpeer->lp_nid)); lnet_finalize()
464 msg->msg_ev.status = status; lnet_finalize()
466 if (msg->msg_md != NULL) { lnet_finalize()
467 cpt = lnet_cpt_of_cookie(msg->msg_md->md_lh.lh_cookie); lnet_finalize()
470 lnet_msg_detach_md(msg, status); lnet_finalize()
476 if (!msg->msg_tx_committed && !msg->msg_rx_committed) { lnet_finalize()
478 LASSERT(!msg->msg_onactivelist); lnet_finalize()
479 lnet_msg_free(msg); lnet_finalize()
488 cpt = msg->msg_tx_committed ? msg->msg_tx_cpt : msg->msg_rx_cpt; lnet_finalize()
492 list_add_tail(&msg->msg_list, &container->msc_finalizing); lnet_finalize()
514 msg = list_entry(container->msc_finalizing.next, lnet_finalize()
517 list_del(&msg->msg_list); lnet_finalize()
521 rc = lnet_complete_msg_locked(msg, cpt); lnet_finalize()
543 lnet_msg_t *msg = list_entry(container->msc_active.next, lnet_msg_container_cleanup() local
546 LASSERT(msg->msg_onactivelist); lnet_msg_container_cleanup()
547 msg->msg_onactivelist = 0; lnet_msg_container_cleanup()
548 list_del(&msg->msg_activelist); lnet_msg_container_cleanup()
549 lnet_msg_free(msg); lnet_msg_container_cleanup()
554 CERROR("%d active msg on exit\n", count); lnet_msg_container_cleanup()
H A Dlib-move.c564 lnet_ni_recv(lnet_ni_t *ni, void *private, lnet_msg_t *msg, int delayed, lnet_ni_recv() argument
573 LASSERT(mlen == 0 || msg != NULL); lnet_ni_recv()
575 if (msg != NULL) { lnet_ni_recv()
576 LASSERT(msg->msg_receiving); lnet_ni_recv()
577 LASSERT(!msg->msg_sending); lnet_ni_recv()
578 LASSERT(rlen == msg->msg_len); lnet_ni_recv()
579 LASSERT(mlen <= msg->msg_len); lnet_ni_recv()
580 LASSERT(msg->msg_offset == offset); lnet_ni_recv()
581 LASSERT(msg->msg_wanted == mlen); lnet_ni_recv()
583 msg->msg_receiving = 0; lnet_ni_recv()
586 niov = msg->msg_niov; lnet_ni_recv()
587 iov = msg->msg_iov; lnet_ni_recv()
588 kiov = msg->msg_kiov; lnet_ni_recv()
595 rc = (ni->ni_lnd->lnd_recv)(ni, private, msg, delayed, lnet_ni_recv()
598 lnet_finalize(ni, msg, rc); lnet_ni_recv()
602 lnet_setpayloadbuffer(lnet_msg_t *msg) lnet_setpayloadbuffer() argument
604 lnet_libmd_t *md = msg->msg_md; lnet_setpayloadbuffer()
606 LASSERT(msg->msg_len > 0); lnet_setpayloadbuffer()
607 LASSERT(!msg->msg_routing); lnet_setpayloadbuffer()
609 LASSERT(msg->msg_niov == 0); lnet_setpayloadbuffer()
610 LASSERT(msg->msg_iov == NULL); lnet_setpayloadbuffer()
611 LASSERT(msg->msg_kiov == NULL); lnet_setpayloadbuffer()
613 msg->msg_niov = md->md_niov; lnet_setpayloadbuffer()
615 msg->msg_kiov = md->md_iov.kiov; lnet_setpayloadbuffer()
617 msg->msg_iov = md->md_iov.iov; lnet_setpayloadbuffer()
621 lnet_prep_send(lnet_msg_t *msg, int type, lnet_process_id_t target, lnet_prep_send() argument
624 msg->msg_type = type; lnet_prep_send()
625 msg->msg_target = target; lnet_prep_send()
626 msg->msg_len = len; lnet_prep_send()
627 msg->msg_offset = offset; lnet_prep_send()
630 lnet_setpayloadbuffer(msg); lnet_prep_send()
632 memset(&msg->msg_hdr, 0, sizeof(msg->msg_hdr)); lnet_prep_send()
633 msg->msg_hdr.type = cpu_to_le32(type); lnet_prep_send()
634 msg->msg_hdr.dest_nid = cpu_to_le64(target.nid); lnet_prep_send()
635 msg->msg_hdr.dest_pid = cpu_to_le32(target.pid); lnet_prep_send()
637 msg->msg_hdr.src_pid = cpu_to_le32(the_lnet.ln_pid); lnet_prep_send()
638 msg->msg_hdr.payload_length = cpu_to_le32(len); lnet_prep_send()
642 lnet_ni_send(lnet_ni_t *ni, lnet_msg_t *msg) lnet_ni_send() argument
644 void *priv = msg->msg_private; lnet_ni_send()
649 (msg->msg_txcredit && msg->msg_peertxcredit)); lnet_ni_send()
651 rc = (ni->ni_lnd->lnd_send)(ni, priv, msg); lnet_ni_send()
653 lnet_finalize(ni, msg, rc); lnet_ni_send()
657 lnet_ni_eager_recv(lnet_ni_t *ni, lnet_msg_t *msg) lnet_ni_eager_recv() argument
661 LASSERT(!msg->msg_sending); lnet_ni_eager_recv()
662 LASSERT(msg->msg_receiving); lnet_ni_eager_recv()
663 LASSERT(!msg->msg_rx_ready_delay); lnet_ni_eager_recv()
666 msg->msg_rx_ready_delay = 1; lnet_ni_eager_recv()
667 rc = (ni->ni_lnd->lnd_eager_recv)(ni, msg->msg_private, msg, lnet_ni_eager_recv()
668 &msg->msg_private); lnet_ni_eager_recv()
671 libcfs_nid2str(msg->msg_rxpeer->lp_nid), lnet_ni_eager_recv()
672 libcfs_id2str(msg->msg_target), rc); lnet_ni_eager_recv()
773 * \param msg The message to be sent.
778 * \retval 0 If \a msg sent or OK to send.
779 * \retval EAGAIN If \a msg blocked for credit.
784 lnet_post_send_locked(lnet_msg_t *msg, int do_send) lnet_post_send_locked() argument
786 lnet_peer_t *lp = msg->msg_txpeer; lnet_post_send_locked()
788 int cpt = msg->msg_tx_cpt; lnet_post_send_locked()
792 LASSERT(!do_send || msg->msg_tx_delayed); lnet_post_send_locked()
793 LASSERT(!msg->msg_receiving); lnet_post_send_locked()
794 LASSERT(msg->msg_tx_committed); lnet_post_send_locked()
797 if ((msg->msg_target.pid & LNET_PID_USERFLAG) == 0 && lnet_post_send_locked()
800 the_lnet.ln_counters[cpt]->drop_length += msg->msg_len; lnet_post_send_locked()
804 libcfs_id2str(msg->msg_target)); lnet_post_send_locked()
806 lnet_finalize(ni, msg, -EHOSTUNREACH); lnet_post_send_locked()
812 if (msg->msg_md != NULL && lnet_post_send_locked()
813 (msg->msg_md->md_flags & LNET_MD_FLAG_ABORTED) != 0) { lnet_post_send_locked()
817 libcfs_id2str(msg->msg_target)); lnet_post_send_locked()
819 lnet_finalize(ni, msg, -ECANCELED); lnet_post_send_locked()
825 if (!msg->msg_peertxcredit) { lnet_post_send_locked()
829 msg->msg_peertxcredit = 1; lnet_post_send_locked()
830 lp->lp_txqnob += msg->msg_len + sizeof(lnet_hdr_t); lnet_post_send_locked()
837 msg->msg_tx_delayed = 1; lnet_post_send_locked()
838 list_add_tail(&msg->msg_list, &lp->lp_txq); lnet_post_send_locked()
843 if (!msg->msg_txcredit) { lnet_post_send_locked()
847 msg->msg_txcredit = 1; lnet_post_send_locked()
854 msg->msg_tx_delayed = 1; lnet_post_send_locked()
855 list_add_tail(&msg->msg_list, &tq->tq_delayed); lnet_post_send_locked()
862 lnet_ni_send(ni, msg); lnet_post_send_locked()
869 lnet_msg2bufpool(lnet_msg_t *msg) lnet_msg2bufpool() argument
874 LASSERT(msg->msg_rx_committed); lnet_msg2bufpool()
876 cpt = msg->msg_rx_cpt; lnet_msg2bufpool()
879 LASSERT(msg->msg_len <= LNET_MTU); lnet_msg2bufpool()
880 while (msg->msg_len > (unsigned int)rbp->rbp_npages * PAGE_CACHE_SIZE) { lnet_msg2bufpool()
889 lnet_post_routed_recv_locked(lnet_msg_t *msg, int do_recv) lnet_post_routed_recv_locked() argument
893 * return EAGAIN if msg blocked and 0 if received or OK to receive */ lnet_post_routed_recv_locked()
894 lnet_peer_t *lp = msg->msg_rxpeer; lnet_post_routed_recv_locked()
898 LASSERT(msg->msg_iov == NULL); lnet_post_routed_recv_locked()
899 LASSERT(msg->msg_kiov == NULL); lnet_post_routed_recv_locked()
900 LASSERT(msg->msg_niov == 0); lnet_post_routed_recv_locked()
901 LASSERT(msg->msg_routing); lnet_post_routed_recv_locked()
902 LASSERT(msg->msg_receiving); lnet_post_routed_recv_locked()
903 LASSERT(!msg->msg_sending); lnet_post_routed_recv_locked()
906 LASSERT(!do_recv || msg->msg_rx_delayed); lnet_post_routed_recv_locked()
908 if (!msg->msg_peerrtrcredit) { lnet_post_routed_recv_locked()
912 msg->msg_peerrtrcredit = 1; lnet_post_routed_recv_locked()
919 LASSERT(msg->msg_rx_ready_delay); lnet_post_routed_recv_locked()
920 msg->msg_rx_delayed = 1; lnet_post_routed_recv_locked()
921 list_add_tail(&msg->msg_list, &lp->lp_rtrq); lnet_post_routed_recv_locked()
926 rbp = lnet_msg2bufpool(msg); lnet_post_routed_recv_locked()
928 if (!msg->msg_rtrcredit) { lnet_post_routed_recv_locked()
932 msg->msg_rtrcredit = 1; lnet_post_routed_recv_locked()
939 LASSERT(msg->msg_rx_ready_delay); lnet_post_routed_recv_locked()
940 msg->msg_rx_delayed = 1; lnet_post_routed_recv_locked()
941 list_add_tail(&msg->msg_list, &rbp->rbp_msgs); lnet_post_routed_recv_locked()
950 msg->msg_niov = rbp->rbp_npages; lnet_post_routed_recv_locked()
951 msg->msg_kiov = &rb->rb_kiov[0]; lnet_post_routed_recv_locked()
954 int cpt = msg->msg_rx_cpt; lnet_post_routed_recv_locked()
957 lnet_ni_recv(lp->lp_ni, msg->msg_private, msg, 1, lnet_post_routed_recv_locked()
958 0, msg->msg_len, msg->msg_len); lnet_post_routed_recv_locked()
965 lnet_return_tx_credits_locked(lnet_msg_t *msg) lnet_return_tx_credits_locked() argument
967 lnet_peer_t *txpeer = msg->msg_txpeer; lnet_return_tx_credits_locked()
970 if (msg->msg_txcredit) { lnet_return_tx_credits_locked()
972 struct lnet_tx_queue *tq = ni->ni_tx_queues[msg->msg_tx_cpt]; lnet_return_tx_credits_locked()
975 msg->msg_txcredit = 0; lnet_return_tx_credits_locked()
993 if (msg->msg_peertxcredit) { lnet_return_tx_credits_locked()
995 msg->msg_peertxcredit = 0; lnet_return_tx_credits_locked()
1000 txpeer->lp_txqnob -= msg->msg_len + sizeof(lnet_hdr_t); lnet_return_tx_credits_locked()
1017 msg->msg_txpeer = NULL; lnet_return_tx_credits_locked()
1023 lnet_return_rx_credits_locked(lnet_msg_t *msg) lnet_return_rx_credits_locked() argument
1025 lnet_peer_t *rxpeer = msg->msg_rxpeer; lnet_return_rx_credits_locked()
1028 if (msg->msg_rtrcredit) { lnet_return_rx_credits_locked()
1033 /* NB If a msg ever blocks for a buffer in rbp_msgs, it stays lnet_return_rx_credits_locked()
1036 LASSERT(msg->msg_kiov != NULL); lnet_return_rx_credits_locked()
1038 rb = list_entry(msg->msg_kiov, lnet_rtrbuf_t, rb_kiov[0]); lnet_return_rx_credits_locked()
1040 LASSERT(rbp == lnet_msg2bufpool(msg)); lnet_return_rx_credits_locked()
1042 msg->msg_kiov = NULL; lnet_return_rx_credits_locked()
1043 msg->msg_rtrcredit = 0; lnet_return_rx_credits_locked()
1061 if (msg->msg_peerrtrcredit) { lnet_return_rx_credits_locked()
1063 msg->msg_peerrtrcredit = 0; lnet_return_rx_credits_locked()
1078 msg->msg_rxpeer = NULL; lnet_return_rx_credits_locked()
1180 lnet_send(lnet_nid_t src_nid, lnet_msg_t *msg, lnet_nid_t rtr_nid) lnet_send() argument
1182 lnet_nid_t dst_nid = msg->msg_target.nid; lnet_send()
1194 LASSERT(msg->msg_txpeer == NULL); lnet_send()
1195 LASSERT(!msg->msg_sending); lnet_send()
1196 LASSERT(!msg->msg_target_is_router); lnet_send()
1197 LASSERT(!msg->msg_receiving); lnet_send()
1199 msg->msg_sending = 1; lnet_send()
1201 LASSERT(!msg->msg_tx_committed); lnet_send()
1222 LASSERT(!msg->msg_routing); lnet_send()
1245 lnet_msg_commit(msg, cpt); lnet_send()
1247 if (!msg->msg_routing) lnet_send()
1248 msg->msg_hdr.src_nid = cpu_to_le64(src_nid); lnet_send()
1253 lnet_ni_send(src_ni, msg); lnet_send()
1281 libcfs_id2str(msg->msg_target), lnet_send()
1305 lnet_msgtyp2str(msg->msg_type), msg->msg_len); lnet_send()
1318 lnet_msg_commit(msg, cpt); lnet_send()
1320 if (!msg->msg_routing) { lnet_send()
1322 msg->msg_hdr.src_nid = cpu_to_le64(src_nid); lnet_send()
1325 msg->msg_target_is_router = 1; lnet_send()
1326 msg->msg_target.nid = lp->lp_nid; lnet_send()
1327 msg->msg_target.pid = LUSTRE_SRV_LNET_PID; lnet_send()
1332 LASSERT(!msg->msg_peertxcredit); lnet_send()
1333 LASSERT(!msg->msg_txcredit); lnet_send()
1334 LASSERT(msg->msg_txpeer == NULL); lnet_send()
1336 msg->msg_txpeer = lp; /* msg takes my ref on lp */ lnet_send()
1338 rc = lnet_post_send_locked(msg, 0); lnet_send()
1345 lnet_ni_send(src_ni, msg); lnet_send()
1362 lnet_recv_put(lnet_ni_t *ni, lnet_msg_t *msg) lnet_recv_put() argument
1364 lnet_hdr_t *hdr = &msg->msg_hdr; lnet_recv_put()
1366 if (msg->msg_wanted != 0) lnet_recv_put()
1367 lnet_setpayloadbuffer(msg); lnet_recv_put()
1369 lnet_build_msg_event(msg, LNET_EVENT_PUT); lnet_recv_put()
1373 msg->msg_ack = (!lnet_is_wire_handle_none(&hdr->msg.put.ack_wmd) && lnet_recv_put()
1374 (msg->msg_md->md_options & LNET_MD_ACK_DISABLE) == 0); lnet_recv_put()
1376 lnet_ni_recv(ni, msg->msg_private, msg, msg->msg_rx_delayed, lnet_recv_put()
1377 msg->msg_offset, msg->msg_wanted, hdr->payload_length); lnet_recv_put()
1381 lnet_parse_put(lnet_ni_t *ni, lnet_msg_t *msg) lnet_parse_put() argument
1383 lnet_hdr_t *hdr = &msg->msg_hdr; lnet_parse_put()
1388 hdr->msg.put.match_bits = le64_to_cpu(hdr->msg.put.match_bits); lnet_parse_put()
1389 hdr->msg.put.ptl_index = le32_to_cpu(hdr->msg.put.ptl_index); lnet_parse_put()
1390 hdr->msg.put.offset = le32_to_cpu(hdr->msg.put.offset); lnet_parse_put()
1395 info.mi_portal = hdr->msg.put.ptl_index; lnet_parse_put()
1397 info.mi_roffset = hdr->msg.put.offset; lnet_parse_put()
1398 info.mi_mbits = hdr->msg.put.match_bits; lnet_parse_put()
1400 msg->msg_rx_ready_delay = ni->ni_lnd->lnd_eager_recv == NULL; lnet_parse_put()
1403 rc = lnet_ptl_match_md(&info, msg); lnet_parse_put()
1409 lnet_recv_put(ni, msg); lnet_parse_put()
1413 if (msg->msg_rx_delayed) /* attached on delayed list */ lnet_parse_put()
1416 rc = lnet_ni_eager_recv(ni, msg); lnet_parse_put()
1431 lnet_parse_get(lnet_ni_t *ni, lnet_msg_t *msg, int rdma_get) lnet_parse_get() argument
1434 lnet_hdr_t *hdr = &msg->msg_hdr; lnet_parse_get()
1439 hdr->msg.get.match_bits = le64_to_cpu(hdr->msg.get.match_bits); lnet_parse_get()
1440 hdr->msg.get.ptl_index = le32_to_cpu(hdr->msg.get.ptl_index); lnet_parse_get()
1441 hdr->msg.get.sink_length = le32_to_cpu(hdr->msg.get.sink_length); lnet_parse_get()
1442 hdr->msg.get.src_offset = le32_to_cpu(hdr->msg.get.src_offset); lnet_parse_get()
1447 info.mi_portal = hdr->msg.get.ptl_index; lnet_parse_get()
1448 info.mi_rlength = hdr->msg.get.sink_length; lnet_parse_get()
1449 info.mi_roffset = hdr->msg.get.src_offset; lnet_parse_get()
1450 info.mi_mbits = hdr->msg.get.match_bits; lnet_parse_get()
1452 rc = lnet_ptl_match_md(&info, msg); lnet_parse_get()
1462 lnet_build_msg_event(msg, LNET_EVENT_GET); lnet_parse_get()
1464 reply_wmd = hdr->msg.get.return_wmd; lnet_parse_get()
1466 lnet_prep_send(msg, LNET_MSG_REPLY, info.mi_id, lnet_parse_get()
1467 msg->msg_offset, msg->msg_wanted); lnet_parse_get()
1469 msg->msg_hdr.msg.reply.dst_wmd = reply_wmd; lnet_parse_get()
1473 lnet_ni_recv(ni, msg->msg_private, msg, 0, lnet_parse_get()
1474 msg->msg_offset, msg->msg_len, msg->msg_len); lnet_parse_get()
1478 lnet_ni_recv(ni, msg->msg_private, NULL, 0, 0, 0, 0); lnet_parse_get()
1479 msg->msg_receiving = 0; lnet_parse_get()
1481 rc = lnet_send(ni->ni_nid, msg, LNET_NID_ANY); lnet_parse_get()
1488 lnet_finalize(ni, msg, rc); lnet_parse_get()
1495 lnet_parse_reply(lnet_ni_t *ni, lnet_msg_t *msg) lnet_parse_reply() argument
1497 void *private = msg->msg_private; lnet_parse_reply()
1498 lnet_hdr_t *hdr = &msg->msg_hdr; lnet_parse_reply()
1505 cpt = lnet_cpt_of_cookie(hdr->msg.reply.dst_wmd.wh_object_cookie); lnet_parse_reply()
1512 md = lnet_wire_handle2md(&hdr->msg.reply.dst_wmd); lnet_parse_reply()
1517 hdr->msg.reply.dst_wmd.wh_interface_cookie, lnet_parse_reply()
1518 hdr->msg.reply.dst_wmd.wh_object_cookie); lnet_parse_reply()
1536 rlength, hdr->msg.reply.dst_wmd.wh_object_cookie, lnet_parse_reply()
1544 mlength, rlength, hdr->msg.reply.dst_wmd.wh_object_cookie); lnet_parse_reply()
1546 lnet_msg_attach_md(msg, md, 0, mlength); lnet_parse_reply()
1549 lnet_setpayloadbuffer(msg); lnet_parse_reply()
1553 lnet_build_msg_event(msg, LNET_EVENT_REPLY); lnet_parse_reply()
1555 lnet_ni_recv(ni, private, msg, 0, 0, mlength, rlength); lnet_parse_reply()
1560 lnet_parse_ack(lnet_ni_t *ni, lnet_msg_t *msg) lnet_parse_ack() argument
1562 lnet_hdr_t *hdr = &msg->msg_hdr; lnet_parse_ack()
1571 hdr->msg.ack.match_bits = le64_to_cpu(hdr->msg.ack.match_bits); lnet_parse_ack()
1572 hdr->msg.ack.mlength = le32_to_cpu(hdr->msg.ack.mlength); lnet_parse_ack()
1574 cpt = lnet_cpt_of_cookie(hdr->msg.ack.dst_wmd.wh_object_cookie); lnet_parse_ack()
1578 md = lnet_wire_handle2md(&hdr->msg.ack.dst_wmd); lnet_parse_ack()
1585 hdr->msg.ack.dst_wmd.wh_interface_cookie, lnet_parse_ack()
1586 hdr->msg.ack.dst_wmd.wh_object_cookie); lnet_parse_ack()
1597 hdr->msg.ack.dst_wmd.wh_object_cookie); lnet_parse_ack()
1599 lnet_msg_attach_md(msg, md, 0, 0); lnet_parse_ack()
1603 lnet_build_msg_event(msg, LNET_EVENT_ACK); lnet_parse_ack()
1605 lnet_ni_recv(ni, msg->msg_private, msg, 0, 0, 0, msg->msg_len); lnet_parse_ack()
1610 lnet_parse_forward_locked(lnet_ni_t *ni, lnet_msg_t *msg) lnet_parse_forward_locked() argument
1614 if (msg->msg_rxpeer->lp_rtrcredits <= 0 || lnet_parse_forward_locked()
1615 lnet_msg2bufpool(msg)->rbp_credits <= 0) { lnet_parse_forward_locked()
1617 msg->msg_rx_ready_delay = 1; lnet_parse_forward_locked()
1619 lnet_net_unlock(msg->msg_rx_cpt); lnet_parse_forward_locked()
1620 rc = lnet_ni_eager_recv(ni, msg); lnet_parse_forward_locked()
1621 lnet_net_lock(msg->msg_rx_cpt); lnet_parse_forward_locked()
1626 rc = lnet_post_routed_recv_locked(msg, 0); lnet_parse_forward_locked()
1673 hdr->msg.put.ptl_index, lnet_print_hdr()
1674 hdr->msg.put.ack_wmd.wh_interface_cookie, lnet_print_hdr()
1675 hdr->msg.put.ack_wmd.wh_object_cookie, lnet_print_hdr()
1676 hdr->msg.put.match_bits); lnet_print_hdr()
1678 hdr->payload_length, hdr->msg.put.offset, lnet_print_hdr()
1679 hdr->msg.put.hdr_data); lnet_print_hdr()
1684 hdr->msg.get.ptl_index, lnet_print_hdr()
1685 hdr->msg.get.return_wmd.wh_interface_cookie, lnet_print_hdr()
1686 hdr->msg.get.return_wmd.wh_object_cookie, lnet_print_hdr()
1687 hdr->msg.get.match_bits); lnet_print_hdr()
1689 hdr->msg.get.sink_length, lnet_print_hdr()
1690 hdr->msg.get.src_offset); lnet_print_hdr()
1695 hdr->msg.ack.dst_wmd.wh_interface_cookie, lnet_print_hdr()
1696 hdr->msg.ack.dst_wmd.wh_object_cookie, lnet_print_hdr()
1697 hdr->msg.ack.mlength); lnet_print_hdr()
1702 hdr->msg.reply.dst_wmd.wh_interface_cookie, lnet_print_hdr()
1703 hdr->msg.reply.dst_wmd.wh_object_cookie, lnet_print_hdr()
1716 struct lnet_msg *msg; lnet_parse() local
1831 msg = lnet_msg_alloc(); lnet_parse()
1832 if (msg == NULL) { lnet_parse()
1839 /* msg zeroed in lnet_msg_alloc; lnet_parse()
1843 msg->msg_type = type; lnet_parse()
1844 msg->msg_private = private; lnet_parse()
1845 msg->msg_receiving = 1; lnet_parse()
1846 msg->msg_len = msg->msg_wanted = payload_length; lnet_parse()
1847 msg->msg_offset = 0; lnet_parse()
1848 msg->msg_hdr = *hdr; lnet_parse()
1850 msg->msg_from = from_nid; lnet_parse()
1852 msg->msg_target.pid = dest_pid; lnet_parse()
1853 msg->msg_target.nid = dest_nid; lnet_parse()
1854 msg->msg_routing = 1; lnet_parse()
1857 /* convert common msg->hdr fields to host byteorder */ lnet_parse()
1858 msg->msg_hdr.type = type; lnet_parse()
1859 msg->msg_hdr.src_nid = src_nid; lnet_parse()
1860 msg->msg_hdr.src_pid = le32_to_cpu(msg->msg_hdr.src_pid); lnet_parse()
1861 msg->msg_hdr.dest_nid = dest_nid; lnet_parse()
1862 msg->msg_hdr.dest_pid = dest_pid; lnet_parse()
1863 msg->msg_hdr.payload_length = payload_length; lnet_parse()
1867 rc = lnet_nid2peer_locked(&msg->msg_rxpeer, from_nid, cpt); lnet_parse()
1873 lnet_msg_free(msg); lnet_parse()
1877 if (lnet_isrouter(msg->msg_rxpeer)) { lnet_parse()
1878 lnet_peer_set_alive(msg->msg_rxpeer); lnet_parse()
1885 lnet_router_ni_update_locked(msg->msg_rxpeer, lnet_parse()
1890 lnet_msg_commit(msg, cpt); lnet_parse()
1893 rc = lnet_parse_forward_locked(ni, msg); lnet_parse()
1899 lnet_ni_recv(ni, msg->msg_private, msg, 0, lnet_parse()
1909 rc = lnet_parse_ack(ni, msg); lnet_parse()
1912 rc = lnet_parse_put(ni, msg); lnet_parse()
1915 rc = lnet_parse_get(ni, msg, rdma_req); lnet_parse()
1918 rc = lnet_parse_reply(ni, msg); lnet_parse()
1932 LASSERT(msg->msg_md == NULL); lnet_parse()
1933 lnet_finalize(ni, msg, rc); lnet_parse()
1946 lnet_msg_t *msg; lnet_drop_delayed_msg_list() local
1948 msg = list_entry(head->next, lnet_msg_t, msg_list); lnet_drop_delayed_msg_list()
1949 list_del(&msg->msg_list); lnet_drop_delayed_msg_list()
1951 id.nid = msg->msg_hdr.src_nid; lnet_drop_delayed_msg_list()
1952 id.pid = msg->msg_hdr.src_pid; lnet_drop_delayed_msg_list()
1954 LASSERT(msg->msg_md == NULL); lnet_drop_delayed_msg_list()
1955 LASSERT(msg->msg_rx_delayed); lnet_drop_delayed_msg_list()
1956 LASSERT(msg->msg_rxpeer != NULL); lnet_drop_delayed_msg_list()
1957 LASSERT(msg->msg_hdr.type == LNET_MSG_PUT); lnet_drop_delayed_msg_list()
1961 msg->msg_hdr.msg.put.ptl_index, lnet_drop_delayed_msg_list()
1962 msg->msg_hdr.msg.put.match_bits, lnet_drop_delayed_msg_list()
1963 msg->msg_hdr.msg.put.offset, lnet_drop_delayed_msg_list()
1964 msg->msg_hdr.payload_length, reason); lnet_drop_delayed_msg_list()
1966 /* NB I can't drop msg's ref on msg_rxpeer until after I've lnet_drop_delayed_msg_list()
1967 * called lnet_drop_message(), so I just hang onto msg as well lnet_drop_delayed_msg_list()
1970 lnet_drop_message(msg->msg_rxpeer->lp_ni, lnet_drop_delayed_msg_list()
1971 msg->msg_rxpeer->lp_cpt, lnet_drop_delayed_msg_list()
1972 msg->msg_private, msg->msg_len); lnet_drop_delayed_msg_list()
1978 lnet_finalize(msg->msg_rxpeer->lp_ni, msg, -ENOENT); lnet_drop_delayed_msg_list()
1986 lnet_msg_t *msg; lnet_recv_delayed_msg_list() local
1989 msg = list_entry(head->next, lnet_msg_t, msg_list); lnet_recv_delayed_msg_list()
1990 list_del(&msg->msg_list); lnet_recv_delayed_msg_list()
1992 /* md won't disappear under me, since each msg lnet_recv_delayed_msg_list()
1995 id.nid = msg->msg_hdr.src_nid; lnet_recv_delayed_msg_list()
1996 id.pid = msg->msg_hdr.src_pid; lnet_recv_delayed_msg_list()
1998 LASSERT(msg->msg_rx_delayed); lnet_recv_delayed_msg_list()
1999 LASSERT(msg->msg_md != NULL); lnet_recv_delayed_msg_list()
2000 LASSERT(msg->msg_rxpeer != NULL); lnet_recv_delayed_msg_list()
2001 LASSERT(msg->msg_hdr.type == LNET_MSG_PUT); lnet_recv_delayed_msg_list()
2004 libcfs_id2str(id), msg->msg_hdr.msg.put.ptl_index, lnet_recv_delayed_msg_list()
2005 msg->msg_hdr.msg.put.match_bits, lnet_recv_delayed_msg_list()
2006 msg->msg_hdr.msg.put.offset, lnet_recv_delayed_msg_list()
2007 msg->msg_hdr.payload_length); lnet_recv_delayed_msg_list()
2009 lnet_recv_put(msg->msg_rxpeer->lp_ni, msg); lnet_recv_delayed_msg_list()
2063 struct lnet_msg *msg; LNetPut() local
2078 msg = lnet_msg_alloc(); LNetPut()
2079 if (msg == NULL) { LNetPut()
2084 msg->msg_vmflush = !!memory_pressure_get(); LNetPut()
2099 lnet_msg_free(msg); LNetPut()
2105 lnet_msg_attach_md(msg, md, 0, 0); LNetPut()
2107 lnet_prep_send(msg, LNET_MSG_PUT, target, 0, md->md_length); LNetPut()
2109 msg->msg_hdr.msg.put.match_bits = cpu_to_le64(match_bits); LNetPut()
2110 msg->msg_hdr.msg.put.ptl_index = cpu_to_le32(portal); LNetPut()
2111 msg->msg_hdr.msg.put.offset = cpu_to_le32(offset); LNetPut()
2112 msg->msg_hdr.msg.put.hdr_data = hdr_data; LNetPut()
2116 msg->msg_hdr.msg.put.ack_wmd.wh_interface_cookie = LNetPut()
2118 msg->msg_hdr.msg.put.ack_wmd.wh_object_cookie = LNetPut()
2121 msg->msg_hdr.msg.put.ack_wmd.wh_interface_cookie = LNetPut()
2123 msg->msg_hdr.msg.put.ack_wmd.wh_object_cookie = LNetPut()
2129 lnet_build_msg_event(msg, LNET_EVENT_SEND); LNetPut()
2131 rc = lnet_send(self, msg, LNET_NID_ANY); LNetPut()
2135 lnet_finalize(NULL, msg, rc); LNetPut()
2146 /* The LND can DMA direct to the GET md (i.e. no REPLY msg). This lnet_create_reply_msg()
2147 * returns a msg for the LND to pass to lnet_finalize() when the sink lnet_create_reply_msg()
2153 struct lnet_msg *msg = lnet_msg_alloc(); lnet_create_reply_msg() local
2166 if (msg == NULL) { lnet_create_reply_msg()
2167 CERROR("%s: Dropping REPLY from %s: can't allocate msg\n", lnet_create_reply_msg()
2186 msg->msg_from = peer_id.nid; lnet_create_reply_msg()
2187 msg->msg_type = LNET_MSG_GET; /* flag this msg as an "optimized" GET */ lnet_create_reply_msg()
2188 msg->msg_hdr.src_nid = peer_id.nid; lnet_create_reply_msg()
2189 msg->msg_hdr.payload_length = getmd->md_length; lnet_create_reply_msg()
2190 msg->msg_receiving = 1; /* required by lnet_msg_attach_md */ lnet_create_reply_msg()
2192 lnet_msg_attach_md(msg, getmd, getmd->md_offset, getmd->md_length); lnet_create_reply_msg()
2198 lnet_msg_commit(msg, cpt); lnet_create_reply_msg()
2201 lnet_build_msg_event(msg, LNET_EVENT_REPLY); lnet_create_reply_msg()
2203 return msg; lnet_create_reply_msg()
2213 if (msg != NULL) lnet_create_reply_msg()
2214 lnet_msg_free(msg); lnet_create_reply_msg()
2263 struct lnet_msg *msg; LNetGet() local
2278 msg = lnet_msg_alloc(); LNetGet()
2279 if (msg == NULL) { LNetGet()
2299 lnet_msg_free(msg); LNetGet()
2305 lnet_msg_attach_md(msg, md, 0, 0); LNetGet()
2307 lnet_prep_send(msg, LNET_MSG_GET, target, 0, 0); LNetGet()
2309 msg->msg_hdr.msg.get.match_bits = cpu_to_le64(match_bits); LNetGet()
2310 msg->msg_hdr.msg.get.ptl_index = cpu_to_le32(portal); LNetGet()
2311 msg->msg_hdr.msg.get.src_offset = cpu_to_le32(offset); LNetGet()
2312 msg->msg_hdr.msg.get.sink_length = cpu_to_le32(md->md_length); LNetGet()
2315 msg->msg_hdr.msg.get.return_wmd.wh_interface_cookie = LNetGet()
2317 msg->msg_hdr.msg.get.return_wmd.wh_object_cookie = LNetGet()
2322 lnet_build_msg_event(msg, LNET_EVENT_SEND); LNetGet()
2324 rc = lnet_send(self, msg, LNET_NID_ANY); LNetGet()
2328 lnet_finalize(NULL, msg, rc); LNetGet()
H A DMakefile4 lib-me.o lib-msg.o lib-eq.o lib-md.o lib-ptl.o \
/linux-4.4.14/arch/score/include/asm/
H A Dbug.h12 #define die(msg, regs) \
13 __die(msg, regs, __FILE__ ":", __func__, __LINE__)
14 #define die_if_kernel(msg, regs) \
15 __die_if_kernel(msg, regs, __FILE__ ":", __func__, __LINE__)
/linux-4.4.14/drivers/platform/chrome/
H A Dcros_ec_proto.c26 struct cros_ec_command *msg) prepare_packet()
34 BUG_ON(msg->outsize + sizeof(*request) > ec_dev->dout_size); prepare_packet()
40 request->command = msg->command; prepare_packet()
41 request->command_version = msg->version; prepare_packet()
43 request->data_len = msg->outsize; prepare_packet()
49 memcpy(out + sizeof(*request), msg->data, msg->outsize); prepare_packet()
50 for (i = 0; i < msg->outsize; i++) prepare_packet()
51 csum += msg->data[i]; prepare_packet()
55 return sizeof(*request) + msg->outsize; prepare_packet()
59 struct cros_ec_command *msg) send_command()
64 ret = ec_dev->pkt_xfer(ec_dev, msg); send_command()
66 ret = ec_dev->cmd_xfer(ec_dev, msg); send_command()
68 if (msg->result == EC_RES_IN_PROGRESS) { send_command()
94 msg->result = status_msg->result; send_command()
111 struct cros_ec_command *msg) cros_ec_prepare_tx()
118 return prepare_packet(ec_dev, msg); cros_ec_prepare_tx()
120 BUG_ON(msg->outsize > EC_PROTO2_MAX_PARAM_SIZE); cros_ec_prepare_tx()
122 out[0] = EC_CMD_VERSION0 + msg->version; cros_ec_prepare_tx()
123 out[1] = msg->command; cros_ec_prepare_tx()
124 out[2] = msg->outsize; cros_ec_prepare_tx()
126 for (i = 0; i < msg->outsize; i++) cros_ec_prepare_tx()
127 csum += out[EC_MSG_TX_HEADER_BYTES + i] = msg->data[i]; cros_ec_prepare_tx()
128 out[EC_MSG_TX_HEADER_BYTES + msg->outsize] = csum; cros_ec_prepare_tx()
130 return EC_MSG_TX_PROTO_BYTES + msg->outsize; cros_ec_prepare_tx()
135 struct cros_ec_command *msg) cros_ec_check_result()
137 switch (msg->result) { cros_ec_check_result()
142 msg->command); cros_ec_check_result()
146 msg->command, msg->result); cros_ec_check_result()
154 struct cros_ec_command *msg) cros_ec_host_command_proto_query()
167 memset(msg, 0, sizeof(*msg)); cros_ec_host_command_proto_query()
168 msg->command = EC_CMD_PASSTHRU_OFFSET(devidx) | EC_CMD_GET_PROTOCOL_INFO; cros_ec_host_command_proto_query()
169 msg->insize = sizeof(struct ec_response_get_protocol_info); cros_ec_host_command_proto_query()
171 ret = send_command(ec_dev, msg); cros_ec_host_command_proto_query()
180 if (devidx > 0 && msg->result == EC_RES_INVALID_COMMAND) cros_ec_host_command_proto_query()
182 else if (msg->result != EC_RES_SUCCESS) cros_ec_host_command_proto_query()
183 return msg->result; cros_ec_host_command_proto_query()
190 struct cros_ec_command *msg; cros_ec_host_command_proto_query_v2() local
196 msg = kmalloc(sizeof(*msg) + len, GFP_KERNEL); cros_ec_host_command_proto_query_v2()
197 if (!msg) cros_ec_host_command_proto_query_v2()
200 msg->version = 0; cros_ec_host_command_proto_query_v2()
201 msg->command = EC_CMD_HELLO; cros_ec_host_command_proto_query_v2()
202 hello_params = (struct ec_params_hello *)msg->data; cros_ec_host_command_proto_query_v2()
203 msg->outsize = sizeof(*hello_params); cros_ec_host_command_proto_query_v2()
204 hello_response = (struct ec_response_hello *)msg->data; cros_ec_host_command_proto_query_v2()
205 msg->insize = sizeof(*hello_response); cros_ec_host_command_proto_query_v2()
209 ret = send_command(ec_dev, msg); cros_ec_host_command_proto_query_v2()
216 } else if (msg->result != EC_RES_SUCCESS) { cros_ec_host_command_proto_query_v2()
219 msg->result); cros_ec_host_command_proto_query_v2()
220 ret = msg->result; cros_ec_host_command_proto_query_v2()
233 kfree(msg); cros_ec_host_command_proto_query_v2()
338 struct cros_ec_command *msg) cros_ec_cmd_xfer()
353 if (msg->insize > ec_dev->max_response) { cros_ec_cmd_xfer()
355 msg->insize = ec_dev->max_response; cros_ec_cmd_xfer()
358 if (msg->command < EC_CMD_PASSTHRU_OFFSET(1)) { cros_ec_cmd_xfer()
359 if (msg->outsize > ec_dev->max_request) { cros_ec_cmd_xfer()
362 msg->outsize, cros_ec_cmd_xfer()
368 if (msg->outsize > ec_dev->max_passthru) { cros_ec_cmd_xfer()
371 msg->outsize, cros_ec_cmd_xfer()
377 ret = send_command(ec_dev, msg); cros_ec_cmd_xfer()
25 prepare_packet(struct cros_ec_device *ec_dev, struct cros_ec_command *msg) prepare_packet() argument
58 send_command(struct cros_ec_device *ec_dev, struct cros_ec_command *msg) send_command() argument
110 cros_ec_prepare_tx(struct cros_ec_device *ec_dev, struct cros_ec_command *msg) cros_ec_prepare_tx() argument
134 cros_ec_check_result(struct cros_ec_device *ec_dev, struct cros_ec_command *msg) cros_ec_check_result() argument
152 cros_ec_host_command_proto_query(struct cros_ec_device *ec_dev, int devidx, struct cros_ec_command *msg) cros_ec_host_command_proto_query() argument
337 cros_ec_cmd_xfer(struct cros_ec_device *ec_dev, struct cros_ec_command *msg) cros_ec_cmd_xfer() argument
H A Dcros_ec_sysfs.c70 struct cros_ec_command *msg; store_ec_reboot() local
78 msg = kmalloc(sizeof(*msg) + sizeof(*param), GFP_KERNEL); store_ec_reboot()
79 if (!msg) store_ec_reboot()
82 param = (struct ec_params_reboot_ec *)msg->data; store_ec_reboot()
115 msg->version = 0; store_ec_reboot()
116 msg->command = EC_CMD_REBOOT_EC + ec->cmd_offset; store_ec_reboot()
117 msg->outsize = sizeof(*param); store_ec_reboot()
118 msg->insize = 0; store_ec_reboot()
119 ret = cros_ec_cmd_xfer(ec->ec_dev, msg); store_ec_reboot()
124 if (msg->result != EC_RES_SUCCESS) { store_ec_reboot()
125 dev_dbg(ec->dev, "EC result %d\n", msg->result); store_ec_reboot()
129 kfree(msg); store_ec_reboot()
140 struct cros_ec_command *msg; show_ec_version() local
146 msg = kmalloc(sizeof(*msg) + EC_HOST_PARAM_SIZE, GFP_KERNEL); show_ec_version()
147 if (!msg) show_ec_version()
151 msg->version = 0; show_ec_version()
152 msg->command = EC_CMD_GET_VERSION + ec->cmd_offset; show_ec_version()
153 msg->insize = sizeof(*r_ver); show_ec_version()
154 msg->outsize = 0; show_ec_version()
155 ret = cros_ec_cmd_xfer(ec->ec_dev, msg); show_ec_version()
160 if (msg->result != EC_RES_SUCCESS) { show_ec_version()
162 "ERROR: EC returned %d\n", msg->result); show_ec_version()
166 r_ver = (struct ec_response_get_version *)msg->data; show_ec_version()
180 msg->command = EC_CMD_GET_BUILD_INFO + ec->cmd_offset; show_ec_version()
181 msg->insize = EC_HOST_PARAM_SIZE; show_ec_version()
182 ret = cros_ec_cmd_xfer(ec->ec_dev, msg); show_ec_version()
186 else if (msg->result != EC_RES_SUCCESS) show_ec_version()
188 "Build info: EC error %d\n", msg->result); show_ec_version()
190 msg->data[sizeof(msg->data) - 1] = '\0'; show_ec_version()
192 "Build info: %s\n", msg->data); show_ec_version()
196 msg->command = EC_CMD_GET_CHIP_INFO + ec->cmd_offset; show_ec_version()
197 msg->insize = sizeof(*r_chip); show_ec_version()
198 ret = cros_ec_cmd_xfer(ec->ec_dev, msg); show_ec_version()
202 else if (msg->result != EC_RES_SUCCESS) show_ec_version()
204 "Chip info: EC error %d\n", msg->result); show_ec_version()
206 r_chip = (struct ec_response_get_chip_info *)msg->data; show_ec_version()
220 msg->command = EC_CMD_GET_BOARD_VERSION + ec->cmd_offset; show_ec_version()
221 msg->insize = sizeof(*r_board); show_ec_version()
222 ret = cros_ec_cmd_xfer(ec->ec_dev, msg); show_ec_version()
226 else if (msg->result != EC_RES_SUCCESS) show_ec_version()
228 "Board version: EC error %d\n", msg->result); show_ec_version()
230 r_board = (struct ec_response_board_version *)msg->data; show_ec_version()
238 kfree(msg); show_ec_version()
246 struct cros_ec_command *msg; show_ec_flashinfo() local
251 msg = kmalloc(sizeof(*msg) + sizeof(*resp), GFP_KERNEL); show_ec_flashinfo()
252 if (!msg) show_ec_flashinfo()
256 msg->version = 0; show_ec_flashinfo()
257 msg->command = EC_CMD_FLASH_INFO + ec->cmd_offset; show_ec_flashinfo()
258 msg->insize = sizeof(*resp); show_ec_flashinfo()
259 msg->outsize = 0; show_ec_flashinfo()
260 ret = cros_ec_cmd_xfer(ec->ec_dev, msg); show_ec_flashinfo()
263 if (msg->result != EC_RES_SUCCESS) { show_ec_flashinfo()
265 "ERROR: EC returned %d\n", msg->result); show_ec_flashinfo()
269 resp = (struct ec_response_flash_info *)msg->data; show_ec_flashinfo()
277 kfree(msg); show_ec_flashinfo()
H A Dcros_ec_vbc.c36 struct cros_ec_command *msg; vboot_context_read() local
42 msg = kmalloc(sizeof(*msg) + payload, GFP_KERNEL); vboot_context_read()
43 if (!msg) vboot_context_read()
47 params = (struct ec_params_vbnvcontext *)msg->data; vboot_context_read()
50 msg->version = EC_VER_VBNV_CONTEXT; vboot_context_read()
51 msg->command = EC_CMD_VBNV_CONTEXT; vboot_context_read()
52 msg->outsize = para_sz; vboot_context_read()
53 msg->insize = resp_sz; vboot_context_read()
55 err = cros_ec_cmd_xfer(ecdev, msg); vboot_context_read()
58 kfree(msg); vboot_context_read()
62 memcpy(buf, msg->data, resp_sz); vboot_context_read()
64 kfree(msg); vboot_context_read()
77 struct cros_ec_command *msg; vboot_context_write() local
86 msg = kmalloc(sizeof(*msg) + para_sz, GFP_KERNEL); vboot_context_write()
87 if (!msg) vboot_context_write()
90 params = (struct ec_params_vbnvcontext *)msg->data; vboot_context_write()
94 msg->version = EC_VER_VBNV_CONTEXT; vboot_context_write()
95 msg->command = EC_CMD_VBNV_CONTEXT; vboot_context_write()
96 msg->outsize = para_sz; vboot_context_write()
97 msg->insize = 0; vboot_context_write()
99 err = cros_ec_cmd_xfer(ecdev, msg); vboot_context_write()
102 kfree(msg); vboot_context_write()
106 kfree(msg); vboot_context_write()
H A Dcros_ec_lightbar.c97 struct cros_ec_command *msg; alloc_lightbar_cmd_msg() local
103 msg = kmalloc(sizeof(*msg) + len, GFP_KERNEL); alloc_lightbar_cmd_msg()
104 if (!msg) alloc_lightbar_cmd_msg()
107 msg->version = 0; alloc_lightbar_cmd_msg()
108 msg->command = EC_CMD_LIGHTBAR_CMD + ec->cmd_offset; alloc_lightbar_cmd_msg()
109 msg->outsize = sizeof(struct ec_params_lightbar); alloc_lightbar_cmd_msg()
110 msg->insize = sizeof(struct ec_response_lightbar); alloc_lightbar_cmd_msg()
112 return msg; alloc_lightbar_cmd_msg()
120 struct cros_ec_command *msg; get_lightbar_version() local
123 msg = alloc_lightbar_cmd_msg(ec); get_lightbar_version()
124 if (!msg) get_lightbar_version()
127 param = (struct ec_params_lightbar *)msg->data; get_lightbar_version()
129 ret = cros_ec_cmd_xfer(ec->ec_dev, msg); get_lightbar_version()
135 switch (msg->result) { get_lightbar_version()
146 resp = (struct ec_response_lightbar *)msg->data; get_lightbar_version()
160 kfree(msg); get_lightbar_version()
188 struct cros_ec_command *msg; brightness_store() local
197 msg = alloc_lightbar_cmd_msg(ec); brightness_store()
198 if (!msg) brightness_store()
201 param = (struct ec_params_lightbar *)msg->data; brightness_store()
208 ret = cros_ec_cmd_xfer(ec->ec_dev, msg); brightness_store()
212 if (msg->result != EC_RES_SUCCESS) { brightness_store()
219 kfree(msg); brightness_store()
235 struct cros_ec_command *msg; led_rgb_store() local
241 msg = alloc_lightbar_cmd_msg(ec); led_rgb_store()
242 if (!msg) led_rgb_store()
258 param = (struct ec_params_lightbar *)msg->data; led_rgb_store()
274 ret = cros_ec_cmd_xfer(ec->ec_dev, msg); led_rgb_store()
278 if (msg->result != EC_RES_SUCCESS) led_rgb_store()
292 kfree(msg); led_rgb_store()
306 struct cros_ec_command *msg; sequence_show() local
311 msg = alloc_lightbar_cmd_msg(ec); sequence_show()
312 if (!msg) sequence_show()
315 param = (struct ec_params_lightbar *)msg->data; sequence_show()
321 ret = cros_ec_cmd_xfer(ec->ec_dev, msg); sequence_show()
325 if (msg->result != EC_RES_SUCCESS) { sequence_show()
327 "ERROR: EC returned %d\n", msg->result); sequence_show()
331 resp = (struct ec_response_lightbar *)msg->data; sequence_show()
339 kfree(msg); sequence_show()
347 struct cros_ec_command *msg; sequence_store() local
367 msg = alloc_lightbar_cmd_msg(ec); sequence_store()
368 if (!msg) sequence_store()
371 param = (struct ec_params_lightbar *)msg->data; sequence_store()
378 ret = cros_ec_cmd_xfer(ec->ec_dev, msg); sequence_store()
382 if (msg->result != EC_RES_SUCCESS) { sequence_store()
389 kfree(msg); sequence_store()
H A Dcros_ec_lpc.c50 struct cros_ec_command *msg) cros_ec_pkt_xfer_lpc()
59 ret = cros_ec_prepare_tx(ec, msg); cros_ec_pkt_xfer_lpc()
77 msg->result = inb(EC_LPC_ADDR_HOST_DATA); cros_ec_pkt_xfer_lpc()
78 ret = cros_ec_check_result(ec, msg); cros_ec_pkt_xfer_lpc()
89 msg->result = response.result; cros_ec_pkt_xfer_lpc()
91 if (response.data_len > msg->insize) { cros_ec_pkt_xfer_lpc()
94 response.data_len, msg->insize); cros_ec_pkt_xfer_lpc()
101 msg->data[i] = cros_ec_pkt_xfer_lpc()
103 sum += msg->data[i]; cros_ec_pkt_xfer_lpc()
121 struct cros_ec_command *msg) cros_ec_cmd_xfer_lpc()
128 if (msg->outsize > EC_PROTO2_MAX_PARAM_SIZE || cros_ec_cmd_xfer_lpc()
129 msg->insize > EC_PROTO2_MAX_PARAM_SIZE) { cros_ec_cmd_xfer_lpc()
132 msg->outsize, msg->insize); cros_ec_cmd_xfer_lpc()
138 args.command_version = msg->version; cros_ec_cmd_xfer_lpc()
139 args.data_size = msg->outsize; cros_ec_cmd_xfer_lpc()
142 csum = msg->command + args.flags + cros_ec_cmd_xfer_lpc()
146 for (i = 0; i < msg->outsize; i++) { cros_ec_cmd_xfer_lpc()
147 outb(msg->data[i], EC_LPC_ADDR_HOST_PARAM + i); cros_ec_cmd_xfer_lpc()
148 csum += msg->data[i]; cros_ec_cmd_xfer_lpc()
159 outb(msg->command, EC_LPC_ADDR_HOST_CMD); cros_ec_cmd_xfer_lpc()
168 msg->result = inb(EC_LPC_ADDR_HOST_DATA); cros_ec_cmd_xfer_lpc()
169 ret = cros_ec_check_result(ec, msg); cros_ec_cmd_xfer_lpc()
179 if (args.data_size > msg->insize) { cros_ec_cmd_xfer_lpc()
182 args.data_size, msg->insize); cros_ec_cmd_xfer_lpc()
188 csum = msg->command + args.flags + cros_ec_cmd_xfer_lpc()
193 msg->data[i] = inb(EC_LPC_ADDR_HOST_PARAM + i); cros_ec_cmd_xfer_lpc()
194 csum += msg->data[i]; cros_ec_cmd_xfer_lpc()
49 cros_ec_pkt_xfer_lpc(struct cros_ec_device *ec, struct cros_ec_command *msg) cros_ec_pkt_xfer_lpc() argument
120 cros_ec_cmd_xfer_lpc(struct cros_ec_device *ec, struct cros_ec_command *msg) cros_ec_cmd_xfer_lpc() argument
H A Dcros_ec_dev.c52 struct cros_ec_command *msg; ec_get_version() local
55 msg = kmalloc(sizeof(*msg) + sizeof(*resp), GFP_KERNEL); ec_get_version()
56 if (!msg) ec_get_version()
59 msg->version = 0; ec_get_version()
60 msg->command = EC_CMD_GET_VERSION + ec->cmd_offset; ec_get_version()
61 msg->insize = sizeof(*resp); ec_get_version()
62 msg->outsize = 0; ec_get_version()
64 ret = cros_ec_cmd_xfer(ec->ec_dev, msg); ec_get_version()
68 if (msg->result != EC_RES_SUCCESS) { ec_get_version()
71 CROS_EC_DEV_VERSION, msg->result); ec_get_version()
76 resp = (struct ec_response_get_version *)msg->data; ec_get_version()
86 kfree(msg); ec_get_version()
109 char msg[sizeof(struct ec_response_get_version) + ec_device_read() local
117 ret = ec_get_version(ec, msg, sizeof(msg)); ec_device_read()
121 count = min(length, strlen(msg)); ec_device_read()
123 if (copy_to_user(buffer, msg, count)) ec_device_read()
/linux-4.4.14/sound/soc/intel/common/
H A Dsst-ipc.c44 struct ipc_message *msg = NULL; msg_get_empty() local
47 msg = list_first_entry(&ipc->empty_list, struct ipc_message, msg_get_empty()
49 list_del(&msg->list); msg_get_empty()
52 return msg; msg_get_empty()
56 struct ipc_message *msg, void *rx_data) tx_wait_done()
62 ret = wait_event_timeout(msg->waitq, msg->complete, tx_wait_done()
70 list_del(&msg->list); tx_wait_done()
75 if (msg->rx_size) tx_wait_done()
76 memcpy(rx_data, msg->rx_data, msg->rx_size); tx_wait_done()
77 ret = msg->errno; tx_wait_done()
80 list_add_tail(&msg->list, &ipc->empty_list); tx_wait_done()
89 struct ipc_message *msg; ipc_tx_message() local
94 msg = msg_get_empty(ipc); ipc_tx_message()
95 if (msg == NULL) { ipc_tx_message()
100 msg->header = header; ipc_tx_message()
101 msg->tx_size = tx_bytes; ipc_tx_message()
102 msg->rx_size = rx_bytes; ipc_tx_message()
103 msg->wait = wait; ipc_tx_message()
104 msg->errno = 0; ipc_tx_message()
105 msg->pending = false; ipc_tx_message()
106 msg->complete = false; ipc_tx_message()
109 ipc->ops.tx_data_copy(msg, tx_data, tx_bytes); ipc_tx_message()
111 list_add_tail(&msg->list, &ipc->tx_list); ipc_tx_message()
117 return tx_wait_done(ipc, msg, rx_data); ipc_tx_message()
126 ipc->msg = kzalloc(sizeof(struct ipc_message) * msg_empty_list_init()
128 if (ipc->msg == NULL) msg_empty_list_init()
132 ipc->msg[i].tx_data = kzalloc(ipc->tx_data_max_size, GFP_KERNEL); msg_empty_list_init()
133 if (ipc->msg[i].tx_data == NULL) msg_empty_list_init()
136 ipc->msg[i].rx_data = kzalloc(ipc->rx_data_max_size, GFP_KERNEL); msg_empty_list_init()
137 if (ipc->msg[i].rx_data == NULL) { msg_empty_list_init()
138 kfree(ipc->msg[i].tx_data); msg_empty_list_init()
142 init_waitqueue_head(&ipc->msg[i].waitq); msg_empty_list_init()
143 list_add(&ipc->msg[i].list, &ipc->empty_list); msg_empty_list_init()
150 kfree(ipc->msg[i-1].tx_data); msg_empty_list_init()
151 kfree(ipc->msg[i-1].rx_data); msg_empty_list_init()
154 kfree(ipc->msg); msg_empty_list_init()
163 struct ipc_message *msg; ipc_tx_msgs() local
181 msg = list_first_entry(&ipc->tx_list, struct ipc_message, list); ipc_tx_msgs()
182 list_move(&msg->list, &ipc->rx_list); ipc_tx_msgs()
185 ipc->ops.tx_msg(ipc, msg); ipc_tx_msgs()
209 struct ipc_message *msg; sst_ipc_reply_find_msg() local
221 list_for_each_entry(msg, &ipc->rx_list, list) { sst_ipc_reply_find_msg()
222 if ((msg->header & mask) == header) sst_ipc_reply_find_msg()
223 return msg; sst_ipc_reply_find_msg()
232 struct ipc_message *msg) sst_ipc_tx_msg_reply_complete()
234 msg->complete = true; sst_ipc_tx_msg_reply_complete()
236 if (!msg->wait) sst_ipc_tx_msg_reply_complete()
237 list_add_tail(&msg->list, &ipc->empty_list); sst_ipc_tx_msg_reply_complete()
239 wake_up(&msg->waitq); sst_ipc_tx_msg_reply_complete()
245 struct ipc_message *msg, *tmp; sst_ipc_drop_all() local
252 list_for_each_entry_safe(msg, tmp, &ipc->tx_list, list) { sst_ipc_drop_all()
253 list_move(&msg->list, &ipc->empty_list); sst_ipc_drop_all()
257 list_for_each_entry_safe(msg, tmp, &ipc->rx_list, list) { sst_ipc_drop_all()
258 list_move(&msg->list, &ipc->empty_list); sst_ipc_drop_all()
265 dev_err(ipc->dev, "dropped IPC msg RX=%d, TX=%d\n", sst_ipc_drop_all()
291 kfree(ipc->msg); sst_ipc_init()
307 if (ipc->msg) { sst_ipc_fini()
309 kfree(ipc->msg[i].tx_data); sst_ipc_fini()
310 kfree(ipc->msg[i].rx_data); sst_ipc_fini()
312 kfree(ipc->msg); sst_ipc_fini()
55 tx_wait_done(struct sst_generic_ipc *ipc, struct ipc_message *msg, void *rx_data) tx_wait_done() argument
231 sst_ipc_tx_msg_reply_complete(struct sst_generic_ipc *ipc, struct ipc_message *msg) sst_ipc_tx_msg_reply_complete() argument
/linux-4.4.14/arch/ia64/kernel/
H A Dmsi_ia64.c18 struct msi_msg msg; ia64_set_msi_irq_affinity() local
26 __get_cached_msi_msg(irq_data_get_msi_desc(idata), &msg); ia64_set_msi_irq_affinity()
28 addr = msg.address_lo; ia64_set_msi_irq_affinity()
31 msg.address_lo = addr; ia64_set_msi_irq_affinity()
33 data = msg.data; ia64_set_msi_irq_affinity()
36 msg.data = data; ia64_set_msi_irq_affinity()
38 pci_write_msi_msg(irq, &msg); ia64_set_msi_irq_affinity()
47 struct msi_msg msg; ia64_setup_msi_irq() local
60 msg.address_hi = 0; ia64_setup_msi_irq()
61 msg.address_lo = ia64_setup_msi_irq()
67 msg.data = ia64_setup_msi_irq()
73 pci_write_msi_msg(irq, &msg); ia64_setup_msi_irq()
137 struct msi_msg msg; dmar_msi_set_affinity() local
143 dmar_msi_read(irq, &msg); dmar_msi_set_affinity()
145 msg.data &= ~MSI_DATA_VECTOR_MASK; dmar_msi_set_affinity()
146 msg.data |= MSI_DATA_VECTOR(cfg->vector); dmar_msi_set_affinity()
147 msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK; dmar_msi_set_affinity()
148 msg.address_lo |= MSI_ADDR_DEST_ID_CPU(cpu_physical_id(cpu)); dmar_msi_set_affinity()
150 dmar_msi_write(irq, &msg); dmar_msi_set_affinity()
169 msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_msg *msg) msi_compose_msg() argument
177 msg->address_hi = 0; msi_compose_msg()
178 msg->address_lo = msi_compose_msg()
184 msg->data = msi_compose_msg()
194 struct msi_msg msg; dmar_alloc_hwirq() local
201 msi_compose_msg(NULL, irq, &msg); dmar_alloc_hwirq()
202 dmar_msi_write(irq, &msg); dmar_alloc_hwirq()
/linux-4.4.14/ipc/
H A Dmsgutil.c16 #include <linux/msg.h>
53 struct msg_msg *msg; alloc_msg() local
58 msg = kmalloc(sizeof(*msg) + alen, GFP_KERNEL); alloc_msg()
59 if (msg == NULL) alloc_msg()
62 msg->next = NULL; alloc_msg()
63 msg->security = NULL; alloc_msg()
66 pseg = &msg->next; alloc_msg()
79 return msg; alloc_msg()
82 free_msg(msg); alloc_msg()
88 struct msg_msg *msg; load_msg() local
93 msg = alloc_msg(len); load_msg()
94 if (msg == NULL) load_msg()
98 if (copy_from_user(msg + 1, src, alen)) load_msg()
101 for (seg = msg->next; seg != NULL; seg = seg->next) { load_msg()
109 err = security_msg_msg_alloc(msg); load_msg()
113 return msg; load_msg()
116 free_msg(msg); load_msg()
152 int store_msg(void __user *dest, struct msg_msg *msg, size_t len) store_msg() argument
158 if (copy_to_user(dest, msg + 1, alen)) store_msg()
161 for (seg = msg->next; seg != NULL; seg = seg->next) { store_msg()
171 void free_msg(struct msg_msg *msg) free_msg() argument
175 security_msg_msg_free(msg); free_msg()
177 seg = msg->next; free_msg()
178 kfree(msg); free_msg()
H A Dmsg.c2 * linux/ipc/msg.c
11 * /proc/sysvipc/msg support (c) 1999 Dragos Acostachioaie <dragos@iname.com>
26 #include <linux/msg.h>
113 * newque - Create a new msg queue
214 struct msg_msg *msg, *t; freeque() local
223 list_for_each_entry_safe(msg, t, &msq->q_messages, m_list) { freeque()
225 free_msg(msg); freeque()
536 case MSG_STAT: /* msqid is an index rather than a msg queue id */ SYSCALL_DEFINE3()
547 static int testmsg(struct msg_msg *msg, long type, int mode) testmsg() argument
554 if (msg->m_type <= type) testmsg()
558 if (msg->m_type == type) testmsg()
562 if (msg->m_type != type) testmsg()
569 static inline int pipelined_send(struct msg_queue *msq, struct msg_msg *msg) pipelined_send() argument
574 if (testmsg(msg, msr->r_msgtype, msr->r_mode) && pipelined_send()
575 !security_msg_queue_msgrcv(msq, msg, msr->r_tsk, pipelined_send()
579 if (msr->r_maxsize < msg->m_ts) { pipelined_send()
599 msr->r_msg = msg; pipelined_send()
613 struct msg_msg *msg; do_msgsnd() local
624 msg = load_msg(mtext, msgsz); do_msgsnd()
625 if (IS_ERR(msg)) do_msgsnd()
626 return PTR_ERR(msg); do_msgsnd()
628 msg->m_type = mtype; do_msgsnd()
629 msg->m_ts = msgsz; do_msgsnd()
653 err = security_msg_queue_msgsnd(msq, msg, msgflg); do_msgsnd()
701 if (!pipelined_send(msq, msg)) { do_msgsnd()
703 list_add_tail(&msg->m_list, &msq->q_messages); do_msgsnd()
711 msg = NULL; do_msgsnd()
717 if (msg != NULL) do_msgsnd()
718 free_msg(msg); do_msgsnd()
753 static long do_msg_fill(void __user *dest, struct msg_msg *msg, size_t bufsz) do_msg_fill() argument
758 if (put_user(msg->m_type, &msgp->mtype)) do_msg_fill()
761 msgsz = (bufsz > msg->m_ts) ? msg->m_ts : bufsz; do_msg_fill()
762 if (store_msg(msgp->mtext, msg, msgsz)) do_msg_fill()
803 struct msg_msg *msg, *found = NULL; find_msg() local
806 list_for_each_entry(msg, &msq->q_messages, m_list) { find_msg()
807 if (testmsg(msg, *msgtyp, mode) && find_msg()
808 !security_msg_queue_msgrcv(msq, msg, current, find_msg()
810 if (mode == SEARCH_LESSEQUAL && msg->m_type != 1) { find_msg()
811 *msgtyp = msg->m_type - 1; find_msg()
812 found = msg; find_msg()
815 return msg; find_msg()
817 return msg; find_msg()
831 struct msg_msg *msg, *copy = NULL; do_msgrcv() local
858 msg = ERR_PTR(-EACCES); do_msgrcv()
866 msg = ERR_PTR(-EIDRM); do_msgrcv()
870 msg = find_msg(msq, &msgtyp, mode); do_msgrcv()
871 if (!IS_ERR(msg)) { do_msgrcv()
876 if ((bufsz < msg->m_ts) && !(msgflg & MSG_NOERROR)) { do_msgrcv()
877 msg = ERR_PTR(-E2BIG); do_msgrcv()
885 msg = copy_msg(msg, copy); do_msgrcv()
889 list_del(&msg->m_list); do_msgrcv()
893 msq->q_cbytes -= msg->m_ts; do_msgrcv()
894 atomic_sub(msg->m_ts, &ns->msg_bytes); do_msgrcv()
903 msg = ERR_PTR(-ENOMSG); do_msgrcv()
947 * msr->r_msg = msg; do_msgrcv()
959 msg = (struct msg_msg *)msr_d.r_msg; do_msgrcv()
960 if (msg) do_msgrcv()
975 if (msg != ERR_PTR(-EAGAIN)) do_msgrcv()
986 msg = (struct msg_msg *)msr_d.r_msg; do_msgrcv()
987 if (msg != ERR_PTR(-EAGAIN)) do_msgrcv()
992 msg = ERR_PTR(-ERESTARTNOHAND); do_msgrcv()
1003 if (IS_ERR(msg)) { do_msgrcv()
1005 return PTR_ERR(msg); do_msgrcv()
1008 bufsz = msg_handler(buf, msg, bufsz); do_msgrcv()
1009 free_msg(msg); do_msgrcv()
1071 ipc_init_proc_interface("sysvipc/msg", msg_init()
/linux-4.4.14/drivers/staging/wilc1000/
H A Dlinux_wlan_spi.c134 struct spi_message msg; linux_spi_write() local
145 memset(&msg, 0, sizeof(msg)); linux_spi_write()
146 spi_message_init(&msg); linux_spi_write()
147 msg.spi = wilc_spi_dev; linux_spi_write()
148 msg.is_dma_mapped = USE_SPI_DMA; linux_spi_write()
150 spi_message_add_tail(&tr, &msg); linux_spi_write()
151 ret = spi_sync(wilc_spi_dev, &msg); linux_spi_write()
160 struct spi_message msg; linux_spi_write() local
170 memset(&msg, 0, sizeof(msg)); linux_spi_write()
171 spi_message_init(&msg); linux_spi_write()
172 msg.spi = wilc_spi_dev; linux_spi_write()
173 msg.is_dma_mapped = USE_SPI_DMA; /* rachel */ linux_spi_write()
175 spi_message_add_tail(&tr, &msg); linux_spi_write()
176 ret = spi_sync(wilc_spi_dev, &msg); linux_spi_write()
200 struct spi_message msg; linux_spi_write() local
216 memset(&msg, 0, sizeof(msg)); linux_spi_write()
217 spi_message_init(&msg); linux_spi_write()
219 msg.spi = wilc_spi_dev; linux_spi_write()
220 msg.is_dma_mapped = USE_SPI_DMA; linux_spi_write()
222 spi_message_add_tail(&tr, &msg); linux_spi_write()
224 ret = spi_sync(wilc_spi_dev, &msg); linux_spi_write()
263 struct spi_message msg; linux_spi_read() local
273 memset(&msg, 0, sizeof(msg)); linux_spi_read()
274 spi_message_init(&msg); linux_spi_read()
275 msg.spi = wilc_spi_dev; linux_spi_read()
276 msg.is_dma_mapped = USE_SPI_DMA; linux_spi_read()
278 spi_message_add_tail(&tr, &msg); linux_spi_read()
279 ret = spi_sync(wilc_spi_dev, &msg); linux_spi_read()
287 struct spi_message msg; linux_spi_read() local
297 memset(&msg, 0, sizeof(msg)); linux_spi_read()
298 spi_message_init(&msg); linux_spi_read()
299 msg.spi = wilc_spi_dev; linux_spi_read()
300 msg.is_dma_mapped = USE_SPI_DMA; /* rachel */ linux_spi_read()
302 spi_message_add_tail(&tr, &msg); linux_spi_read()
303 ret = spi_sync(wilc_spi_dev, &msg); linux_spi_read()
327 struct spi_message msg; linux_spi_read() local
341 memset(&msg, 0, sizeof(msg)); linux_spi_read()
342 spi_message_init(&msg); linux_spi_read()
344 msg.spi = wilc_spi_dev; linux_spi_read()
345 msg.is_dma_mapped = USE_SPI_DMA; linux_spi_read()
347 spi_message_add_tail(&tr, &msg); linux_spi_read()
349 ret = spi_sync(wilc_spi_dev, &msg); linux_spi_read()
372 struct spi_message msg; linux_spi_write_read() local
383 memset(&msg, 0, sizeof(msg)); linux_spi_write_read()
384 spi_message_init(&msg); linux_spi_write_read()
385 msg.spi = wilc_spi_dev; linux_spi_write_read()
386 msg.is_dma_mapped = USE_SPI_DMA; linux_spi_write_read()
388 spi_message_add_tail(&tr, &msg); linux_spi_write_read()
389 ret = spi_sync(wilc_spi_dev, &msg); linux_spi_write_read()
H A Dhost_interface.c2625 struct host_if_msg msg; ListenTimerCB() local
2630 memset(&msg, 0, sizeof(struct host_if_msg)); ListenTimerCB()
2631 msg.id = HOST_IF_MSG_LISTEN_TIMER_FIRED; ListenTimerCB()
2632 msg.drv = hif_drv; ListenTimerCB()
2633 msg.body.remain_on_ch.u32ListenSessionID = hif_drv->remain_on_ch.u32ListenSessionID; ListenTimerCB()
2635 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); ListenTimerCB()
2810 struct host_if_msg msg; hostIFthread() local
2813 memset(&msg, 0, sizeof(struct host_if_msg)); hostIFthread()
2816 wilc_mq_recv(&hif_msg_q, &msg, sizeof(struct host_if_msg), &u32Ret); hostIFthread()
2817 hif_drv = (struct host_if_drv *)msg.drv; hostIFthread()
2818 if (msg.id == HOST_IF_MSG_EXIT) { hostIFthread()
2826 wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); hostIFthread()
2830 if (msg.id == HOST_IF_MSG_CONNECT && hostIFthread()
2833 wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); hostIFthread()
2838 switch (msg.id) { hostIFthread()
2844 Handle_Scan(msg.drv, &msg.body.scan_info); hostIFthread()
2848 Handle_Connect(msg.drv, &msg.body.con_info); hostIFthread()
2852 Handle_FlushConnect(msg.drv); hostIFthread()
2856 Handle_RcvdNtwrkInfo(msg.drv, &msg.body.net_info); hostIFthread()
2860 Handle_RcvdGnrlAsyncInfo(msg.drv, &msg.body.async_info); hostIFthread()
2864 Handle_Key(msg.drv, &msg.body.key_info); hostIFthread()
2869 Handle_CfgParam(msg.drv, &msg.body.cfg_info); hostIFthread()
2873 Handle_SetChannel(msg.drv, &msg.body.channel_info); hostIFthread()
2877 Handle_Disconnect(msg.drv); hostIFthread()
2887 Handle_ScanDone(msg.drv, SCAN_EVENT_DONE); hostIFthread()
2890 Handle_RemainOnChan(msg.drv, &msg.body.remain_on_ch); hostIFthread()
2895 Handle_GetRssi(msg.drv); hostIFthread()
2899 Handle_GetLinkspeed(msg.drv); hostIFthread()
2903 Handle_GetStatistics(msg.drv, (struct rf_info *)msg.body.data); hostIFthread()
2907 Handle_GetChnl(msg.drv); hostIFthread()
2911 Handle_AddBeacon(msg.drv, &msg.body.beacon_info); hostIFthread()
2915 Handle_DelBeacon(msg.drv); hostIFthread()
2919 Handle_AddStation(msg.drv, &msg.body.add_sta_info); hostIFthread()
2923 Handle_DelStation(msg.drv, &msg.body.del_sta_info); hostIFthread()
2927 Handle_EditStation(msg.drv, &msg.body.edit_sta_info); hostIFthread()
2931 Handle_Get_InActiveTime(msg.drv, &msg.body.mac_info); hostIFthread()
2937 Handle_ScanDone(msg.drv, SCAN_EVENT_ABORTED); hostIFthread()
2942 Handle_ConnectTimeout(msg.drv); hostIFthread()
2946 Handle_PowerManagement(msg.drv, &msg.body.pwr_mgmt_info); hostIFthread()
2950 Handle_SetWfiDrvHandler(msg.drv, hostIFthread()
2951 &msg.body.drv); hostIFthread()
2955 Handle_SetOperationMode(msg.drv, &msg.body.mode); hostIFthread()
2960 Handle_set_IPAddress(msg.drv, msg.body.ip_info.ip_addr, msg.body.ip_info.idx); hostIFthread()
2965 Handle_get_IPAddress(msg.drv, msg.body.ip_info.ip_addr, msg.body.ip_info.idx); hostIFthread()
2969 Handle_SetMacAddress(msg.drv, &msg.body.set_mac_info); hostIFthread()
2973 Handle_GetMacAddress(msg.drv, &msg.body.get_mac_info); hostIFthread()
2978 Handle_RemainOnChan(msg.drv, &msg.body.remain_on_ch); hostIFthread()
2983 Handle_RegisterFrame(msg.drv, &msg.body.reg_frame); hostIFthread()
2987 Handle_ListenStateExpired(msg.drv, &msg.body.remain_on_ch); hostIFthread()
2992 Handle_SetMulticastFilter(msg.drv, &msg.body.multicast_info); hostIFthread()
2996 Handle_AddBASession(msg.drv, &msg.body.session_info); hostIFthread()
3000 Handle_DelAllRxBASessions(msg.drv, &msg.body.session_info); hostIFthread()
3004 Handle_DelAllSta(msg.drv, &msg.body.del_all_sta_info); hostIFthread()
3021 struct host_if_msg msg; TimerCB_Scan() local
3023 memset(&msg, 0, sizeof(struct host_if_msg)); TimerCB_Scan()
3024 msg.drv = pvArg; TimerCB_Scan()
3025 msg.id = HOST_IF_MSG_SCAN_TIMER_FIRED; TimerCB_Scan()
3027 wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); TimerCB_Scan()
3033 struct host_if_msg msg; TimerCB_Connect() local
3035 memset(&msg, 0, sizeof(struct host_if_msg)); TimerCB_Connect()
3036 msg.drv = pvArg; TimerCB_Connect()
3037 msg.id = HOST_IF_MSG_CONNECT_TIMER_FIRED; TimerCB_Connect()
3039 wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); TimerCB_Connect()
3057 struct host_if_msg msg; host_int_remove_wep_key() local
3065 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_remove_wep_key()
3067 msg.id = HOST_IF_MSG_KEY; host_int_remove_wep_key()
3068 msg.body.key_info.type = WEP; host_int_remove_wep_key()
3069 msg.body.key_info.action = REMOVEKEY; host_int_remove_wep_key()
3070 msg.drv = hif_drv; host_int_remove_wep_key()
3071 msg.body.key_info.attr.wep.index = index; host_int_remove_wep_key()
3073 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_remove_wep_key()
3084 struct host_if_msg msg; host_int_set_wep_default_key() local
3092 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_set_wep_default_key()
3094 msg.id = HOST_IF_MSG_KEY; host_int_set_wep_default_key()
3095 msg.body.key_info.type = WEP; host_int_set_wep_default_key()
3096 msg.body.key_info.action = DEFAULTKEY; host_int_set_wep_default_key()
3097 msg.drv = hif_drv; host_int_set_wep_default_key()
3098 msg.body.key_info.attr.wep.index = index; host_int_set_wep_default_key()
3100 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_set_wep_default_key()
3114 struct host_if_msg msg; host_int_add_wep_key_bss_sta() local
3121 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_add_wep_key_bss_sta()
3123 msg.id = HOST_IF_MSG_KEY; host_int_add_wep_key_bss_sta()
3124 msg.body.key_info.type = WEP; host_int_add_wep_key_bss_sta()
3125 msg.body.key_info.action = ADDKEY; host_int_add_wep_key_bss_sta()
3126 msg.drv = hif_drv; host_int_add_wep_key_bss_sta()
3127 msg.body.key_info.attr.wep.key = kmemdup(key, len, GFP_KERNEL); host_int_add_wep_key_bss_sta()
3128 if (!msg.body.key_info.attr.wep.key) host_int_add_wep_key_bss_sta()
3131 msg.body.key_info.attr.wep.key_len = len; host_int_add_wep_key_bss_sta()
3132 msg.body.key_info.attr.wep.index = index; host_int_add_wep_key_bss_sta()
3134 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_add_wep_key_bss_sta()
3150 struct host_if_msg msg; host_int_add_wep_key_bss_ap() local
3158 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_add_wep_key_bss_ap()
3164 msg.id = HOST_IF_MSG_KEY; host_int_add_wep_key_bss_ap()
3165 msg.body.key_info.type = WEP; host_int_add_wep_key_bss_ap()
3166 msg.body.key_info.action = ADDKEY_AP; host_int_add_wep_key_bss_ap()
3167 msg.drv = hif_drv; host_int_add_wep_key_bss_ap()
3168 msg.body.key_info.attr.wep.key = kmemdup(key, len, GFP_KERNEL); host_int_add_wep_key_bss_ap()
3169 if (!msg.body.key_info.attr.wep.key) host_int_add_wep_key_bss_ap()
3172 msg.body.key_info.attr.wep.key_len = len; host_int_add_wep_key_bss_ap()
3173 msg.body.key_info.attr.wep.index = index; host_int_add_wep_key_bss_ap()
3174 msg.body.key_info.attr.wep.mode = mode; host_int_add_wep_key_bss_ap()
3175 msg.body.key_info.attr.wep.auth_type = auth_type; host_int_add_wep_key_bss_ap()
3177 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_add_wep_key_bss_ap()
3192 struct host_if_msg msg; host_int_add_ptk() local
3207 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_add_ptk()
3209 msg.id = HOST_IF_MSG_KEY; host_int_add_ptk()
3210 msg.body.key_info.type = WPAPtk; host_int_add_ptk()
3212 msg.body.key_info.action = ADDKEY_AP; host_int_add_ptk()
3213 msg.body.key_info.attr.wpa.index = u8Idx; host_int_add_ptk()
3216 msg.body.key_info.action = ADDKEY; host_int_add_ptk()
3218 msg.body.key_info.attr.wpa.key = kmalloc(u8PtkKeylen, GFP_KERNEL); host_int_add_ptk()
3219 memcpy(msg.body.key_info.attr.wpa.key, pu8Ptk, u8PtkKeylen); host_int_add_ptk()
3222 memcpy(msg.body.key_info.attr.wpa.key + 16, pu8RxMic, RX_MIC_KEY_LEN); host_int_add_ptk()
3229 memcpy(msg.body.key_info.attr.wpa.key + 24, pu8TxMic, TX_MIC_KEY_LEN); host_int_add_ptk()
3236 msg.body.key_info.attr.wpa.key_len = u8KeyLen; host_int_add_ptk()
3237 msg.body.key_info.attr.wpa.mac_addr = mac_addr; host_int_add_ptk()
3238 msg.body.key_info.attr.wpa.mode = u8Ciphermode; host_int_add_ptk()
3239 msg.drv = hif_drv; host_int_add_ptk()
3241 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_add_ptk()
3258 struct host_if_msg msg; host_int_add_rx_gtk() local
3265 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_add_rx_gtk()
3274 msg.body.key_info.attr.wpa.seq = kmalloc(u32KeyRSClen, GFP_KERNEL); host_int_add_rx_gtk()
3275 memcpy(msg.body.key_info.attr.wpa.seq, KeyRSC, u32KeyRSClen); host_int_add_rx_gtk()
3278 msg.id = HOST_IF_MSG_KEY; host_int_add_rx_gtk()
3279 msg.body.key_info.type = WPARxGtk; host_int_add_rx_gtk()
3280 msg.drv = hif_drv; host_int_add_rx_gtk()
3283 msg.body.key_info.action = ADDKEY_AP; host_int_add_rx_gtk()
3284 msg.body.key_info.attr.wpa.mode = u8Ciphermode; host_int_add_rx_gtk()
3287 msg.body.key_info.action = ADDKEY; host_int_add_rx_gtk()
3289 msg.body.key_info.attr.wpa.key = kmalloc(u8KeyLen, GFP_KERNEL); host_int_add_rx_gtk()
3290 memcpy(msg.body.key_info.attr.wpa.key, pu8RxGtk, u8GtkKeylen); host_int_add_rx_gtk()
3293 memcpy(msg.body.key_info.attr.wpa.key + 16, pu8RxMic, host_int_add_rx_gtk()
3297 memcpy(msg.body.key_info.attr.wpa.key + 24, pu8TxMic, host_int_add_rx_gtk()
3300 msg.body.key_info.attr.wpa.index = u8KeyIdx; host_int_add_rx_gtk()
3301 msg.body.key_info.attr.wpa.key_len = u8KeyLen; host_int_add_rx_gtk()
3302 msg.body.key_info.attr.wpa.seq_len = u32KeyRSClen; host_int_add_rx_gtk()
3304 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_add_rx_gtk()
3316 struct host_if_msg msg; host_int_set_pmkid_info() local
3324 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_set_pmkid_info()
3326 msg.id = HOST_IF_MSG_KEY; host_int_set_pmkid_info()
3327 msg.body.key_info.type = PMKSA; host_int_set_pmkid_info()
3328 msg.body.key_info.action = ADDKEY; host_int_set_pmkid_info()
3329 msg.drv = hif_drv; host_int_set_pmkid_info()
3332 memcpy(msg.body.key_info.attr.pmkid.pmkidlist[i].bssid, host_int_set_pmkid_info()
3334 memcpy(msg.body.key_info.attr.pmkid.pmkidlist[i].pmkid, host_int_set_pmkid_info()
3338 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_set_pmkid_info()
3378 struct host_if_msg msg; host_int_get_MacAddress() local
3380 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_get_MacAddress()
3382 msg.id = HOST_IF_MSG_GET_MAC_ADDRESS; host_int_get_MacAddress()
3383 msg.body.get_mac_info.mac_addr = pu8MacAddress; host_int_get_MacAddress()
3384 msg.drv = hif_drv; host_int_get_MacAddress()
3386 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_get_MacAddress()
3399 struct host_if_msg msg; host_int_set_MacAddress() local
3403 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_set_MacAddress()
3404 msg.id = HOST_IF_MSG_SET_MAC_ADDRESS; host_int_set_MacAddress()
3405 memcpy(msg.body.set_mac_info.mac_addr, pu8MacAddress, ETH_ALEN); host_int_set_MacAddress()
3406 msg.drv = hif_drv; host_int_set_MacAddress()
3408 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_set_MacAddress()
3460 struct host_if_msg msg; host_int_set_join_req() local
3472 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_set_join_req()
3474 msg.id = HOST_IF_MSG_CONNECT; host_int_set_join_req()
3476 msg.body.con_info.security = u8security; host_int_set_join_req()
3477 msg.body.con_info.auth_type = tenuAuth_type; host_int_set_join_req()
3478 msg.body.con_info.ch = u8channel; host_int_set_join_req()
3479 msg.body.con_info.result = pfConnectResult; host_int_set_join_req()
3480 msg.body.con_info.arg = pvUserArg; host_int_set_join_req()
3481 msg.body.con_info.params = pJoinParams; host_int_set_join_req()
3482 msg.drv = hif_drv ; host_int_set_join_req()
3485 msg.body.con_info.bssid = kmalloc(6, GFP_KERNEL); host_int_set_join_req()
3486 memcpy(msg.body.con_info.bssid, pu8bssid, 6); host_int_set_join_req()
3490 msg.body.con_info.ssid_len = ssidLen; host_int_set_join_req()
3491 msg.body.con_info.ssid = kmalloc(ssidLen, GFP_KERNEL); host_int_set_join_req()
3492 memcpy(msg.body.con_info.ssid, pu8ssid, ssidLen); host_int_set_join_req()
3496 msg.body.con_info.ies_len = IEsLen; host_int_set_join_req()
3497 msg.body.con_info.ies = kmalloc(IEsLen, GFP_KERNEL); host_int_set_join_req()
3498 memcpy(msg.body.con_info.ies, pu8IEs, IEsLen); host_int_set_join_req()
3505 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_set_join_req()
3521 struct host_if_msg msg; host_int_flush_join_req() local
3531 msg.id = HOST_IF_MSG_FLUSH_CONNECT; host_int_flush_join_req()
3532 msg.drv = hif_drv; host_int_flush_join_req()
3534 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_flush_join_req()
3546 struct host_if_msg msg; host_int_disconnect() local
3553 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_disconnect()
3555 msg.id = HOST_IF_MSG_DISCONNECT; host_int_disconnect()
3556 msg.drv = hif_drv; host_int_disconnect()
3558 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_disconnect()
3641 struct host_if_msg msg; host_int_set_mac_chnl_num() local
3648 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_set_mac_chnl_num()
3649 msg.id = HOST_IF_MSG_SET_CHANNEL; host_int_set_mac_chnl_num()
3650 msg.body.channel_info.set_ch = channel; host_int_set_mac_chnl_num()
3651 msg.drv = hif_drv; host_int_set_mac_chnl_num()
3653 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_set_mac_chnl_num()
3665 struct host_if_msg msg; host_int_wait_msg_queue_idle() local
3667 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_wait_msg_queue_idle()
3668 msg.id = HOST_IF_MSG_Q_IDLE; host_int_wait_msg_queue_idle()
3669 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_wait_msg_queue_idle()
3683 struct host_if_msg msg; host_int_set_wfi_drv_handler() local
3685 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_set_wfi_drv_handler()
3686 msg.id = HOST_IF_MSG_SET_WFIDRV_HANDLER; host_int_set_wfi_drv_handler()
3687 msg.body.drv.handler = get_id_from_handler(hif_drv); host_int_set_wfi_drv_handler()
3688 msg.drv = hif_drv; host_int_set_wfi_drv_handler()
3690 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_set_wfi_drv_handler()
3702 struct host_if_msg msg; host_int_set_operation_mode() local
3704 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_set_operation_mode()
3705 msg.id = HOST_IF_MSG_SET_OPERATION_MODE; host_int_set_operation_mode()
3706 msg.body.mode.mode = mode; host_int_set_operation_mode()
3707 msg.drv = hif_drv; host_int_set_operation_mode()
3709 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_set_operation_mode()
3721 struct host_if_msg msg; host_int_get_host_chnl_num() local
3728 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_get_host_chnl_num()
3730 msg.id = HOST_IF_MSG_GET_CHNL; host_int_get_host_chnl_num()
3731 msg.drv = hif_drv; host_int_get_host_chnl_num()
3733 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_get_host_chnl_num()
3747 struct host_if_msg msg; host_int_get_inactive_time() local
3754 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_get_inactive_time()
3755 memcpy(msg.body.mac_info.mac, mac, ETH_ALEN); host_int_get_inactive_time()
3757 msg.id = HOST_IF_MSG_GET_INACTIVETIME; host_int_get_inactive_time()
3758 msg.drv = hif_drv; host_int_get_inactive_time()
3760 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_get_inactive_time()
3802 struct host_if_msg msg; host_int_get_rssi() local
3804 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_get_rssi()
3805 msg.id = HOST_IF_MSG_GET_RSSI; host_int_get_rssi()
3806 msg.drv = hif_drv; host_int_get_rssi()
3808 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_get_rssi()
3828 struct host_if_msg msg; host_int_get_link_speed() local
3831 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_get_link_speed()
3832 msg.id = HOST_IF_MSG_GET_LINKSPEED; host_int_get_link_speed()
3833 msg.drv = hif_drv; host_int_get_link_speed()
3835 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_get_link_speed()
3856 struct host_if_msg msg; host_int_get_statistics() local
3858 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_get_statistics()
3859 msg.id = HOST_IF_MSG_GET_STATISTICS; host_int_get_statistics()
3860 msg.body.data = (char *)pstrStatistics; host_int_get_statistics()
3861 msg.drv = hif_drv; host_int_get_statistics()
3863 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_get_statistics()
3880 struct host_if_msg msg; host_int_scan() local
3887 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_scan()
3889 msg.id = HOST_IF_MSG_SCAN; host_int_scan()
3892 msg.body.scan_info.hidden_network.pstrHiddenNetworkInfo = pstrHiddenNetwork->pstrHiddenNetworkInfo; host_int_scan()
3893 msg.body.scan_info.hidden_network.u8ssidnum = pstrHiddenNetwork->u8ssidnum; host_int_scan()
3898 msg.drv = hif_drv; host_int_scan()
3899 msg.body.scan_info.src = u8ScanSource; host_int_scan()
3900 msg.body.scan_info.type = u8ScanType; host_int_scan()
3901 msg.body.scan_info.result = ScanResult; host_int_scan()
3902 msg.body.scan_info.arg = pvUserArg; host_int_scan()
3904 msg.body.scan_info.ch_list_len = u8ChnlListLen; host_int_scan()
3905 msg.body.scan_info.ch_freq_list = kmalloc(u8ChnlListLen, GFP_KERNEL); host_int_scan()
3906 memcpy(msg.body.scan_info.ch_freq_list, pu8ChnlFreqList, u8ChnlListLen); host_int_scan()
3908 msg.body.scan_info.ies_len = IEsLen; host_int_scan()
3909 msg.body.scan_info.ies = kmalloc(IEsLen, GFP_KERNEL); host_int_scan()
3910 memcpy(msg.body.scan_info.ies, pu8IEs, IEsLen); host_int_scan()
3912 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_scan()
3930 struct host_if_msg msg; hif_set_cfg() local
3937 memset(&msg, 0, sizeof(struct host_if_msg)); hif_set_cfg()
3938 msg.id = HOST_IF_MSG_CFG_PARAMS; hif_set_cfg()
3939 msg.body.cfg_info.cfg_attr_info = *pstrCfgParamVal; hif_set_cfg()
3940 msg.drv = hif_drv; hif_set_cfg()
3942 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); hif_set_cfg()
4051 struct host_if_msg msg; GetPeriodicRSSI() local
4053 memset(&msg, 0, sizeof(struct host_if_msg)); GetPeriodicRSSI()
4055 msg.id = HOST_IF_MSG_GET_RSSI; GetPeriodicRSSI()
4056 msg.drv = hif_drv; GetPeriodicRSSI()
4058 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); GetPeriodicRSSI()
4180 struct host_if_msg msg; host_int_deinit() local
4218 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_deinit()
4224 msg.id = HOST_IF_MSG_EXIT; host_int_deinit()
4225 msg.drv = hif_drv; host_int_deinit()
4227 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_deinit()
4253 struct host_if_msg msg; NetworkInfoReceived() local
4265 memset(&msg, 0, sizeof(struct host_if_msg)); NetworkInfoReceived()
4267 msg.id = HOST_IF_MSG_RCVD_NTWRK_INFO; NetworkInfoReceived()
4268 msg.drv = hif_drv; NetworkInfoReceived()
4270 msg.body.net_info.len = u32Length; NetworkInfoReceived()
4271 msg.body.net_info.buffer = kmalloc(u32Length, GFP_KERNEL); NetworkInfoReceived()
4272 memcpy(msg.body.net_info.buffer, pu8Buffer, u32Length); NetworkInfoReceived()
4274 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); NetworkInfoReceived()
4282 struct host_if_msg msg; GnrlAsyncInfoReceived() local
4304 memset(&msg, 0, sizeof(struct host_if_msg)); GnrlAsyncInfoReceived()
4306 msg.id = HOST_IF_MSG_RCVD_GNRL_ASYNC_INFO; GnrlAsyncInfoReceived()
4307 msg.drv = hif_drv; GnrlAsyncInfoReceived()
4309 msg.body.async_info.len = u32Length; GnrlAsyncInfoReceived()
4310 msg.body.async_info.buffer = kmalloc(u32Length, GFP_KERNEL); GnrlAsyncInfoReceived()
4311 memcpy(msg.body.async_info.buffer, pu8Buffer, u32Length); GnrlAsyncInfoReceived()
4313 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); GnrlAsyncInfoReceived()
4323 struct host_if_msg msg; host_int_ScanCompleteReceived() local
4336 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_ScanCompleteReceived()
4338 msg.id = HOST_IF_MSG_RCVD_SCAN_COMPLETE; host_int_ScanCompleteReceived()
4339 msg.drv = hif_drv; host_int_ScanCompleteReceived()
4341 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_ScanCompleteReceived()
4356 struct host_if_msg msg; host_int_remain_on_channel() local
4363 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_remain_on_channel()
4365 msg.id = HOST_IF_MSG_REMAIN_ON_CHAN; host_int_remain_on_channel()
4366 msg.body.remain_on_ch.u16Channel = chan; host_int_remain_on_channel()
4367 msg.body.remain_on_ch.pRemainOnChanExpired = RemainOnChanExpired; host_int_remain_on_channel()
4368 msg.body.remain_on_ch.pRemainOnChanReady = RemainOnChanReady; host_int_remain_on_channel()
4369 msg.body.remain_on_ch.pVoid = pvUserArg; host_int_remain_on_channel()
4370 msg.body.remain_on_ch.u32duration = u32duration; host_int_remain_on_channel()
4371 msg.body.remain_on_ch.u32ListenSessionID = u32SessionID; host_int_remain_on_channel()
4372 msg.drv = hif_drv; host_int_remain_on_channel()
4374 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_remain_on_channel()
4384 struct host_if_msg msg; host_int_ListenStateExpired() local
4393 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_ListenStateExpired()
4394 msg.id = HOST_IF_MSG_LISTEN_TIMER_FIRED; host_int_ListenStateExpired()
4395 msg.drv = hif_drv; host_int_ListenStateExpired()
4396 msg.body.remain_on_ch.u32ListenSessionID = u32SessionID; host_int_ListenStateExpired()
4398 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_ListenStateExpired()
4408 struct host_if_msg msg; host_int_frame_register() local
4415 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_frame_register()
4417 msg.id = HOST_IF_MSG_REGISTER_FRAME; host_int_frame_register()
4421 msg.body.reg_frame.u8Regid = ACTION_FRM_IDX; host_int_frame_register()
4426 msg.body.reg_frame.u8Regid = PROBE_REQ_IDX; host_int_frame_register()
4433 msg.body.reg_frame.u16FrameType = u16FrameType; host_int_frame_register()
4434 msg.body.reg_frame.bReg = bReg; host_int_frame_register()
4435 msg.drv = hif_drv; host_int_frame_register()
4437 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_frame_register()
4449 struct host_if_msg msg; host_int_add_beacon() local
4450 struct beacon_attr *pstrSetBeaconParam = &msg.body.beacon_info; host_int_add_beacon()
4457 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_add_beacon()
4461 msg.id = HOST_IF_MSG_ADD_BEACON; host_int_add_beacon()
4462 msg.drv = hif_drv; host_int_add_beacon()
4484 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_add_beacon()
4501 struct host_if_msg msg; host_int_del_beacon() local
4508 msg.id = HOST_IF_MSG_DEL_BEACON; host_int_del_beacon()
4509 msg.drv = hif_drv; host_int_del_beacon()
4512 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_del_beacon()
4523 struct host_if_msg msg; host_int_add_station() local
4524 struct add_sta_param *pstrAddStationMsg = &msg.body.add_sta_info; host_int_add_station()
4531 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_add_station()
4535 msg.id = HOST_IF_MSG_ADD_STATION; host_int_add_station()
4536 msg.drv = hif_drv; host_int_add_station()
4549 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_add_station()
4558 struct host_if_msg msg; host_int_del_station() local
4559 struct del_sta *pstrDelStationMsg = &msg.body.del_sta_info; host_int_del_station()
4566 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_del_station()
4570 msg.id = HOST_IF_MSG_DEL_STATION; host_int_del_station()
4571 msg.drv = hif_drv; host_int_del_station()
4578 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_del_station()
4588 struct host_if_msg msg; host_int_del_allstation() local
4589 struct del_all_sta *pstrDelAllStationMsg = &msg.body.del_all_sta_info; host_int_del_allstation()
4599 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_del_allstation()
4603 msg.id = HOST_IF_MSG_DEL_ALL_STA; host_int_del_allstation()
4604 msg.drv = hif_drv; host_int_del_allstation()
4625 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_del_allstation()
4639 struct host_if_msg msg; host_int_edit_station() local
4640 struct add_sta_param *pstrAddStationMsg = &msg.body.add_sta_info; host_int_edit_station()
4649 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_edit_station()
4651 msg.id = HOST_IF_MSG_EDIT_STATION; host_int_edit_station()
4652 msg.drv = hif_drv; host_int_edit_station()
4665 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_edit_station()
4677 struct host_if_msg msg; host_int_set_power_mgmt() local
4678 struct power_mgmt_param *pstrPowerMgmtParam = &msg.body.pwr_mgmt_info; host_int_set_power_mgmt()
4689 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_set_power_mgmt()
4691 msg.id = HOST_IF_MSG_POWER_MGMT; host_int_set_power_mgmt()
4692 msg.drv = hif_drv; host_int_set_power_mgmt()
4697 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_set_power_mgmt()
4708 struct host_if_msg msg; host_int_setup_multicast_filter() local
4709 struct set_multicast *pstrMulticastFilterParam = &msg.body.multicast_info; host_int_setup_multicast_filter()
4718 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_setup_multicast_filter()
4720 msg.id = HOST_IF_MSG_SET_MULTICAST_FILTER; host_int_setup_multicast_filter()
4721 msg.drv = hif_drv; host_int_setup_multicast_filter()
4726 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_setup_multicast_filter()
4900 struct host_if_msg msg; host_int_delBASession() local
4901 struct ba_session_info *pBASessionInfo = &msg.body.session_info; host_int_delBASession()
4908 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_delBASession()
4910 msg.id = HOST_IF_MSG_DEL_BA_SESSION; host_int_delBASession()
4914 msg.drv = hif_drv; host_int_delBASession()
4916 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_delBASession()
4930 struct host_if_msg msg; host_int_del_All_Rx_BASession() local
4931 struct ba_session_info *pBASessionInfo = &msg.body.session_info; host_int_del_All_Rx_BASession()
4938 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_del_All_Rx_BASession()
4940 msg.id = HOST_IF_MSG_DEL_ALL_RX_BA_SESSIONS; host_int_del_All_Rx_BASession()
4944 msg.drv = hif_drv; host_int_del_All_Rx_BASession()
4946 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_del_All_Rx_BASession()
4958 struct host_if_msg msg; host_int_setup_ipaddress() local
4967 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_setup_ipaddress()
4969 msg.id = HOST_IF_MSG_SET_IPADDRESS; host_int_setup_ipaddress()
4971 msg.body.ip_info.ip_addr = u16ipadd; host_int_setup_ipaddress()
4972 msg.drv = hif_drv; host_int_setup_ipaddress()
4973 msg.body.ip_info.idx = idx; host_int_setup_ipaddress()
4975 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_setup_ipaddress()
4985 struct host_if_msg msg; host_int_get_ipaddress() local
4992 memset(&msg, 0, sizeof(struct host_if_msg)); host_int_get_ipaddress()
4994 msg.id = HOST_IF_MSG_GET_IPADDRESS; host_int_get_ipaddress()
4996 msg.body.ip_info.ip_addr = u16ipadd; host_int_get_ipaddress()
4997 msg.drv = hif_drv; host_int_get_ipaddress()
4998 msg.body.ip_info.idx = idx; host_int_get_ipaddress()
5000 result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg)); host_int_get_ipaddress()
/linux-4.4.14/tools/perf/ui/
H A Dlibslang.h15 #define slsmg_printf(msg, args...) \
16 SLsmg_printf((char *)(msg), ##args)
17 #define slsmg_vprintf(msg, vargs) \
18 SLsmg_vprintf((char *)(msg), vargs)
19 #define slsmg_write_nstring(msg, len) \
20 SLsmg_write_nstring((char *)(msg), len)
H A Dhelpline.h11 void (*push)(const char *msg);
20 void ui_helpline__push(const char *msg);
23 void ui_helpline__puts(const char *msg);
H A Dhelpline.c15 static void nop_helpline__push(const char *msg __maybe_unused) nop_helpline__push()
38 void ui_helpline__push(const char *msg) ui_helpline__push() argument
40 helpline_fns->push(msg); ui_helpline__push()
64 void ui_helpline__puts(const char *msg) ui_helpline__puts() argument
67 ui_helpline__push(msg); ui_helpline__puts()
/linux-4.4.14/tools/perf/ui/gtk/
H A Dutil.c32 char *msg; perf_gtk__error() local
36 vasprintf(&msg, format, args) < 0) { perf_gtk__error()
47 "<b>Error</b>\n\n%s", msg); perf_gtk__error()
51 free(msg); perf_gtk__error()
58 char *msg; perf_gtk__warning_info_bar() local
61 vasprintf(&msg, format, args) < 0) { perf_gtk__warning_info_bar()
68 gtk_label_set_text(GTK_LABEL(pgctx->message_label), msg); perf_gtk__warning_info_bar()
73 free(msg); perf_gtk__warning_info_bar()
79 char *msg, *p; perf_gtk__warning_statusbar() local
82 vasprintf(&msg, format, args) < 0) { perf_gtk__warning_statusbar()
93 p = strchr(msg, '\n'); perf_gtk__warning_statusbar()
98 pgctx->statbar_ctx_id, msg); perf_gtk__warning_statusbar() local
100 free(msg); perf_gtk__warning_statusbar()
H A Dhelpline.c18 static void gtk_helpline_push(const char *msg) gtk_helpline_push() argument
24 pgctx->statbar_ctx_id, msg); gtk_helpline_push() local
/linux-4.4.14/net/nfc/
H A Dnetlink.c75 static int nfc_genl_send_target(struct sk_buff *msg, struct nfc_target *target, nfc_genl_send_target() argument
80 hdr = genlmsg_put(msg, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, nfc_genl_send_target()
87 if (nla_put_u32(msg, NFC_ATTR_TARGET_INDEX, target->idx) || nfc_genl_send_target()
88 nla_put_u32(msg, NFC_ATTR_PROTOCOLS, target->supported_protocols) || nfc_genl_send_target()
89 nla_put_u16(msg, NFC_ATTR_TARGET_SENS_RES, target->sens_res) || nfc_genl_send_target()
90 nla_put_u8(msg, NFC_ATTR_TARGET_SEL_RES, target->sel_res)) nfc_genl_send_target()
93 nla_put(msg, NFC_ATTR_TARGET_NFCID1, target->nfcid1_len, nfc_genl_send_target()
97 nla_put(msg, NFC_ATTR_TARGET_SENSB_RES, target->sensb_res_len, nfc_genl_send_target()
101 nla_put(msg, NFC_ATTR_TARGET_SENSF_RES, target->sensf_res_len, nfc_genl_send_target()
106 if (nla_put_u8(msg, NFC_ATTR_TARGET_ISO15693_DSFID, nfc_genl_send_target()
108 nla_put(msg, NFC_ATTR_TARGET_ISO15693_UID, nfc_genl_send_target()
113 genlmsg_end(msg, hdr); nfc_genl_send_target()
117 genlmsg_cancel(msg, hdr); nfc_genl_send_target()
193 struct sk_buff *msg; nfc_genl_targets_found() local
198 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); nfc_genl_targets_found()
199 if (!msg) nfc_genl_targets_found()
202 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, nfc_genl_targets_found()
207 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx)) nfc_genl_targets_found()
210 genlmsg_end(msg, hdr); nfc_genl_targets_found()
212 return genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC); nfc_genl_targets_found()
215 genlmsg_cancel(msg, hdr); nfc_genl_targets_found()
217 nlmsg_free(msg); nfc_genl_targets_found()
223 struct sk_buff *msg; nfc_genl_target_lost() local
226 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nfc_genl_target_lost()
227 if (!msg) nfc_genl_target_lost()
230 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, nfc_genl_target_lost()
235 if (nla_put_string(msg, NFC_ATTR_DEVICE_NAME, nfc_device_name(dev)) || nfc_genl_target_lost()
236 nla_put_u32(msg, NFC_ATTR_TARGET_INDEX, target_idx)) nfc_genl_target_lost()
239 genlmsg_end(msg, hdr); nfc_genl_target_lost()
241 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); nfc_genl_target_lost()
246 genlmsg_cancel(msg, hdr); nfc_genl_target_lost()
248 nlmsg_free(msg); nfc_genl_target_lost()
254 struct sk_buff *msg; nfc_genl_tm_activated() local
257 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nfc_genl_tm_activated()
258 if (!msg) nfc_genl_tm_activated()
261 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, nfc_genl_tm_activated()
266 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx)) nfc_genl_tm_activated()
268 if (nla_put_u32(msg, NFC_ATTR_TM_PROTOCOLS, protocol)) nfc_genl_tm_activated()
271 genlmsg_end(msg, hdr); nfc_genl_tm_activated()
273 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); nfc_genl_tm_activated()
278 genlmsg_cancel(msg, hdr); nfc_genl_tm_activated()
280 nlmsg_free(msg); nfc_genl_tm_activated()
286 struct sk_buff *msg; nfc_genl_tm_deactivated() local
289 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nfc_genl_tm_deactivated()
290 if (!msg) nfc_genl_tm_deactivated()
293 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, nfc_genl_tm_deactivated()
298 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx)) nfc_genl_tm_deactivated()
301 genlmsg_end(msg, hdr); nfc_genl_tm_deactivated()
303 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); nfc_genl_tm_deactivated()
308 genlmsg_cancel(msg, hdr); nfc_genl_tm_deactivated()
310 nlmsg_free(msg); nfc_genl_tm_deactivated()
316 struct sk_buff *msg; nfc_genl_device_added() local
319 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nfc_genl_device_added()
320 if (!msg) nfc_genl_device_added()
323 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, nfc_genl_device_added()
328 if (nla_put_string(msg, NFC_ATTR_DEVICE_NAME, nfc_device_name(dev)) || nfc_genl_device_added()
329 nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx) || nfc_genl_device_added()
330 nla_put_u32(msg, NFC_ATTR_PROTOCOLS, dev->supported_protocols) || nfc_genl_device_added()
331 nla_put_u8(msg, NFC_ATTR_DEVICE_POWERED, dev->dev_up)) nfc_genl_device_added()
334 genlmsg_end(msg, hdr); nfc_genl_device_added()
336 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); nfc_genl_device_added()
341 genlmsg_cancel(msg, hdr); nfc_genl_device_added()
343 nlmsg_free(msg); nfc_genl_device_added()
349 struct sk_buff *msg; nfc_genl_device_removed() local
352 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nfc_genl_device_removed()
353 if (!msg) nfc_genl_device_removed()
356 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, nfc_genl_device_removed()
361 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx)) nfc_genl_device_removed()
364 genlmsg_end(msg, hdr); nfc_genl_device_removed()
366 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); nfc_genl_device_removed()
371 genlmsg_cancel(msg, hdr); nfc_genl_device_removed()
373 nlmsg_free(msg); nfc_genl_device_removed()
379 struct sk_buff *msg; nfc_genl_llc_send_sdres() local
387 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nfc_genl_llc_send_sdres()
388 if (!msg) nfc_genl_llc_send_sdres()
391 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, nfc_genl_llc_send_sdres()
396 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx)) nfc_genl_llc_send_sdres()
399 sdp_attr = nla_nest_start(msg, NFC_ATTR_LLC_SDP); nfc_genl_llc_send_sdres()
409 uri_attr = nla_nest_start(msg, i++); hlist_for_each_entry_safe()
415 if (nla_put_u8(msg, NFC_SDP_ATTR_SAP, sdres->sap)) hlist_for_each_entry_safe()
418 if (nla_put_string(msg, NFC_SDP_ATTR_URI, sdres->uri)) hlist_for_each_entry_safe()
421 nla_nest_end(msg, uri_attr); hlist_for_each_entry_safe()
428 nla_nest_end(msg, sdp_attr);
430 genlmsg_end(msg, hdr);
432 return genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC);
435 genlmsg_cancel(msg, hdr);
438 nlmsg_free(msg);
447 struct sk_buff *msg; nfc_genl_se_added() local
450 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nfc_genl_se_added()
451 if (!msg) nfc_genl_se_added()
454 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, nfc_genl_se_added()
459 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx) || nfc_genl_se_added()
460 nla_put_u32(msg, NFC_ATTR_SE_INDEX, se_idx) || nfc_genl_se_added()
461 nla_put_u8(msg, NFC_ATTR_SE_TYPE, type)) nfc_genl_se_added()
464 genlmsg_end(msg, hdr); nfc_genl_se_added()
466 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); nfc_genl_se_added()
471 genlmsg_cancel(msg, hdr); nfc_genl_se_added()
473 nlmsg_free(msg); nfc_genl_se_added()
479 struct sk_buff *msg; nfc_genl_se_removed() local
482 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nfc_genl_se_removed()
483 if (!msg) nfc_genl_se_removed()
486 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, nfc_genl_se_removed()
491 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx) || nfc_genl_se_removed()
492 nla_put_u32(msg, NFC_ATTR_SE_INDEX, se_idx)) nfc_genl_se_removed()
495 genlmsg_end(msg, hdr); nfc_genl_se_removed()
497 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); nfc_genl_se_removed()
502 genlmsg_cancel(msg, hdr); nfc_genl_se_removed()
504 nlmsg_free(msg); nfc_genl_se_removed()
512 struct sk_buff *msg; nfc_genl_se_transaction() local
515 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nfc_genl_se_transaction()
516 if (!msg) nfc_genl_se_transaction()
519 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, nfc_genl_se_transaction()
528 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx) || nfc_genl_se_transaction()
529 nla_put_u32(msg, NFC_ATTR_SE_INDEX, se_idx) || nfc_genl_se_transaction()
530 nla_put_u8(msg, NFC_ATTR_SE_TYPE, se->type) || nfc_genl_se_transaction()
531 nla_put(msg, NFC_ATTR_SE_AID, evt_transaction->aid_len, nfc_genl_se_transaction()
533 nla_put(msg, NFC_ATTR_SE_PARAMS, evt_transaction->params_len, nfc_genl_se_transaction()
540 genlmsg_end(msg, hdr); nfc_genl_se_transaction()
542 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); nfc_genl_se_transaction()
547 genlmsg_cancel(msg, hdr); nfc_genl_se_transaction()
551 nlmsg_free(msg); nfc_genl_se_transaction()
555 static int nfc_genl_send_device(struct sk_buff *msg, struct nfc_dev *dev, nfc_genl_send_device() argument
562 hdr = genlmsg_put(msg, portid, seq, &nfc_genl_family, flags, nfc_genl_send_device()
570 if (nla_put_string(msg, NFC_ATTR_DEVICE_NAME, nfc_device_name(dev)) || nfc_genl_send_device()
571 nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx) || nfc_genl_send_device()
572 nla_put_u32(msg, NFC_ATTR_PROTOCOLS, dev->supported_protocols) || nfc_genl_send_device()
573 nla_put_u8(msg, NFC_ATTR_DEVICE_POWERED, dev->dev_up) || nfc_genl_send_device()
574 nla_put_u8(msg, NFC_ATTR_RF_MODE, dev->rf_mode)) nfc_genl_send_device()
577 genlmsg_end(msg, hdr); nfc_genl_send_device()
581 genlmsg_cancel(msg, hdr); nfc_genl_send_device()
640 struct sk_buff *msg; nfc_genl_dep_link_up_event() local
645 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); nfc_genl_dep_link_up_event()
646 if (!msg) nfc_genl_dep_link_up_event()
649 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, NFC_CMD_DEP_LINK_UP); nfc_genl_dep_link_up_event()
653 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx)) nfc_genl_dep_link_up_event()
656 nla_put_u32(msg, NFC_ATTR_TARGET_INDEX, target_idx)) nfc_genl_dep_link_up_event()
658 if (nla_put_u8(msg, NFC_ATTR_COMM_MODE, comm_mode) || nfc_genl_dep_link_up_event()
659 nla_put_u8(msg, NFC_ATTR_RF_MODE, rf_mode)) nfc_genl_dep_link_up_event()
662 genlmsg_end(msg, hdr); nfc_genl_dep_link_up_event()
666 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC); nfc_genl_dep_link_up_event()
671 genlmsg_cancel(msg, hdr); nfc_genl_dep_link_up_event()
673 nlmsg_free(msg); nfc_genl_dep_link_up_event()
679 struct sk_buff *msg; nfc_genl_dep_link_down_event() local
684 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); nfc_genl_dep_link_down_event()
685 if (!msg) nfc_genl_dep_link_down_event()
688 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, nfc_genl_dep_link_down_event()
693 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx)) nfc_genl_dep_link_down_event()
696 genlmsg_end(msg, hdr); nfc_genl_dep_link_down_event()
698 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC); nfc_genl_dep_link_down_event()
703 genlmsg_cancel(msg, hdr); nfc_genl_dep_link_down_event()
705 nlmsg_free(msg); nfc_genl_dep_link_down_event()
711 struct sk_buff *msg; nfc_genl_get_device() local
725 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nfc_genl_get_device()
726 if (!msg) { nfc_genl_get_device()
731 rc = nfc_genl_send_device(msg, dev, info->snd_portid, info->snd_seq, nfc_genl_get_device()
738 return genlmsg_reply(msg, info); nfc_genl_get_device()
741 nlmsg_free(msg); nfc_genl_get_device()
951 static int nfc_genl_send_params(struct sk_buff *msg, nfc_genl_send_params() argument
957 hdr = genlmsg_put(msg, portid, seq, &nfc_genl_family, 0, nfc_genl_send_params()
962 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, local->dev->idx) || nfc_genl_send_params()
963 nla_put_u8(msg, NFC_ATTR_LLC_PARAM_LTO, local->lto) || nfc_genl_send_params()
964 nla_put_u8(msg, NFC_ATTR_LLC_PARAM_RW, local->rw) || nfc_genl_send_params()
965 nla_put_u16(msg, NFC_ATTR_LLC_PARAM_MIUX, be16_to_cpu(local->miux))) nfc_genl_send_params()
968 genlmsg_end(msg, hdr); nfc_genl_send_params()
973 genlmsg_cancel(msg, hdr); nfc_genl_send_params()
982 struct sk_buff *msg = NULL; nfc_genl_llc_get_params() local
1002 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nfc_genl_llc_get_params()
1003 if (!msg) { nfc_genl_llc_get_params()
1008 rc = nfc_genl_send_params(msg, local, info->snd_portid, info->snd_seq); nfc_genl_llc_get_params()
1016 if (msg) nfc_genl_llc_get_params()
1017 nlmsg_free(msg); nfc_genl_llc_get_params()
1022 return genlmsg_reply(msg, info); nfc_genl_llc_get_params()
1208 struct sk_buff *msg; nfc_genl_fw_download_done() local
1211 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nfc_genl_fw_download_done()
1212 if (!msg) nfc_genl_fw_download_done()
1215 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, nfc_genl_fw_download_done()
1220 if (nla_put_string(msg, NFC_ATTR_FIRMWARE_NAME, firmware_name) || nfc_genl_fw_download_done()
1221 nla_put_u32(msg, NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS, result) || nfc_genl_fw_download_done()
1222 nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx)) nfc_genl_fw_download_done()
1225 genlmsg_end(msg, hdr); nfc_genl_fw_download_done()
1227 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); nfc_genl_fw_download_done()
1232 genlmsg_cancel(msg, hdr); nfc_genl_fw_download_done()
1234 nlmsg_free(msg); nfc_genl_fw_download_done()
1284 static int nfc_genl_send_se(struct sk_buff *msg, struct nfc_dev *dev, nfc_genl_send_se() argument
1293 hdr = genlmsg_put(msg, portid, seq, &nfc_genl_family, flags, nfc_genl_send_se()
1301 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx) || nfc_genl_send_se()
1302 nla_put_u32(msg, NFC_ATTR_SE_INDEX, se->idx) || nfc_genl_send_se()
1303 nla_put_u8(msg, NFC_ATTR_SE_TYPE, se->type)) nfc_genl_send_se()
1306 genlmsg_end(msg, hdr); nfc_genl_send_se()
1312 genlmsg_cancel(msg, hdr); nfc_genl_send_se()
1421 struct sk_buff *msg; se_io_cb() local
1424 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); se_io_cb()
1425 if (!msg) { se_io_cb()
1430 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, se_io_cb()
1435 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, ctx->dev_idx) || se_io_cb()
1436 nla_put_u32(msg, NFC_ATTR_SE_INDEX, ctx->se_idx) || se_io_cb()
1437 nla_put(msg, NFC_ATTR_SE_APDU, apdu_len, apdu)) se_io_cb()
1440 genlmsg_end(msg, hdr); se_io_cb()
1442 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); se_io_cb()
1449 genlmsg_cancel(msg, hdr); se_io_cb()
1451 nlmsg_free(msg); se_io_cb()
/linux-4.4.14/drivers/media/dvb-frontends/
H A Ddibx000_common.c27 memset(mst->msg, 0, sizeof(struct i2c_msg)); dibx000_write_word()
28 mst->msg[0].addr = mst->i2c_addr; dibx000_write_word()
29 mst->msg[0].flags = 0; dibx000_write_word()
30 mst->msg[0].buf = mst->i2c_write_buffer; dibx000_write_word()
31 mst->msg[0].len = 4; dibx000_write_word()
33 ret = i2c_transfer(mst->i2c_adap, mst->msg, 1) != 1 ? -EREMOTEIO : 0; dibx000_write_word()
51 memset(mst->msg, 0, 2 * sizeof(struct i2c_msg)); dibx000_read_word()
52 mst->msg[0].addr = mst->i2c_addr; dibx000_read_word()
53 mst->msg[0].flags = 0; dibx000_read_word()
54 mst->msg[0].buf = mst->i2c_write_buffer; dibx000_read_word()
55 mst->msg[0].len = 2; dibx000_read_word()
56 mst->msg[1].addr = mst->i2c_addr; dibx000_read_word()
57 mst->msg[1].flags = I2C_M_RD; dibx000_read_word()
58 mst->msg[1].buf = mst->i2c_read_buffer; dibx000_read_word()
59 mst->msg[1].len = 2; dibx000_read_word()
61 if (i2c_transfer(mst->i2c_adap, mst->msg, 2) != 2) dibx000_read_word()
89 static int dibx000_master_i2c_write(struct dibx000_i2c_master *mst, struct i2c_msg *msg, u8 stop) dibx000_master_i2c_write() argument
94 u16 txlen = msg->len, len; dibx000_master_i2c_write()
95 const u8 *b = msg->buf; dibx000_master_i2c_write()
107 da = (((u8) (msg->addr)) << 9) | dibx000_master_i2c_write()
116 if (txlen == msg->len) dibx000_master_i2c_write()
132 static int dibx000_master_i2c_read(struct dibx000_i2c_master *mst, struct i2c_msg *msg) dibx000_master_i2c_read() argument
135 u8 *b = msg->buf; dibx000_master_i2c_read()
136 u16 rxlen = msg->len, len; dibx000_master_i2c_read()
140 da = (((u8) (msg->addr)) << 9) | dibx000_master_i2c_read()
149 if (rxlen == msg->len) dibx000_master_i2c_read()
202 static int dibx000_i2c_master_xfer_gpio12(struct i2c_adapter *i2c_adap, struct i2c_msg msg[], int num) dibx000_i2c_master_xfer_gpio12() argument
210 if (msg[msg_index].flags & I2C_M_RD) { dibx000_i2c_master_xfer_gpio12()
211 ret = dibx000_master_i2c_read(mst, &msg[msg_index]); dibx000_i2c_master_xfer_gpio12()
215 ret = dibx000_master_i2c_write(mst, &msg[msg_index], 1); dibx000_i2c_master_xfer_gpio12()
224 static int dibx000_i2c_master_xfer_gpio34(struct i2c_adapter *i2c_adap, struct i2c_msg msg[], int num) dibx000_i2c_master_xfer_gpio34() argument
232 if (msg[msg_index].flags & I2C_M_RD) { dibx000_i2c_master_xfer_gpio34()
233 ret = dibx000_master_i2c_read(mst, &msg[msg_index]); dibx000_i2c_master_xfer_gpio34()
237 ret = dibx000_master_i2c_write(mst, &msg[msg_index], 1); dibx000_i2c_master_xfer_gpio34()
279 struct i2c_msg msg[], int num) dibx000_i2c_gated_gpio67_xfer()
297 memset(mst->msg, 0, sizeof(struct i2c_msg) * (2 + num)); dibx000_i2c_gated_gpio67_xfer()
300 dibx000_i2c_gate_ctrl(mst, &mst->i2c_write_buffer[0], msg[0].addr, 1); dibx000_i2c_gated_gpio67_xfer()
301 mst->msg[0].addr = mst->i2c_addr; dibx000_i2c_gated_gpio67_xfer()
302 mst->msg[0].buf = &mst->i2c_write_buffer[0]; dibx000_i2c_gated_gpio67_xfer()
303 mst->msg[0].len = 4; dibx000_i2c_gated_gpio67_xfer()
305 memcpy(&mst->msg[1], msg, sizeof(struct i2c_msg) * num); dibx000_i2c_gated_gpio67_xfer()
309 mst->msg[num + 1].addr = mst->i2c_addr; dibx000_i2c_gated_gpio67_xfer()
310 mst->msg[num + 1].buf = &mst->i2c_write_buffer[4]; dibx000_i2c_gated_gpio67_xfer()
311 mst->msg[num + 1].len = 4; dibx000_i2c_gated_gpio67_xfer()
313 ret = (i2c_transfer(mst->i2c_adap, mst->msg, 2 + num) == 2 + num ? dibx000_i2c_gated_gpio67_xfer()
326 struct i2c_msg msg[], int num) dibx000_i2c_gated_tuner_xfer()
343 memset(mst->msg, 0, sizeof(struct i2c_msg) * (2 + num)); dibx000_i2c_gated_tuner_xfer()
346 dibx000_i2c_gate_ctrl(mst, &mst->i2c_write_buffer[0], msg[0].addr, 1); dibx000_i2c_gated_tuner_xfer()
347 mst->msg[0].addr = mst->i2c_addr; dibx000_i2c_gated_tuner_xfer()
348 mst->msg[0].buf = &mst->i2c_write_buffer[0]; dibx000_i2c_gated_tuner_xfer()
349 mst->msg[0].len = 4; dibx000_i2c_gated_tuner_xfer()
351 memcpy(&mst->msg[1], msg, sizeof(struct i2c_msg) * num); dibx000_i2c_gated_tuner_xfer()
355 mst->msg[num + 1].addr = mst->i2c_addr; dibx000_i2c_gated_tuner_xfer()
356 mst->msg[num + 1].buf = &mst->i2c_write_buffer[4]; dibx000_i2c_gated_tuner_xfer()
357 mst->msg[num + 1].len = 4; dibx000_i2c_gated_tuner_xfer()
359 ret = (i2c_transfer(mst->i2c_adap, mst->msg, 2 + num) == 2 + num ? dibx000_i2c_gated_tuner_xfer()
440 memset(mst->msg, 0, sizeof(struct i2c_msg)); dibx000_init_i2c_master()
441 mst->msg[0].addr = i2c_addr >> 1; dibx000_init_i2c_master()
442 mst->msg[0].flags = 0; dibx000_init_i2c_master()
443 mst->msg[0].buf = mst->i2c_write_buffer; dibx000_init_i2c_master()
444 mst->msg[0].len = 4; dibx000_init_i2c_master()
486 ret = (i2c_transfer(i2c_adap, mst->msg, 1) == 1); dibx000_init_i2c_master()
278 dibx000_i2c_gated_gpio67_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msg[], int num) dibx000_i2c_gated_gpio67_xfer() argument
325 dibx000_i2c_gated_tuner_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msg[], int num) dibx000_i2c_gated_tuner_xfer() argument
/linux-4.4.14/net/wimax/
H A DMakefile6 op-msg.o \
/linux-4.4.14/drivers/media/pci/saa7164/
H A Dsaa7164-bus.c112 dprintk(DBGLVL_BUS, "Dumping msg structure:\n"); saa7164_bus_dumpmsg()
134 int saa7164_bus_set(struct saa7164_dev *dev, struct tmComResInfo* msg, saa7164_bus_set() argument
143 if (!msg) { saa7164_bus_set()
144 printk(KERN_ERR "%s() !msg\n", __func__); saa7164_bus_set()
152 if (msg->size > dev->bus.m_wMaxReqSize) { saa7164_bus_set()
158 if ((msg->size > 0) && (buf == NULL)) { saa7164_bus_set()
166 bytes_to_write = sizeof(*msg) + msg->size; saa7164_bus_set()
189 /* Process the msg and write the content onto the bus */ saa7164_bus_set()
224 * Make a copy of msg->size before it is converted to le16 since it is saa7164_bus_set()
227 size = msg->size; saa7164_bus_set()
229 msg->size = (__force u16)cpu_to_le16(msg->size); saa7164_bus_set()
230 msg->command = (__force u32)cpu_to_le32(msg->command); saa7164_bus_set()
231 msg->controlselector = (__force u16)cpu_to_le16(msg->controlselector); saa7164_bus_set()
246 dprintk(DBGLVL_BUS, "%s() sizeof(*msg) = %d\n", __func__, saa7164_bus_set()
247 (u32)sizeof(*msg)); saa7164_bus_set()
249 if (space_rem < sizeof(*msg)) { saa7164_bus_set()
252 /* Split the msg into pieces as the ring wraps */ saa7164_bus_set()
253 memcpy_toio(bus->m_pdwSetRing + curr_swp, msg, space_rem); saa7164_bus_set()
254 memcpy_toio(bus->m_pdwSetRing, (u8 *)msg + space_rem, saa7164_bus_set()
255 sizeof(*msg) - space_rem); saa7164_bus_set()
257 memcpy_toio(bus->m_pdwSetRing + sizeof(*msg) - space_rem, saa7164_bus_set()
260 } else if (space_rem == sizeof(*msg)) { saa7164_bus_set()
264 memcpy_toio(bus->m_pdwSetRing + curr_swp, msg, sizeof(*msg)); saa7164_bus_set()
269 memcpy_toio(bus->m_pdwSetRing + curr_swp, msg, sizeof(*msg)); saa7164_bus_set()
272 sizeof(*msg), buf, space_rem - saa7164_bus_set()
273 sizeof(*msg)); saa7164_bus_set()
275 space_rem - sizeof(*msg), saa7164_bus_set()
286 memcpy_toio(bus->m_pdwSetRing + curr_swp, msg, sizeof(*msg)); saa7164_bus_set()
287 memcpy_toio(bus->m_pdwSetRing + curr_swp + sizeof(*msg), buf, saa7164_bus_set()
296 /* Convert back to cpu after writing the msg to the ringbuffer. */ saa7164_bus_set()
297 msg->size = le16_to_cpu((__force __le16)msg->size); saa7164_bus_set()
298 msg->command = le32_to_cpu((__force __le32)msg->command); saa7164_bus_set()
299 msg->controlselector = le16_to_cpu((__force __le16)msg->controlselector); saa7164_bus_set()
319 int saa7164_bus_get(struct saa7164_dev *dev, struct tmComResInfo* msg, saa7164_bus_get() argument
330 if (msg == NULL) saa7164_bus_get()
333 if (msg->size > dev->bus.m_wMaxReqSize) { saa7164_bus_get()
339 if ((peekonly == 0) && (msg->size > 0) && (buf == NULL)) { saa7164_bus_get()
341 "%s() Missing msg buf, size should be %d bytes\n", saa7164_bus_get()
342 __func__, msg->size); saa7164_bus_get()
348 /* Peek the bus to see if a msg exists, if it's not what we're expecting saa7164_bus_get()
359 bytes_to_read = sizeof(*msg); saa7164_bus_get()
400 memcpy(msg, &msg_tmp, sizeof(*msg)); saa7164_bus_get()
405 if ((msg_tmp.id != msg->id) || (msg_tmp.command != msg->command) || saa7164_bus_get()
406 (msg_tmp.controlselector != msg->controlselector) || saa7164_bus_get()
407 (msg_tmp.seqno != msg->seqno) || (msg_tmp.size != msg->size)) { saa7164_bus_get()
409 printk(KERN_ERR "%s() Unexpected msg miss-match\n", __func__); saa7164_bus_get()
410 saa7164_bus_dumpmsg(dev, msg, buf); saa7164_bus_get()
417 buf_size = msg->size; saa7164_bus_get()
419 bytes_to_read = sizeof(*msg) + msg->size; saa7164_bus_get()
430 printk(KERN_ERR "%s() Invalid bus state, missing msg " saa7164_bus_get()
444 if (space_rem < sizeof(*msg)) { saa7164_bus_get()
445 /* msg wraps around the ring */ saa7164_bus_get()
446 memcpy_fromio(msg, bus->m_pdwGetRing + curr_grp, space_rem); saa7164_bus_get()
447 memcpy_fromio((u8 *)msg + space_rem, bus->m_pdwGetRing, saa7164_bus_get()
448 sizeof(*msg) - space_rem); saa7164_bus_get()
450 memcpy_fromio(buf, bus->m_pdwGetRing + sizeof(*msg) - saa7164_bus_get()
453 } else if (space_rem == sizeof(*msg)) { saa7164_bus_get()
454 memcpy_fromio(msg, bus->m_pdwGetRing + curr_grp, sizeof(*msg)); saa7164_bus_get()
459 memcpy_fromio(msg, bus->m_pdwGetRing + curr_grp, sizeof(*msg)); saa7164_bus_get()
462 sizeof(*msg), space_rem - sizeof(*msg)); saa7164_bus_get()
463 memcpy_fromio(buf + space_rem - sizeof(*msg), saa7164_bus_get()
472 memcpy_fromio(msg, bus->m_pdwGetRing + curr_grp, sizeof(*msg)); saa7164_bus_get()
474 memcpy_fromio(buf, bus->m_pdwGetRing + curr_grp + sizeof(*msg), saa7164_bus_get()
478 msg->size = le16_to_cpu((__force __le16)msg->size); saa7164_bus_get()
479 msg->command = le32_to_cpu((__force __le32)msg->command); saa7164_bus_get()
480 msg->controlselector = le16_to_cpu((__force __le16)msg->controlselector); saa7164_bus_get()
/linux-4.4.14/drivers/pci/
H A Dhtirq.c26 void write_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg) write_ht_irq_msg() argument
32 if (cfg->msg.address_lo != msg->address_lo) { write_ht_irq_msg()
34 pci_write_config_dword(cfg->dev, cfg->pos + 4, msg->address_lo); write_ht_irq_msg()
36 if (cfg->msg.address_hi != msg->address_hi) { write_ht_irq_msg()
38 pci_write_config_dword(cfg->dev, cfg->pos + 4, msg->address_hi); write_ht_irq_msg()
41 cfg->update(cfg->dev, irq, msg); write_ht_irq_msg()
43 cfg->msg = *msg; write_ht_irq_msg()
46 void fetch_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg) fetch_ht_irq_msg() argument
50 *msg = cfg->msg; fetch_ht_irq_msg()
56 struct ht_irq_msg msg = cfg->msg; mask_ht_irq() local
58 msg.address_lo |= 1; mask_ht_irq()
59 write_ht_irq_msg(data->irq, &msg); mask_ht_irq()
65 struct ht_irq_msg msg = cfg->msg; unmask_ht_irq() local
67 msg.address_lo &= ~1; unmask_ht_irq()
68 write_ht_irq_msg(data->irq, &msg); unmask_ht_irq()
/linux-4.4.14/drivers/usb/serial/
H A Dkeyspan.c386 struct keyspan_usa26_portStatusMessage *msg; usa26_instat_callback() local
404 msg = (struct keyspan_usa26_portStatusMessage *)data; usa26_instat_callback()
407 if (msg->port >= serial->num_ports) { usa26_instat_callback()
408 dev_dbg(&urb->dev->dev, "%s - Unexpected port number %d\n", __func__, msg->port); usa26_instat_callback()
411 port = serial->port[msg->port]; usa26_instat_callback()
418 p_priv->cts_state = ((msg->hskia_cts) ? 1 : 0); usa26_instat_callback()
419 p_priv->dsr_state = ((msg->dsr) ? 1 : 0); usa26_instat_callback()
420 p_priv->dcd_state = ((msg->gpia_dcd) ? 1 : 0); usa26_instat_callback()
421 p_priv->ri_state = ((msg->ri) ? 1 : 0); usa26_instat_callback()
504 struct keyspan_usa28_portStatusMessage *msg; usa28_instat_callback() local
523 msg = (struct keyspan_usa28_portStatusMessage *)data; usa28_instat_callback()
526 if (msg->port >= serial->num_ports) { usa28_instat_callback()
527 dev_dbg(&urb->dev->dev, "%s - Unexpected port number %d\n", __func__, msg->port); usa28_instat_callback()
530 port = serial->port[msg->port]; usa28_instat_callback()
537 p_priv->cts_state = ((msg->cts) ? 1 : 0); usa28_instat_callback()
538 p_priv->dsr_state = ((msg->dsr) ? 1 : 0); usa28_instat_callback()
539 p_priv->dcd_state = ((msg->dcd) ? 1 : 0); usa28_instat_callback()
540 p_priv->ri_state = ((msg->ri) ? 1 : 0); usa28_instat_callback()
584 struct keyspan_usa49_portStatusMessage *msg; usa49_instat_callback() local
604 msg = (struct keyspan_usa49_portStatusMessage *)data; usa49_instat_callback()
607 if (msg->portNumber >= serial->num_ports) { usa49_instat_callback()
609 __func__, msg->portNumber); usa49_instat_callback()
612 port = serial->port[msg->portNumber]; usa49_instat_callback()
619 p_priv->cts_state = ((msg->cts) ? 1 : 0); usa49_instat_callback()
620 p_priv->dsr_state = ((msg->dsr) ? 1 : 0); usa49_instat_callback()
621 p_priv->dcd_state = ((msg->dcd) ? 1 : 0); usa49_instat_callback()
622 p_priv->ri_state = ((msg->ri) ? 1 : 0); usa49_instat_callback()
840 struct keyspan_usa90_portStatusMessage *msg; usa90_instat_callback() local
858 msg = (struct keyspan_usa90_portStatusMessage *)data; usa90_instat_callback()
869 p_priv->cts_state = ((msg->cts) ? 1 : 0); usa90_instat_callback()
870 p_priv->dsr_state = ((msg->dsr) ? 1 : 0); usa90_instat_callback()
871 p_priv->dcd_state = ((msg->dcd) ? 1 : 0); usa90_instat_callback()
872 p_priv->ri_state = ((msg->ri) ? 1 : 0); usa90_instat_callback()
905 struct keyspan_usa67_portStatusMessage *msg; usa67_instat_callback() local
927 msg = (struct keyspan_usa67_portStatusMessage *)data; usa67_instat_callback()
930 if (msg->port >= serial->num_ports) { usa67_instat_callback()
931 dev_dbg(&urb->dev->dev, "%s - Unexpected port number %d\n", __func__, msg->port); usa67_instat_callback()
935 port = serial->port[msg->port]; usa67_instat_callback()
942 p_priv->cts_state = ((msg->hskia_cts) ? 1 : 0); usa67_instat_callback()
943 p_priv->dcd_state = ((msg->gpia_dcd) ? 1 : 0); usa67_instat_callback()
1553 struct keyspan_usa26_portControlMessage msg; keyspan_usa26_send_setup() local
1587 memset(&msg, 0, sizeof(struct keyspan_usa26_portControlMessage)); keyspan_usa26_send_setup()
1592 msg.setClocking = 0xff; keyspan_usa26_send_setup()
1594 &msg.baudHi, &msg.baudLo, &msg.prescaler, keyspan_usa26_send_setup()
1598 msg.baudLo = 0; keyspan_usa26_send_setup()
1599 msg.baudHi = 125; /* Values for 9600 baud */ keyspan_usa26_send_setup()
1600 msg.prescaler = 10; keyspan_usa26_send_setup()
1602 msg.setPrescaler = 0xff; keyspan_usa26_send_setup()
1605 msg.lcr = (p_priv->cflag & CSTOPB) ? STOPBITS_678_2 : STOPBITS_5678_1; keyspan_usa26_send_setup()
1608 msg.lcr |= USA_DATABITS_5; keyspan_usa26_send_setup()
1611 msg.lcr |= USA_DATABITS_6; keyspan_usa26_send_setup()
1614 msg.lcr |= USA_DATABITS_7; keyspan_usa26_send_setup()
1617 msg.lcr |= USA_DATABITS_8; keyspan_usa26_send_setup()
1622 msg.lcr |= (p_priv->cflag & PARODD) ? keyspan_usa26_send_setup()
1625 msg.setLcr = 0xff; keyspan_usa26_send_setup()
1627 msg.ctsFlowControl = (p_priv->flow_control == flow_cts); keyspan_usa26_send_setup()
1628 msg.xonFlowControl = 0; keyspan_usa26_send_setup()
1629 msg.setFlowControl = 0xff; keyspan_usa26_send_setup()
1630 msg.forwardingLength = 16; keyspan_usa26_send_setup()
1631 msg.xonChar = 17; keyspan_usa26_send_setup()
1632 msg.xoffChar = 19; keyspan_usa26_send_setup()
1636 msg._txOn = 1; keyspan_usa26_send_setup()
1637 msg._txOff = 0; keyspan_usa26_send_setup()
1638 msg.txFlush = 0; keyspan_usa26_send_setup()
1639 msg.txBreak = 0; keyspan_usa26_send_setup()
1640 msg.rxOn = 1; keyspan_usa26_send_setup()
1641 msg.rxOff = 0; keyspan_usa26_send_setup()
1642 msg.rxFlush = 1; keyspan_usa26_send_setup()
1643 msg.rxForward = 0; keyspan_usa26_send_setup()
1644 msg.returnStatus = 0; keyspan_usa26_send_setup()
1645 msg.resetDataToggle = 0xff; keyspan_usa26_send_setup()
1650 msg._txOn = 0; keyspan_usa26_send_setup()
1651 msg._txOff = 1; keyspan_usa26_send_setup()
1652 msg.txFlush = 0; keyspan_usa26_send_setup()
1653 msg.txBreak = 0; keyspan_usa26_send_setup()
1654 msg.rxOn = 0; keyspan_usa26_send_setup()
1655 msg.rxOff = 1; keyspan_usa26_send_setup()
1656 msg.rxFlush = 1; keyspan_usa26_send_setup()
1657 msg.rxForward = 0; keyspan_usa26_send_setup()
1658 msg.returnStatus = 0; keyspan_usa26_send_setup()
1659 msg.resetDataToggle = 0; keyspan_usa26_send_setup()
1664 msg._txOn = (!p_priv->break_on); keyspan_usa26_send_setup()
1665 msg._txOff = 0; keyspan_usa26_send_setup()
1666 msg.txFlush = 0; keyspan_usa26_send_setup()
1667 msg.txBreak = (p_priv->break_on); keyspan_usa26_send_setup()
1668 msg.rxOn = 0; keyspan_usa26_send_setup()
1669 msg.rxOff = 0; keyspan_usa26_send_setup()
1670 msg.rxFlush = 0; keyspan_usa26_send_setup()
1671 msg.rxForward = 0; keyspan_usa26_send_setup()
1672 msg.returnStatus = 0; keyspan_usa26_send_setup()
1673 msg.resetDataToggle = 0x0; keyspan_usa26_send_setup()
1677 msg.setTxTriState_setRts = 0xff; keyspan_usa26_send_setup()
1678 msg.txTriState_rts = p_priv->rts_state; keyspan_usa26_send_setup()
1680 msg.setHskoa_setDtr = 0xff; keyspan_usa26_send_setup()
1681 msg.hskoa_dtr = p_priv->dtr_state; keyspan_usa26_send_setup()
1684 memcpy(this_urb->transfer_buffer, &msg, sizeof(msg)); keyspan_usa26_send_setup()
1687 this_urb->transfer_buffer_length = sizeof(msg); keyspan_usa26_send_setup()
1699 struct keyspan_usa28_portControlMessage msg; keyspan_usa28_send_setup() local
1728 memset(&msg, 0, sizeof(struct keyspan_usa28_portControlMessage)); keyspan_usa28_send_setup()
1730 msg.setBaudRate = 1; keyspan_usa28_send_setup()
1732 &msg.baudHi, &msg.baudLo, NULL, keyspan_usa28_send_setup()
1736 msg.baudLo = 0xff; keyspan_usa28_send_setup()
1737 msg.baudHi = 0xb2; /* Values for 9600 baud */ keyspan_usa28_send_setup()
1741 msg.parity = 0; /* XXX for now */ keyspan_usa28_send_setup()
1743 msg.ctsFlowControl = (p_priv->flow_control == flow_cts); keyspan_usa28_send_setup()
1744 msg.xonFlowControl = 0; keyspan_usa28_send_setup()
1747 msg.rts = p_priv->rts_state; keyspan_usa28_send_setup()
1748 msg.dtr = p_priv->dtr_state; keyspan_usa28_send_setup()
1750 msg.forwardingLength = 16; keyspan_usa28_send_setup()
1751 msg.forwardMs = 10; keyspan_usa28_send_setup()
1752 msg.breakThreshold = 45; keyspan_usa28_send_setup()
1753 msg.xonChar = 17; keyspan_usa28_send_setup()
1754 msg.xoffChar = 19; keyspan_usa28_send_setup()
1756 /*msg.returnStatus = 1; keyspan_usa28_send_setup()
1757 msg.resetDataToggle = 0xff;*/ keyspan_usa28_send_setup()
1760 msg._txOn = 1; keyspan_usa28_send_setup()
1761 msg._txOff = 0; keyspan_usa28_send_setup()
1762 msg.txFlush = 0; keyspan_usa28_send_setup()
1763 msg.txForceXoff = 0; keyspan_usa28_send_setup()
1764 msg.txBreak = 0; keyspan_usa28_send_setup()
1765 msg.rxOn = 1; keyspan_usa28_send_setup()
1766 msg.rxOff = 0; keyspan_usa28_send_setup()
1767 msg.rxFlush = 1; keyspan_usa28_send_setup()
1768 msg.rxForward = 0; keyspan_usa28_send_setup()
1769 msg.returnStatus = 0; keyspan_usa28_send_setup()
1770 msg.resetDataToggle = 0xff; keyspan_usa28_send_setup()
1774 msg._txOn = 0; keyspan_usa28_send_setup()
1775 msg._txOff = 1; keyspan_usa28_send_setup()
1776 msg.txFlush = 0; keyspan_usa28_send_setup()
1777 msg.txForceXoff = 0; keyspan_usa28_send_setup()
1778 msg.txBreak = 0; keyspan_usa28_send_setup()
1779 msg.rxOn = 0; keyspan_usa28_send_setup()
1780 msg.rxOff = 1; keyspan_usa28_send_setup()
1781 msg.rxFlush = 1; keyspan_usa28_send_setup()
1782 msg.rxForward = 0; keyspan_usa28_send_setup()
1783 msg.returnStatus = 0; keyspan_usa28_send_setup()
1784 msg.resetDataToggle = 0; keyspan_usa28_send_setup()
1788 msg._txOn = (!p_priv->break_on); keyspan_usa28_send_setup()
1789 msg._txOff = 0; keyspan_usa28_send_setup()
1790 msg.txFlush = 0; keyspan_usa28_send_setup()
1791 msg.txForceXoff = 0; keyspan_usa28_send_setup()
1792 msg.txBreak = (p_priv->break_on); keyspan_usa28_send_setup()
1793 msg.rxOn = 0; keyspan_usa28_send_setup()
1794 msg.rxOff = 0; keyspan_usa28_send_setup()
1795 msg.rxFlush = 0; keyspan_usa28_send_setup()
1796 msg.rxForward = 0; keyspan_usa28_send_setup()
1797 msg.returnStatus = 0; keyspan_usa28_send_setup()
1798 msg.resetDataToggle = 0x0; keyspan_usa28_send_setup()
1802 memcpy(this_urb->transfer_buffer, &msg, sizeof(msg)); keyspan_usa28_send_setup()
1805 this_urb->transfer_buffer_length = sizeof(msg); keyspan_usa28_send_setup()
1818 struct keyspan_usa49_portControlMessage msg; keyspan_usa49_send_setup() local
1855 memset(&msg, 0, sizeof(struct keyspan_usa49_portControlMessage)); keyspan_usa49_send_setup()
1857 msg.portNumber = device_port; keyspan_usa49_send_setup()
1862 msg.setClocking = 0xff; keyspan_usa49_send_setup()
1864 &msg.baudHi, &msg.baudLo, &msg.prescaler, keyspan_usa49_send_setup()
1868 msg.baudLo = 0; keyspan_usa49_send_setup()
1869 msg.baudHi = 125; /* Values for 9600 baud */ keyspan_usa49_send_setup()
1870 msg.prescaler = 10; keyspan_usa49_send_setup()
1872 /* msg.setPrescaler = 0xff; */ keyspan_usa49_send_setup()
1875 msg.lcr = (p_priv->cflag & CSTOPB) ? STOPBITS_678_2 : STOPBITS_5678_1; keyspan_usa49_send_setup()
1878 msg.lcr |= USA_DATABITS_5; keyspan_usa49_send_setup()
1881 msg.lcr |= USA_DATABITS_6; keyspan_usa49_send_setup()
1884 msg.lcr |= USA_DATABITS_7; keyspan_usa49_send_setup()
1887 msg.lcr |= USA_DATABITS_8; keyspan_usa49_send_setup()
1892 msg.lcr |= (p_priv->cflag & PARODD) ? keyspan_usa49_send_setup()
1895 msg.setLcr = 0xff; keyspan_usa49_send_setup()
1897 msg.ctsFlowControl = (p_priv->flow_control == flow_cts); keyspan_usa49_send_setup()
1898 msg.xonFlowControl = 0; keyspan_usa49_send_setup()
1899 msg.setFlowControl = 0xff; keyspan_usa49_send_setup()
1901 msg.forwardingLength = 16; keyspan_usa49_send_setup()
1902 msg.xonChar = 17; keyspan_usa49_send_setup()
1903 msg.xoffChar = 19; keyspan_usa49_send_setup()
1907 msg._txOn = 1; keyspan_usa49_send_setup()
1908 msg._txOff = 0; keyspan_usa49_send_setup()
1909 msg.txFlush = 0; keyspan_usa49_send_setup()
1910 msg.txBreak = 0; keyspan_usa49_send_setup()
1911 msg.rxOn = 1; keyspan_usa49_send_setup()
1912 msg.rxOff = 0; keyspan_usa49_send_setup()
1913 msg.rxFlush = 1; keyspan_usa49_send_setup()
1914 msg.rxForward = 0; keyspan_usa49_send_setup()
1915 msg.returnStatus = 0; keyspan_usa49_send_setup()
1916 msg.resetDataToggle = 0xff; keyspan_usa49_send_setup()
1917 msg.enablePort = 1; keyspan_usa49_send_setup()
1918 msg.disablePort = 0; keyspan_usa49_send_setup()
1922 msg._txOn = 0; keyspan_usa49_send_setup()
1923 msg._txOff = 1; keyspan_usa49_send_setup()
1924 msg.txFlush = 0; keyspan_usa49_send_setup()
1925 msg.txBreak = 0; keyspan_usa49_send_setup()
1926 msg.rxOn = 0; keyspan_usa49_send_setup()
1927 msg.rxOff = 1; keyspan_usa49_send_setup()
1928 msg.rxFlush = 1; keyspan_usa49_send_setup()
1929 msg.rxForward = 0; keyspan_usa49_send_setup()
1930 msg.returnStatus = 0; keyspan_usa49_send_setup()
1931 msg.resetDataToggle = 0; keyspan_usa49_send_setup()
1932 msg.enablePort = 0; keyspan_usa49_send_setup()
1933 msg.disablePort = 1; keyspan_usa49_send_setup()
1937 msg._txOn = (!p_priv->break_on); keyspan_usa49_send_setup()
1938 msg._txOff = 0; keyspan_usa49_send_setup()
1939 msg.txFlush = 0; keyspan_usa49_send_setup()
1940 msg.txBreak = (p_priv->break_on); keyspan_usa49_send_setup()
1941 msg.rxOn = 0; keyspan_usa49_send_setup()
1942 msg.rxOff = 0; keyspan_usa49_send_setup()
1943 msg.rxFlush = 0; keyspan_usa49_send_setup()
1944 msg.rxForward = 0; keyspan_usa49_send_setup()
1945 msg.returnStatus = 0; keyspan_usa49_send_setup()
1946 msg.resetDataToggle = 0x0; keyspan_usa49_send_setup()
1947 msg.enablePort = 0; keyspan_usa49_send_setup()
1948 msg.disablePort = 0; keyspan_usa49_send_setup()
1952 msg.setRts = 0xff; keyspan_usa49_send_setup()
1953 msg.rts = p_priv->rts_state; keyspan_usa49_send_setup()
1955 msg.setDtr = 0xff; keyspan_usa49_send_setup()
1956 msg.dtr = p_priv->dtr_state; keyspan_usa49_send_setup()
1969 dr->wLength = cpu_to_le16(sizeof(msg)); keyspan_usa49_send_setup()
1971 memcpy(s_priv->glocont_buf, &msg, sizeof(msg)); keyspan_usa49_send_setup()
1976 sizeof(msg), usa49_glocont_callback, serial); keyspan_usa49_send_setup()
1979 memcpy(this_urb->transfer_buffer, &msg, sizeof(msg)); keyspan_usa49_send_setup()
1982 this_urb->transfer_buffer_length = sizeof(msg); keyspan_usa49_send_setup()
1995 struct keyspan_usa90_portControlMessage msg; keyspan_usa90_send_setup() local
2024 memset(&msg, 0, sizeof(struct keyspan_usa90_portControlMessage)); keyspan_usa90_send_setup()
2029 msg.setClocking = 0x01; keyspan_usa90_send_setup()
2031 &msg.baudHi, &msg.baudLo, &prescaler, 0) == KEYSPAN_INVALID_BAUD_RATE) { keyspan_usa90_send_setup()
2036 &msg.baudHi, &msg.baudLo, &prescaler, 0); keyspan_usa90_send_setup()
2038 msg.setRxMode = 1; keyspan_usa90_send_setup()
2039 msg.setTxMode = 1; keyspan_usa90_send_setup()
2044 msg.rxMode = RXMODE_DMA; keyspan_usa90_send_setup()
2045 msg.txMode = TXMODE_DMA; keyspan_usa90_send_setup()
2047 msg.rxMode = RXMODE_BYHAND; keyspan_usa90_send_setup()
2048 msg.txMode = TXMODE_BYHAND; keyspan_usa90_send_setup()
2051 msg.lcr = (p_priv->cflag & CSTOPB) ? STOPBITS_678_2 : STOPBITS_5678_1; keyspan_usa90_send_setup()
2054 msg.lcr |= USA_DATABITS_5; keyspan_usa90_send_setup()
2057 msg.lcr |= USA_DATABITS_6; keyspan_usa90_send_setup()
2060 msg.lcr |= USA_DATABITS_7; keyspan_usa90_send_setup()
2063 msg.lcr |= USA_DATABITS_8; keyspan_usa90_send_setup()
2068 msg.lcr |= (p_priv->cflag & PARODD) ? keyspan_usa90_send_setup()
2073 msg.setLcr = 0x01; keyspan_usa90_send_setup()
2077 msg.txFlowControl = TXFLOW_CTS; keyspan_usa90_send_setup()
2078 msg.setTxFlowControl = 0x01; keyspan_usa90_send_setup()
2079 msg.setRxFlowControl = 0x01; keyspan_usa90_send_setup()
2081 msg.rxForwardingLength = 16; keyspan_usa90_send_setup()
2082 msg.rxForwardingTimeout = 16; keyspan_usa90_send_setup()
2083 msg.txAckSetting = 0; keyspan_usa90_send_setup()
2084 msg.xonChar = 17; keyspan_usa90_send_setup()
2085 msg.xoffChar = 19; keyspan_usa90_send_setup()
2089 msg.portEnabled = 1; keyspan_usa90_send_setup()
2090 msg.rxFlush = 1; keyspan_usa90_send_setup()
2091 msg.txBreak = (p_priv->break_on); keyspan_usa90_send_setup()
2095 msg.portEnabled = 0; keyspan_usa90_send_setup()
2098 msg.portEnabled = 1; keyspan_usa90_send_setup()
2099 msg.txBreak = (p_priv->break_on); keyspan_usa90_send_setup()
2103 msg.setRts = 0x01; keyspan_usa90_send_setup()
2104 msg.rts = p_priv->rts_state; keyspan_usa90_send_setup()
2106 msg.setDtr = 0x01; keyspan_usa90_send_setup()
2107 msg.dtr = p_priv->dtr_state; keyspan_usa90_send_setup()
2110 memcpy(this_urb->transfer_buffer, &msg, sizeof(msg)); keyspan_usa90_send_setup()
2113 this_urb->transfer_buffer_length = sizeof(msg); keyspan_usa90_send_setup()
2125 struct keyspan_usa67_portControlMessage msg; keyspan_usa67_send_setup() local
2157 memset(&msg, 0, sizeof(struct keyspan_usa67_portControlMessage)); keyspan_usa67_send_setup()
2159 msg.port = device_port; keyspan_usa67_send_setup()
2164 msg.setClocking = 0xff; keyspan_usa67_send_setup()
2166 &msg.baudHi, &msg.baudLo, &msg.prescaler, keyspan_usa67_send_setup()
2170 msg.baudLo = 0; keyspan_usa67_send_setup()
2171 msg.baudHi = 125; /* Values for 9600 baud */ keyspan_usa67_send_setup()
2172 msg.prescaler = 10; keyspan_usa67_send_setup()
2174 msg.setPrescaler = 0xff; keyspan_usa67_send_setup()
2177 msg.lcr = (p_priv->cflag & CSTOPB) ? STOPBITS_678_2 : STOPBITS_5678_1; keyspan_usa67_send_setup()
2180 msg.lcr |= USA_DATABITS_5; keyspan_usa67_send_setup()
2183 msg.lcr |= USA_DATABITS_6; keyspan_usa67_send_setup()
2186 msg.lcr |= USA_DATABITS_7; keyspan_usa67_send_setup()
2189 msg.lcr |= USA_DATABITS_8; keyspan_usa67_send_setup()
2194 msg.lcr |= (p_priv->cflag & PARODD) ? keyspan_usa67_send_setup()
2197 msg.setLcr = 0xff; keyspan_usa67_send_setup()
2199 msg.ctsFlowControl = (p_priv->flow_control == flow_cts); keyspan_usa67_send_setup()
2200 msg.xonFlowControl = 0; keyspan_usa67_send_setup()
2201 msg.setFlowControl = 0xff; keyspan_usa67_send_setup()
2202 msg.forwardingLength = 16; keyspan_usa67_send_setup()
2203 msg.xonChar = 17; keyspan_usa67_send_setup()
2204 msg.xoffChar = 19; keyspan_usa67_send_setup()
2208 msg._txOn = 1; keyspan_usa67_send_setup()
2209 msg._txOff = 0; keyspan_usa67_send_setup()
2210 msg.txFlush = 0; keyspan_usa67_send_setup()
2211 msg.txBreak = 0; keyspan_usa67_send_setup()
2212 msg.rxOn = 1; keyspan_usa67_send_setup()
2213 msg.rxOff = 0; keyspan_usa67_send_setup()
2214 msg.rxFlush = 1; keyspan_usa67_send_setup()
2215 msg.rxForward = 0; keyspan_usa67_send_setup()
2216 msg.returnStatus = 0; keyspan_usa67_send_setup()
2217 msg.resetDataToggle = 0xff; keyspan_usa67_send_setup()
2220 msg._txOn = 0; keyspan_usa67_send_setup()
2221 msg._txOff = 1; keyspan_usa67_send_setup()
2222 msg.txFlush = 0; keyspan_usa67_send_setup()
2223 msg.txBreak = 0; keyspan_usa67_send_setup()
2224 msg.rxOn = 0; keyspan_usa67_send_setup()
2225 msg.rxOff = 1; keyspan_usa67_send_setup()
2226 msg.rxFlush = 1; keyspan_usa67_send_setup()
2227 msg.rxForward = 0; keyspan_usa67_send_setup()
2228 msg.returnStatus = 0; keyspan_usa67_send_setup()
2229 msg.resetDataToggle = 0; keyspan_usa67_send_setup()
2232 msg._txOn = (!p_priv->break_on); keyspan_usa67_send_setup()
2233 msg._txOff = 0; keyspan_usa67_send_setup()
2234 msg.txFlush = 0; keyspan_usa67_send_setup()
2235 msg.txBreak = (p_priv->break_on); keyspan_usa67_send_setup()
2236 msg.rxOn = 0; keyspan_usa67_send_setup()
2237 msg.rxOff = 0; keyspan_usa67_send_setup()
2238 msg.rxFlush = 0; keyspan_usa67_send_setup()
2239 msg.rxForward = 0; keyspan_usa67_send_setup()
2240 msg.returnStatus = 0; keyspan_usa67_send_setup()
2241 msg.resetDataToggle = 0x0; keyspan_usa67_send_setup()
2245 msg.setTxTriState_setRts = 0xff; keyspan_usa67_send_setup()
2246 msg.txTriState_rts = p_priv->rts_state; keyspan_usa67_send_setup()
2248 msg.setHskoa_setDtr = 0xff; keyspan_usa67_send_setup()
2249 msg.hskoa_dtr = p_priv->dtr_state; keyspan_usa67_send_setup()
2253 memcpy(this_urb->transfer_buffer, &msg, sizeof(msg)); keyspan_usa67_send_setup()
2256 this_urb->transfer_buffer_length = sizeof(msg); keyspan_usa67_send_setup()
/linux-4.4.14/drivers/media/common/siano/
H A Dsmsendian.c31 struct sms_msg_data *msg = (struct sms_msg_data *)buffer; smsendian_handle_tx_message() local
35 switch (msg->x_msg_header.msg_type) { smsendian_handle_tx_message()
38 msg->msg_data[0] = le32_to_cpu(msg->msg_data[0]); smsendian_handle_tx_message()
43 msg_words = (msg->x_msg_header.msg_length - smsendian_handle_tx_message()
47 msg->msg_data[i] = le32_to_cpu(msg->msg_data[i]); smsendian_handle_tx_message()
58 struct sms_msg_data *msg = (struct sms_msg_data *)buffer; smsendian_handle_rx_message() local
62 switch (msg->x_msg_header.msg_type) { smsendian_handle_rx_message()
66 (struct sms_version_res *) msg; smsendian_handle_rx_message()
80 msg_words = (msg->x_msg_header.msg_length - smsendian_handle_rx_message()
84 msg->msg_data[i] = le32_to_cpu(msg->msg_data[i]); smsendian_handle_rx_message()
93 void smsendian_handle_message_header(void *msg) smsendian_handle_message_header() argument
96 struct sms_msg_hdr *phdr = (struct sms_msg_hdr *)msg; smsendian_handle_message_header()
/linux-4.4.14/net/tipc/
H A Dnetlink_compat.c67 int (*format)(struct tipc_nl_compat_msg *msg, struct nlattr **attrs);
73 struct sk_buff *skb, struct tipc_nl_compat_msg *msg);
170 struct tipc_nl_compat_msg *msg, __tipc_nl_compat_dumpit()
187 buf->sk = msg->dst_sk; __tipc_nl_compat_dumpit()
201 err = (*cmd->format)(msg, attrs); nlmsg_for_each_msg()
205 if (tipc_skb_tailroom(msg->rep) <= 1) { nlmsg_for_each_msg()
225 if ((TIPC_SKB_MAX - msg->rep->len) <= 1) {
226 char *tail = skb_tail_pointer(msg->rep);
240 struct tipc_nl_compat_msg *msg) tipc_nl_compat_dumpit()
245 if (msg->req_type && !TLV_CHECK_TYPE(msg->req, msg->req_type)) tipc_nl_compat_dumpit()
248 msg->rep = tipc_tlv_alloc(msg->rep_size); tipc_nl_compat_dumpit()
249 if (!msg->rep) tipc_nl_compat_dumpit()
252 if (msg->rep_type) tipc_nl_compat_dumpit()
253 tipc_tlv_init(msg->rep, msg->rep_type); tipc_nl_compat_dumpit()
256 (*cmd->header)(msg); tipc_nl_compat_dumpit()
260 kfree_skb(msg->rep); tipc_nl_compat_dumpit()
264 err = __tipc_nl_compat_dumpit(cmd, msg, arg); tipc_nl_compat_dumpit()
266 kfree_skb(msg->rep); tipc_nl_compat_dumpit()
274 struct tipc_nl_compat_msg *msg) __tipc_nl_compat_doit()
286 err = (*cmd->transcode)(cmd, trans_buf, msg); __tipc_nl_compat_doit()
309 doit_buf->sk = msg->dst_sk; __tipc_nl_compat_doit()
326 struct tipc_nl_compat_msg *msg) tipc_nl_compat_doit()
330 if (msg->req_type && !TLV_CHECK_TYPE(msg->req, msg->req_type)) tipc_nl_compat_doit()
333 err = __tipc_nl_compat_doit(cmd, msg); tipc_nl_compat_doit()
338 msg->rep = tipc_tlv_alloc(0); tipc_nl_compat_doit()
339 if (!msg->rep) tipc_nl_compat_doit()
345 static int tipc_nl_compat_bearer_dump(struct tipc_nl_compat_msg *msg, tipc_nl_compat_bearer_dump() argument
353 return tipc_add_tlv(msg->rep, TIPC_TLV_BEARER_NAME, tipc_nl_compat_bearer_dump()
360 struct tipc_nl_compat_msg *msg) tipc_nl_compat_bearer_enable()
366 b = (struct tipc_bearer_config *)TLV_DATA(msg->req); tipc_nl_compat_bearer_enable()
393 struct tipc_nl_compat_msg *msg) tipc_nl_compat_bearer_disable()
398 name = (char *)TLV_DATA(msg->req); tipc_nl_compat_bearer_disable()
417 static void __fill_bc_link_stat(struct tipc_nl_compat_msg *msg, __fill_bc_link_stat() argument
420 tipc_tlv_sprintf(msg->rep, " Window:%u packets\n", __fill_bc_link_stat()
423 tipc_tlv_sprintf(msg->rep, __fill_bc_link_stat()
431 tipc_tlv_sprintf(msg->rep, __fill_bc_link_stat()
439 tipc_tlv_sprintf(msg->rep, " RX naks:%u defs:%u dups:%u\n", __fill_bc_link_stat()
444 tipc_tlv_sprintf(msg->rep, " TX naks:%u acks:%u dups:%u\n", __fill_bc_link_stat()
449 tipc_tlv_sprintf(msg->rep, __fill_bc_link_stat()
456 static int tipc_nl_compat_link_stat_dump(struct tipc_nl_compat_msg *msg, tipc_nl_compat_link_stat_dump() argument
472 name = (char *)TLV_DATA(msg->req); tipc_nl_compat_link_stat_dump()
476 tipc_tlv_sprintf(msg->rep, "\nLink <%s>\n", tipc_nl_compat_link_stat_dump()
480 __fill_bc_link_stat(msg, prop, stats); tipc_nl_compat_link_stat_dump()
485 tipc_tlv_sprintf(msg->rep, " ACTIVE"); tipc_nl_compat_link_stat_dump()
487 tipc_tlv_sprintf(msg->rep, " STANDBY"); tipc_nl_compat_link_stat_dump()
489 tipc_tlv_sprintf(msg->rep, " DEFUNCT"); tipc_nl_compat_link_stat_dump()
491 tipc_tlv_sprintf(msg->rep, " MTU:%u Priority:%u", tipc_nl_compat_link_stat_dump()
495 tipc_tlv_sprintf(msg->rep, " Tolerance:%u ms Window:%u packets\n", tipc_nl_compat_link_stat_dump()
499 tipc_tlv_sprintf(msg->rep, tipc_nl_compat_link_stat_dump()
508 tipc_tlv_sprintf(msg->rep, tipc_nl_compat_link_stat_dump()
517 tipc_tlv_sprintf(msg->rep, tipc_nl_compat_link_stat_dump()
523 tipc_tlv_sprintf(msg->rep, tipc_nl_compat_link_stat_dump()
534 tipc_tlv_sprintf(msg->rep, "-16384:%u%% -32768:%u%% -66000:%u%%\n", tipc_nl_compat_link_stat_dump()
542 tipc_tlv_sprintf(msg->rep, tipc_nl_compat_link_stat_dump()
550 tipc_tlv_sprintf(msg->rep, tipc_nl_compat_link_stat_dump()
558 tipc_tlv_sprintf(msg->rep, tipc_nl_compat_link_stat_dump()
567 static int tipc_nl_compat_link_dump(struct tipc_nl_compat_msg *msg, tipc_nl_compat_link_dump() argument
579 return tipc_add_tlv(msg->rep, TIPC_TLV_LINK_INFO, tipc_nl_compat_link_dump()
584 struct tipc_nl_compat_msg *msg, __tipc_add_link_prop()
587 switch (msg->cmd) { __tipc_add_link_prop()
600 struct tipc_nl_compat_msg *msg) tipc_nl_compat_media_set()
606 lc = (struct tipc_link_config *)TLV_DATA(msg->req); tipc_nl_compat_media_set()
619 __tipc_add_link_prop(skb, msg, lc); tipc_nl_compat_media_set()
627 struct tipc_nl_compat_msg *msg) tipc_nl_compat_bearer_set()
633 lc = (struct tipc_link_config *)TLV_DATA(msg->req); tipc_nl_compat_bearer_set()
646 __tipc_add_link_prop(skb, msg, lc); tipc_nl_compat_bearer_set()
654 struct tipc_nl_compat_msg *msg) __tipc_nl_compat_link_set()
660 lc = (struct tipc_link_config *)TLV_DATA(msg->req); __tipc_nl_compat_link_set()
673 __tipc_add_link_prop(skb, msg, lc); __tipc_nl_compat_link_set()
682 struct tipc_nl_compat_msg *msg) tipc_nl_compat_link_set()
688 lc = (struct tipc_link_config *)TLV_DATA(msg->req); tipc_nl_compat_link_set()
693 return tipc_nl_compat_media_set(skb, msg); tipc_nl_compat_link_set()
696 bearer = tipc_bearer_find(msg->net, lc->name); tipc_nl_compat_link_set()
699 return tipc_nl_compat_bearer_set(skb, msg); tipc_nl_compat_link_set()
702 return __tipc_nl_compat_link_set(skb, msg); tipc_nl_compat_link_set()
707 struct tipc_nl_compat_msg *msg) tipc_nl_compat_link_reset_stats()
712 name = (char *)TLV_DATA(msg->req); tipc_nl_compat_link_reset_stats()
726 static int tipc_nl_compat_name_table_dump_header(struct tipc_nl_compat_msg *msg) tipc_nl_compat_name_table_dump_header() argument
738 ntq = (struct tipc_name_table_query *)TLV_DATA(msg->req); tipc_nl_compat_name_table_dump_header()
745 tipc_tlv_sprintf(msg->rep, header[i]); tipc_nl_compat_name_table_dump_header()
746 tipc_tlv_sprintf(msg->rep, "\n"); tipc_nl_compat_name_table_dump_header()
751 static int tipc_nl_compat_name_table_dump(struct tipc_nl_compat_msg *msg, tipc_nl_compat_name_table_dump() argument
768 ntq = (struct tipc_name_table_query *)TLV_DATA(msg->req); tipc_nl_compat_name_table_dump()
783 tipc_tlv_sprintf(msg->rep, "%-10u ", tipc_nl_compat_name_table_dump()
789 tipc_tlv_sprintf(msg->rep, "%-10u %-10u ", tipc_nl_compat_name_table_dump()
799 tipc_tlv_sprintf(msg->rep, "%-26s ", port_str); tipc_nl_compat_name_table_dump()
804 tipc_tlv_sprintf(msg->rep, "%-10u %s", tipc_nl_compat_name_table_dump()
808 tipc_tlv_sprintf(msg->rep, "\n"); tipc_nl_compat_name_table_dump()
813 static int __tipc_nl_compat_publ_dump(struct tipc_nl_compat_msg *msg, __tipc_nl_compat_publ_dump() argument
826 tipc_tlv_sprintf(msg->rep, " {%u,%u}", type, lower); __tipc_nl_compat_publ_dump()
828 tipc_tlv_sprintf(msg->rep, " {%u,%u,%u}", type, lower, upper); __tipc_nl_compat_publ_dump()
833 static int tipc_nl_compat_publ_dump(struct tipc_nl_compat_msg *msg, u32 sock) tipc_nl_compat_publ_dump() argument
865 err = __tipc_nl_compat_dumpit(&dump, msg, args); tipc_nl_compat_publ_dump()
872 static int tipc_nl_compat_sk_dump(struct tipc_nl_compat_msg *msg, tipc_nl_compat_sk_dump() argument
882 tipc_tlv_sprintf(msg->rep, "%u:", sock_ref); tipc_nl_compat_sk_dump()
892 tipc_tlv_sprintf(msg->rep, " connected to <%u.%u.%u:%u>", tipc_nl_compat_sk_dump()
899 tipc_tlv_sprintf(msg->rep, " via {%u,%u}\n", tipc_nl_compat_sk_dump()
903 tipc_tlv_sprintf(msg->rep, "\n"); tipc_nl_compat_sk_dump()
905 tipc_tlv_sprintf(msg->rep, " bound to"); tipc_nl_compat_sk_dump()
907 err = tipc_nl_compat_publ_dump(msg, sock_ref); tipc_nl_compat_sk_dump()
911 tipc_tlv_sprintf(msg->rep, "\n"); tipc_nl_compat_sk_dump()
916 static int tipc_nl_compat_media_dump(struct tipc_nl_compat_msg *msg, tipc_nl_compat_media_dump() argument
924 return tipc_add_tlv(msg->rep, TIPC_TLV_MEDIA_NAME, tipc_nl_compat_media_dump()
929 static int tipc_nl_compat_node_dump(struct tipc_nl_compat_msg *msg, tipc_nl_compat_node_dump() argument
940 return tipc_add_tlv(msg->rep, TIPC_TLV_NODE_INFO, &node_info, tipc_nl_compat_node_dump()
946 struct tipc_nl_compat_msg *msg) tipc_nl_compat_net_set()
951 val = ntohl(*(__be32 *)TLV_DATA(msg->req)); tipc_nl_compat_net_set()
957 if (msg->cmd == TIPC_CMD_SET_NODE_ADDR) { tipc_nl_compat_net_set()
960 } else if (msg->cmd == TIPC_CMD_SET_NETID) { tipc_nl_compat_net_set()
969 static int tipc_nl_compat_net_dump(struct tipc_nl_compat_msg *msg, tipc_nl_compat_net_dump() argument
978 return tipc_add_tlv(msg->rep, TIPC_TLV_UNSIGNED, &id, sizeof(id)); tipc_nl_compat_net_dump()
981 static int tipc_cmd_show_stats_compat(struct tipc_nl_compat_msg *msg) tipc_cmd_show_stats_compat() argument
983 msg->rep = tipc_tlv_alloc(ULTRA_STRING_MAX_LEN); tipc_cmd_show_stats_compat()
984 if (!msg->rep) tipc_cmd_show_stats_compat()
987 tipc_tlv_init(msg->rep, TIPC_TLV_ULTRA_STRING); tipc_cmd_show_stats_compat()
988 tipc_tlv_sprintf(msg->rep, "TIPC version " TIPC_MOD_VER "\n"); tipc_cmd_show_stats_compat()
993 static int tipc_nl_compat_handle(struct tipc_nl_compat_msg *msg) tipc_nl_compat_handle() argument
1001 switch (msg->cmd) { tipc_nl_compat_handle()
1003 msg->rep = tipc_tlv_alloc(0); tipc_nl_compat_handle()
1004 if (!msg->rep) tipc_nl_compat_handle()
1008 msg->rep_size = MAX_BEARERS * TLV_SPACE(TIPC_MAX_BEARER_NAME); tipc_nl_compat_handle()
1011 return tipc_nl_compat_dumpit(&dump, msg); tipc_nl_compat_handle()
1013 msg->req_type = TIPC_TLV_BEARER_CONFIG; tipc_nl_compat_handle()
1016 return tipc_nl_compat_doit(&doit, msg); tipc_nl_compat_handle()
1018 msg->req_type = TIPC_TLV_BEARER_NAME; tipc_nl_compat_handle()
1021 return tipc_nl_compat_doit(&doit, msg); tipc_nl_compat_handle()
1023 msg->req_type = TIPC_TLV_LINK_NAME; tipc_nl_compat_handle()
1024 msg->rep_size = ULTRA_STRING_MAX_LEN; tipc_nl_compat_handle()
1025 msg->rep_type = TIPC_TLV_ULTRA_STRING; tipc_nl_compat_handle()
1028 return tipc_nl_compat_dumpit(&dump, msg); tipc_nl_compat_handle()
1030 msg->req_type = TIPC_TLV_NET_ADDR; tipc_nl_compat_handle()
1031 msg->rep_size = ULTRA_STRING_MAX_LEN; tipc_nl_compat_handle()
1034 return tipc_nl_compat_dumpit(&dump, msg); tipc_nl_compat_handle()
1038 msg->req_type = TIPC_TLV_LINK_CONFIG; tipc_nl_compat_handle()
1041 return tipc_nl_compat_doit(&doit, msg); tipc_nl_compat_handle()
1043 msg->req_type = TIPC_TLV_LINK_NAME; tipc_nl_compat_handle()
1046 return tipc_nl_compat_doit(&doit, msg); tipc_nl_compat_handle()
1048 msg->req_type = TIPC_TLV_NAME_TBL_QUERY; tipc_nl_compat_handle()
1049 msg->rep_size = ULTRA_STRING_MAX_LEN; tipc_nl_compat_handle()
1050 msg->rep_type = TIPC_TLV_ULTRA_STRING; tipc_nl_compat_handle()
1054 return tipc_nl_compat_dumpit(&dump, msg); tipc_nl_compat_handle()
1056 msg->rep_size = ULTRA_STRING_MAX_LEN; tipc_nl_compat_handle()
1057 msg->rep_type = TIPC_TLV_ULTRA_STRING; tipc_nl_compat_handle()
1060 return tipc_nl_compat_dumpit(&dump, msg); tipc_nl_compat_handle()
1062 msg->rep_size = MAX_MEDIA * TLV_SPACE(TIPC_MAX_MEDIA_NAME); tipc_nl_compat_handle()
1065 return tipc_nl_compat_dumpit(&dump, msg); tipc_nl_compat_handle()
1067 msg->rep_size = ULTRA_STRING_MAX_LEN; tipc_nl_compat_handle()
1070 return tipc_nl_compat_dumpit(&dump, msg); tipc_nl_compat_handle()
1072 msg->req_type = TIPC_TLV_NET_ADDR; tipc_nl_compat_handle()
1075 return tipc_nl_compat_doit(&doit, msg); tipc_nl_compat_handle()
1077 msg->req_type = TIPC_TLV_UNSIGNED; tipc_nl_compat_handle()
1080 return tipc_nl_compat_doit(&doit, msg); tipc_nl_compat_handle()
1082 msg->rep_size = sizeof(u32); tipc_nl_compat_handle()
1085 return tipc_nl_compat_dumpit(&dump, msg); tipc_nl_compat_handle()
1087 return tipc_cmd_show_stats_compat(msg); tipc_nl_compat_handle()
1097 struct tipc_nl_compat_msg msg; tipc_nl_compat_recv() local
1102 memset(&msg, 0, sizeof(msg)); tipc_nl_compat_recv()
1105 msg.req = nlmsg_data(req_nlh) + GENL_HDRLEN + TIPC_GENL_HDRLEN; tipc_nl_compat_recv()
1106 msg.cmd = req_userhdr->cmd; tipc_nl_compat_recv()
1107 msg.dst_sk = info->dst_sk; tipc_nl_compat_recv()
1108 msg.net = genl_info_net(info); tipc_nl_compat_recv()
1110 if ((msg.cmd & 0xC000) && (!netlink_net_capable(skb, CAP_NET_ADMIN))) { tipc_nl_compat_recv()
1111 msg.rep = tipc_get_err_tlv(TIPC_CFG_NOT_NET_ADMIN); tipc_nl_compat_recv()
1117 if (len && !TLV_OK(msg.req, len)) { tipc_nl_compat_recv()
1118 msg.rep = tipc_get_err_tlv(TIPC_CFG_NOT_SUPPORTED); tipc_nl_compat_recv()
1123 err = tipc_nl_compat_handle(&msg); tipc_nl_compat_recv()
1125 msg.rep = tipc_get_err_tlv(TIPC_CFG_NOT_SUPPORTED); tipc_nl_compat_recv()
1127 msg.rep = tipc_get_err_tlv(TIPC_CFG_TLV_ERROR); tipc_nl_compat_recv()
1129 if (!msg.rep) tipc_nl_compat_recv()
1133 skb_push(msg.rep, len); tipc_nl_compat_recv()
1134 rep_nlh = nlmsg_hdr(msg.rep); tipc_nl_compat_recv()
1136 rep_nlh->nlmsg_len = msg.rep->len; tipc_nl_compat_recv()
1137 genlmsg_unicast(msg.net, msg.rep, NETLINK_CB(skb).portid); tipc_nl_compat_recv()
169 __tipc_nl_compat_dumpit(struct tipc_nl_compat_cmd_dump *cmd, struct tipc_nl_compat_msg *msg, struct sk_buff *arg) __tipc_nl_compat_dumpit() argument
239 tipc_nl_compat_dumpit(struct tipc_nl_compat_cmd_dump *cmd, struct tipc_nl_compat_msg *msg) tipc_nl_compat_dumpit() argument
273 __tipc_nl_compat_doit(struct tipc_nl_compat_cmd_doit *cmd, struct tipc_nl_compat_msg *msg) __tipc_nl_compat_doit() argument
325 tipc_nl_compat_doit(struct tipc_nl_compat_cmd_doit *cmd, struct tipc_nl_compat_msg *msg) tipc_nl_compat_doit() argument
358 tipc_nl_compat_bearer_enable(struct tipc_nl_compat_cmd_doit *cmd, struct sk_buff *skb, struct tipc_nl_compat_msg *msg) tipc_nl_compat_bearer_enable() argument
391 tipc_nl_compat_bearer_disable(struct tipc_nl_compat_cmd_doit *cmd, struct sk_buff *skb, struct tipc_nl_compat_msg *msg) tipc_nl_compat_bearer_disable() argument
583 __tipc_add_link_prop(struct sk_buff *skb, struct tipc_nl_compat_msg *msg, struct tipc_link_config *lc) __tipc_add_link_prop() argument
599 tipc_nl_compat_media_set(struct sk_buff *skb, struct tipc_nl_compat_msg *msg) tipc_nl_compat_media_set() argument
626 tipc_nl_compat_bearer_set(struct sk_buff *skb, struct tipc_nl_compat_msg *msg) tipc_nl_compat_bearer_set() argument
653 __tipc_nl_compat_link_set(struct sk_buff *skb, struct tipc_nl_compat_msg *msg) __tipc_nl_compat_link_set() argument
680 tipc_nl_compat_link_set(struct tipc_nl_compat_cmd_doit *cmd, struct sk_buff *skb, struct tipc_nl_compat_msg *msg) tipc_nl_compat_link_set() argument
705 tipc_nl_compat_link_reset_stats(struct tipc_nl_compat_cmd_doit *cmd, struct sk_buff *skb, struct tipc_nl_compat_msg *msg) tipc_nl_compat_link_reset_stats() argument
944 tipc_nl_compat_net_set(struct tipc_nl_compat_cmd_doit *cmd, struct sk_buff *skb, struct tipc_nl_compat_msg *msg) tipc_nl_compat_net_set() argument
H A Dmsg.c2 * net/tipc/msg.c: TIPC message header routines
39 #include "msg.h"
93 struct tipc_msg *msg; tipc_msg_create() local
100 msg = buf_msg(buf); tipc_msg_create()
101 tipc_msg_init(onode, msg, user, type, hdr_sz, dnode); tipc_msg_create()
102 msg_set_size(msg, hdr_sz + data_sz); tipc_msg_create()
103 msg_set_origport(msg, oport); tipc_msg_create()
104 msg_set_destport(msg, dport); tipc_msg_create()
105 msg_set_errcode(msg, errcode); tipc_msg_create()
107 msg_set_orignode(msg, onode); tipc_msg_create()
108 msg_set_destnode(msg, dnode); tipc_msg_create()
125 struct tipc_msg *msg; tipc_buf_append() local
133 msg = buf_msg(frag); tipc_buf_append()
134 fragid = msg_type(msg); tipc_buf_append()
136 skb_pull(frag, msg_hdr_sz(msg)); tipc_buf_append()
204 struct tipc_msg *msg; tipc_msg_validate() local
218 msg = buf_msg(skb); tipc_msg_validate()
219 if (unlikely(msg_version(msg) != TIPC_VERSION)) tipc_msg_validate()
222 msz = msg_size(msg); tipc_msg_validate()
340 * @msg: message to be appended
345 bool tipc_msg_bundle(struct sk_buff *skb, struct tipc_msg *msg, u32 mtu) tipc_msg_bundle() argument
349 unsigned int msz = msg_size(msg); tipc_msg_bundle()
353 if (likely(msg_user(msg) == MSG_FRAGMENTER)) tipc_msg_bundle()
362 if (unlikely(msg_user(msg) == TUNNEL_PROTOCOL)) tipc_msg_bundle()
364 if (unlikely(msg_user(msg) == BCAST_PROTOCOL)) tipc_msg_bundle()
372 if ((msg_importance(msg) < TIPC_SYSTEM_IMPORTANCE) && tipc_msg_bundle()
377 skb_copy_to_linear_data_offset(skb, start, msg, msz); tipc_msg_bundle()
387 * @pos: position in outer message of msg to be extracted.
388 * Returns position of next msg
394 struct tipc_msg *msg; tipc_msg_extract() local
401 msg = buf_msg(skb); tipc_msg_extract()
402 offset = msg_hdr_sz(msg) + *pos; tipc_msg_extract()
403 if (unlikely(offset > (msg_size(msg) - MIN_H_SIZE))) tipc_msg_extract()
427 * @msg: message to be appended
432 bool tipc_msg_make_bundle(struct sk_buff **skb, struct tipc_msg *msg, tipc_msg_make_bundle() argument
437 u32 msz = msg_size(msg); tipc_msg_make_bundle()
440 if (msg_user(msg) == MSG_FRAGMENTER) tipc_msg_make_bundle()
442 if (msg_user(msg) == TUNNEL_PROTOCOL) tipc_msg_make_bundle()
444 if (msg_user(msg) == BCAST_PROTOCOL) tipc_msg_make_bundle()
455 tipc_msg_init(msg_prevnode(msg), bmsg, MSG_BUNDLER, 0, tipc_msg_make_bundle()
457 if (msg_isdata(msg)) tipc_msg_make_bundle()
461 msg_set_seqno(bmsg, msg_seqno(msg)); tipc_msg_make_bundle()
462 msg_set_ack(bmsg, msg_ack(msg)); tipc_msg_make_bundle()
463 msg_set_bcast_ack(bmsg, msg_bcast_ack(msg)); tipc_msg_make_bundle()
464 tipc_msg_bundle(_skb, msg, mtu); tipc_msg_make_bundle()
534 struct tipc_msg *msg = buf_msg(skb); tipc_msg_lookup_dest() local
538 if (!msg_isdata(msg)) tipc_msg_lookup_dest()
540 if (!msg_named(msg)) tipc_msg_lookup_dest()
542 if (msg_errcode(msg)) tipc_msg_lookup_dest()
547 msg = buf_msg(skb); tipc_msg_lookup_dest()
548 if (msg_reroute_cnt(msg)) tipc_msg_lookup_dest()
550 dnode = addr_domain(net, msg_lookup_scope(msg)); tipc_msg_lookup_dest()
551 dport = tipc_nametbl_translate(net, msg_nametype(msg), tipc_msg_lookup_dest()
552 msg_nameinst(msg), &dnode); tipc_msg_lookup_dest()
555 msg_incr_reroute_cnt(msg); tipc_msg_lookup_dest()
557 msg_set_prevnode(msg, onode); tipc_msg_lookup_dest()
558 msg_set_destnode(msg, dnode); tipc_msg_lookup_dest()
559 msg_set_destport(msg, dport); tipc_msg_lookup_dest()
H A Deth_media.c52 static int tipc_eth_addr2msg(char *msg, struct tipc_media_addr *addr) tipc_eth_addr2msg() argument
54 memset(msg, 0, TIPC_MEDIA_INFO_SIZE); tipc_eth_addr2msg()
55 msg[TIPC_MEDIA_TYPE_OFFSET] = TIPC_MEDIA_TYPE_ETH; tipc_eth_addr2msg()
56 memcpy(msg + TIPC_MEDIA_ADDR_OFFSET, addr->value, ETH_ALEN); tipc_eth_addr2msg()
63 char *msg) tipc_eth_raw2addr()
68 ether_addr_copy(addr->value, msg); tipc_eth_raw2addr()
74 /* Convert discovery msg addr format to Ethernet media addr format */ tipc_eth_msg2addr()
77 char *msg) tipc_eth_msg2addr()
80 msg += TIPC_MEDIA_ADDR_OFFSET; tipc_eth_msg2addr()
81 return tipc_eth_raw2addr(b, addr, msg); tipc_eth_msg2addr()
61 tipc_eth_raw2addr(struct tipc_bearer *b, struct tipc_media_addr *addr, char *msg) tipc_eth_raw2addr() argument
75 tipc_eth_msg2addr(struct tipc_bearer *b, struct tipc_media_addr *addr, char *msg) tipc_eth_msg2addr() argument
H A Dib_media.c58 static int tipc_ib_addr2msg(char *msg, struct tipc_media_addr *addr) tipc_ib_addr2msg() argument
60 memset(msg, 0, TIPC_MEDIA_INFO_SIZE); tipc_ib_addr2msg()
61 memcpy(msg, addr->value, INFINIBAND_ALEN); tipc_ib_addr2msg()
68 char *msg) tipc_ib_raw2addr()
71 memcpy(addr->value, msg, INFINIBAND_ALEN); tipc_ib_raw2addr()
73 addr->broadcast = !memcmp(msg, b->bcast_addr.value, tipc_ib_raw2addr()
78 /* Convert discovery msg addr format to InfiniBand media addr format */ tipc_ib_msg2addr()
81 char *msg) tipc_ib_msg2addr()
83 return tipc_ib_raw2addr(b, addr, msg); tipc_ib_msg2addr()
66 tipc_ib_raw2addr(struct tipc_bearer *b, struct tipc_media_addr *addr, char *msg) tipc_ib_raw2addr() argument
79 tipc_ib_msg2addr(struct tipc_bearer *b, struct tipc_media_addr *addr, char *msg) tipc_ib_msg2addr() argument
/linux-4.4.14/drivers/iio/common/ssp_sensors/
H A Dssp_spi.c88 struct ssp_msg *msg; ssp_create_msg() local
90 msg = kzalloc(sizeof(*msg), GFP_KERNEL); ssp_create_msg()
91 if (!msg) ssp_create_msg()
99 msg->buffer = kzalloc(SSP_HEADER_SIZE_ALIGNED + len, ssp_create_msg()
101 if (!msg->buffer) { ssp_create_msg()
102 kfree(msg); ssp_create_msg()
106 msg->length = len; ssp_create_msg()
107 msg->options = opt; ssp_create_msg()
109 memcpy(msg->buffer, &h, SSP_HEADER_SIZE); ssp_create_msg()
111 return msg; ssp_create_msg()
187 static int ssp_do_transfer(struct ssp_data *data, struct ssp_msg *msg, ssp_do_transfer() argument
195 const bool use_no_irq = msg->length == 0; ssp_do_transfer()
200 msg->done = done; ssp_do_transfer()
208 status = spi_write(data->spi, msg->buffer, SSP_HEADER_SIZE); ssp_do_transfer()
217 list_add_tail(&msg->list, &data->pending_list); ssp_do_transfer()
225 list_del(&msg->list); ssp_do_transfer()
238 list_del(&msg->list); ssp_do_transfer()
254 struct ssp_msg *msg) ssp_spi_sync_command()
256 return ssp_do_transfer(data, msg, NULL, 0); ssp_spi_sync_command()
259 static int ssp_spi_sync(struct ssp_data *data, struct ssp_msg *msg, ssp_spi_sync() argument
264 if (WARN_ON(!msg->length)) ssp_spi_sync()
267 return ssp_do_transfer(data, msg, &done, timeout); ssp_spi_sync()
345 struct ssp_msg *msg, *n; ssp_irq_msg() local
371 list_for_each_entry_safe(msg, n, &data->pending_list, list) { ssp_irq_msg()
372 if (msg->options == msg_options) { ssp_irq_msg()
373 list_del(&msg->list); ssp_irq_msg()
406 &msg->buffer[SSP_HEADER_SIZE_ALIGNED], ssp_irq_msg()
407 msg->length); ssp_irq_msg()
411 &msg->buffer[SSP_HEADER_SIZE_ALIGNED], ssp_irq_msg()
412 msg->length); ssp_irq_msg()
414 msg->options = ssp_irq_msg()
416 msg->length = 1; ssp_irq_msg()
418 list_add_tail(&msg->list, &data->pending_list); ssp_irq_msg()
423 if (msg->done) ssp_irq_msg()
424 if (!completion_done(msg->done)) ssp_irq_msg()
425 complete(msg->done); ssp_irq_msg()
447 dev_err(SSP_DEV, "unknown msg type\n"); ssp_irq_msg()
456 struct ssp_msg *msg, *n; ssp_clean_pending_list() local
459 list_for_each_entry_safe(msg, n, &data->pending_list, list) { ssp_clean_pending_list()
460 list_del(&msg->list); ssp_clean_pending_list()
462 if (msg->done) ssp_clean_pending_list()
463 if (!completion_done(msg->done)) ssp_clean_pending_list()
464 complete(msg->done); ssp_clean_pending_list()
472 struct ssp_msg *msg; ssp_command() local
474 msg = ssp_create_msg(command, 0, SSP_AP2HUB_WRITE, arg); ssp_command()
475 if (!msg) ssp_command()
480 ret = ssp_spi_sync_command(data, msg); ssp_command()
481 ssp_clean_msg(msg); ssp_command()
490 struct ssp_msg *msg; ssp_send_instruction() local
503 msg = ssp_create_msg(inst, length + 2, SSP_AP2HUB_WRITE, 0); ssp_send_instruction()
504 if (!msg) ssp_send_instruction()
507 ssp_fill_buffer(msg, 0, &sensor_type, 1); ssp_send_instruction()
508 ssp_fill_buffer(msg, 1, send_buf, length); ssp_send_instruction()
513 ret = ssp_spi_sync(data, msg, 1000); ssp_send_instruction()
514 ssp_clean_msg(msg); ssp_send_instruction()
523 struct ssp_msg *msg; ssp_get_chipid() local
525 msg = ssp_create_msg(SSP_MSG2SSP_AP_WHOAMI, 1, SSP_AP2HUB_READ, 0); ssp_get_chipid()
526 if (!msg) ssp_get_chipid()
529 ret = ssp_spi_sync(data, msg, 1000); ssp_get_chipid()
531 buffer = SSP_GET_BUFFER_AT_INDEX(msg, 0); ssp_get_chipid()
533 ssp_clean_msg(msg); ssp_get_chipid()
541 struct ssp_msg *msg; ssp_set_magnetic_matrix() local
543 msg = ssp_create_msg(SSP_MSG2SSP_AP_SET_MAGNETIC_STATIC_MATRIX, ssp_set_magnetic_matrix()
546 if (!msg) ssp_set_magnetic_matrix()
549 ssp_fill_buffer(msg, 0, data->sensorhub_info->mag_table, ssp_set_magnetic_matrix()
552 ret = ssp_spi_sync(data, msg, 1000); ssp_set_magnetic_matrix()
553 ssp_clean_msg(msg); ssp_set_magnetic_matrix()
564 struct ssp_msg *msg = ssp_create_msg(SSP_MSG2SSP_AP_SENSOR_SCANNING, 4, ssp_get_sensor_scanning_info() local
566 if (!msg) ssp_get_sensor_scanning_info()
569 ret = ssp_spi_sync(data, msg, 1000); ssp_get_sensor_scanning_info()
575 ssp_get_buffer(msg, 0, &result, 4); ssp_get_sensor_scanning_info()
581 ssp_clean_msg(msg); ssp_get_sensor_scanning_info()
590 struct ssp_msg *msg = ssp_create_msg(SSP_MSG2SSP_AP_FIRMWARE_REV, 4, ssp_get_firmware_rev() local
592 if (!msg) ssp_get_firmware_rev()
595 ret = ssp_spi_sync(data, msg, 1000); ssp_get_firmware_rev()
602 ssp_get_buffer(msg, 0, &result, 4); ssp_get_firmware_rev()
606 ssp_clean_msg(msg); ssp_get_firmware_rev()
253 ssp_spi_sync_command(struct ssp_data *data, struct ssp_msg *msg) ssp_spi_sync_command() argument
/linux-4.4.14/net/atm/
H A Dsignaling.c36 static void modify_qos(struct atm_vcc *vcc, struct atmsvc_msg *msg) modify_qos() argument
43 msg->type = as_error; modify_qos()
45 msg->reply = -EOPNOTSUPP; modify_qos()
48 msg->reply = vcc->dev->ops->change_qos(vcc, &msg->qos, modify_qos()
49 msg->reply); modify_qos()
50 if (!msg->reply) modify_qos()
51 msg->type = as_okay; modify_qos()
59 *(struct atmsvc_msg *)skb_put(skb, sizeof(struct atmsvc_msg)) = *msg; modify_qos()
65 struct atmsvc_msg *msg; sigd_send() local
69 msg = (struct atmsvc_msg *) skb->data; sigd_send()
71 vcc = *(struct atm_vcc **) &msg->vcc; sigd_send()
72 pr_debug("%d (0x%lx)\n", (int)msg->type, (unsigned long)vcc); sigd_send()
75 switch (msg->type) { sigd_send()
77 sk->sk_err = -msg->reply; sigd_send()
82 msg->local.sas_addr.prv, ATM_ESA_LEN); sigd_send()
84 msg->local.sas_addr.pub, ATM_E164_LEN + 1); sigd_send()
89 session_vcc->itf = msg->pvc.sap_addr.itf; sigd_send()
90 session_vcc->vpi = msg->pvc.sap_addr.vpi; sigd_send()
91 session_vcc->vci = msg->pvc.sap_addr.vci; sigd_send()
93 session_vcc->qos = msg->qos; sigd_send()
98 sk->sk_err = -msg->reply; sigd_send()
102 vcc = *(struct atm_vcc **)&msg->listen_vcc; sigd_send()
120 vcc_release_async(vcc, msg->reply); sigd_send()
123 modify_qos(vcc, msg); sigd_send()
127 sk->sk_err_soft = msg->reply; sigd_send()
132 pr_alert("bad message type %d\n", (int)msg->type); sigd_send()
147 struct atmsvc_msg *msg; sigd_enq2() local
153 msg = (struct atmsvc_msg *)skb_put(skb, sizeof(struct atmsvc_msg)); sigd_enq2()
154 memset(msg, 0, sizeof(*msg)); sigd_enq2()
155 msg->type = type; sigd_enq2()
156 *(struct atm_vcc **) &msg->vcc = vcc; sigd_enq2()
157 *(struct atm_vcc **) &msg->listen_vcc = listen_vcc; sigd_enq2()
158 msg->reply = reply; sigd_enq2()
160 msg->qos = *qos; sigd_enq2()
162 msg->sap = vcc->sap; sigd_enq2()
164 msg->svc = *svc; sigd_enq2()
166 msg->local = vcc->local; sigd_enq2()
168 msg->pvc = *pvc; sigd_enq2()
171 msg->session = ++session; sigd_enq2()
H A Dmpoa_caches.c135 struct k_message msg; cache_hit() local
143 msg.type = SND_MPOA_RES_RQST; cache_hit()
144 msg.content.in_info = entry->ctrl_info; cache_hit()
145 memcpy(msg.MPS_ctrl, mpc->mps_ctrl_addr, ATM_ESA_LEN); cache_hit()
148 msg.qos = qos->qos; cache_hit()
149 msg_to_mpoad(&msg, mpc); cache_hit()
166 msg.type = SND_MPOA_RES_RQST; cache_hit()
167 memcpy(msg.MPS_ctrl, mpc->mps_ctrl_addr, ATM_ESA_LEN); cache_hit()
168 msg.content.in_info = entry->ctrl_info; cache_hit()
171 msg.qos = qos->qos; cache_hit()
172 msg_to_mpoad(&msg, mpc); cache_hit()
194 struct k_message msg; in_cache_remove_entry() local
208 msg.type = STOP_KEEP_ALIVE_SM; in_cache_remove_entry()
209 msg_to_mpoad(&msg, client); in_cache_remove_entry()
256 struct k_message msg; check_resolving_entries() local
284 msg.type = SND_MPOA_RES_RTRY; check_resolving_entries()
285 memcpy(msg.MPS_ctrl, client->mps_ctrl_addr, ATM_ESA_LEN); check_resolving_entries()
286 msg.content.in_info = entry->ctrl_info; check_resolving_entries()
289 msg.qos = qos->qos; check_resolving_entries()
290 msg_to_mpoad(&msg, client); check_resolving_entries()
431 struct k_message msg; eg_cache_remove_entry() local
443 msg.type = STOP_KEEP_ALIVE_SM; eg_cache_remove_entry()
444 msg_to_mpoad(&msg, client); eg_cache_remove_entry()
458 static eg_cache_entry *eg_cache_add_entry(struct k_message *msg, eg_cache_add_entry() argument
469 &msg->content.eg_info.eg_dst_ip); eg_cache_add_entry()
481 entry->ctrl_info = msg->content.eg_info; eg_cache_add_entry()
506 struct k_message msg; clear_expired() local
516 msg.type = SND_EGRESS_PURGE; clear_expired()
517 msg.content.eg_info = entry->ctrl_info; clear_expired()
520 msg_to_mpoad(&msg, client); clear_expired()
/linux-4.4.14/net/sctp/
H A Dchunk.c50 static void sctp_datamsg_init(struct sctp_datamsg *msg) sctp_datamsg_init() argument
52 atomic_set(&msg->refcnt, 1); sctp_datamsg_init()
53 msg->send_failed = 0; sctp_datamsg_init()
54 msg->send_error = 0; sctp_datamsg_init()
55 msg->can_abandon = 0; sctp_datamsg_init()
56 msg->can_delay = 1; sctp_datamsg_init()
57 msg->expires_at = 0; sctp_datamsg_init()
58 INIT_LIST_HEAD(&msg->chunks); sctp_datamsg_init()
64 struct sctp_datamsg *msg; sctp_datamsg_new() local
65 msg = kmalloc(sizeof(struct sctp_datamsg), gfp); sctp_datamsg_new()
66 if (msg) { sctp_datamsg_new()
67 sctp_datamsg_init(msg); sctp_datamsg_new()
70 return msg; sctp_datamsg_new()
73 void sctp_datamsg_free(struct sctp_datamsg *msg) sctp_datamsg_free() argument
80 list_for_each_entry(chunk, &msg->chunks, frag_list) sctp_datamsg_free()
83 sctp_datamsg_put(msg); sctp_datamsg_free()
87 static void sctp_datamsg_destroy(struct sctp_datamsg *msg) sctp_datamsg_destroy() argument
97 notify = msg->send_failed ? -1 : 0; sctp_datamsg_destroy()
100 list_for_each_safe(pos, temp, &msg->chunks) { sctp_datamsg_destroy()
106 if (msg->send_error) sctp_datamsg_destroy()
107 error = msg->send_error; sctp_datamsg_destroy()
134 kfree(msg); sctp_datamsg_destroy()
138 static void sctp_datamsg_hold(struct sctp_datamsg *msg) sctp_datamsg_hold() argument
140 atomic_inc(&msg->refcnt); sctp_datamsg_hold()
144 void sctp_datamsg_put(struct sctp_datamsg *msg) sctp_datamsg_put() argument
146 if (atomic_dec_and_test(&msg->refcnt)) sctp_datamsg_put()
147 sctp_datamsg_destroy(msg); sctp_datamsg_put()
151 static void sctp_datamsg_assign(struct sctp_datamsg *msg, struct sctp_chunk *chunk) sctp_datamsg_assign() argument
153 sctp_datamsg_hold(msg); sctp_datamsg_assign()
154 chunk->msg = msg; sctp_datamsg_assign()
173 struct sctp_datamsg *msg; sctp_datamsg_from_user() local
178 msg = sctp_datamsg_new(GFP_KERNEL); sctp_datamsg_from_user()
179 if (!msg) sctp_datamsg_from_user()
187 msg->expires_at = jiffies + sctp_datamsg_from_user()
189 msg->can_abandon = 1; sctp_datamsg_from_user()
191 pr_debug("%s: msg:%p expires_at:%ld jiffies:%ld\n", __func__, sctp_datamsg_from_user()
192 msg, msg->expires_at, jiffies); sctp_datamsg_from_user()
246 msg->can_delay = 0; sctp_datamsg_from_user()
291 sctp_datamsg_assign(msg, chunk); sctp_datamsg_from_user()
292 list_add_tail(&chunk->frag_list, &msg->chunks); sctp_datamsg_from_user()
327 sctp_datamsg_assign(msg, chunk); sctp_datamsg_from_user()
328 list_add_tail(&chunk->frag_list, &msg->chunks); sctp_datamsg_from_user()
331 return msg; sctp_datamsg_from_user()
337 list_for_each_safe(pos, temp, &msg->chunks) { sctp_datamsg_from_user()
342 sctp_datamsg_put(msg); sctp_datamsg_from_user()
349 struct sctp_datamsg *msg = chunk->msg; sctp_chunk_abandoned() local
351 if (!msg->can_abandon) sctp_chunk_abandoned()
354 if (time_after(jiffies, msg->expires_at)) sctp_chunk_abandoned()
363 chunk->msg->send_failed = 1; sctp_chunk_fail()
364 chunk->msg->send_error = error; sctp_chunk_fail()
/linux-4.4.14/net/ieee802154/
H A Dnetlink.c43 struct sk_buff *msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); ieee802154_nl_create() local
46 if (!msg) ieee802154_nl_create()
50 hdr = genlmsg_put(msg, 0, ieee802154_seq_num++, ieee802154_nl_create()
54 nlmsg_free(msg); ieee802154_nl_create()
58 return msg; ieee802154_nl_create()
61 int ieee802154_nl_mcast(struct sk_buff *msg, unsigned int group) ieee802154_nl_mcast() argument
63 struct nlmsghdr *nlh = nlmsg_hdr(msg); ieee802154_nl_mcast()
66 genlmsg_end(msg, hdr); ieee802154_nl_mcast()
68 return genlmsg_multicast(&nl802154_family, msg, 0, group, GFP_ATOMIC); ieee802154_nl_mcast()
75 struct sk_buff *msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); ieee802154_nl_new_reply() local
77 if (!msg) ieee802154_nl_new_reply()
80 hdr = genlmsg_put_reply(msg, info, ieee802154_nl_new_reply()
83 nlmsg_free(msg); ieee802154_nl_new_reply()
87 return msg; ieee802154_nl_new_reply()
90 int ieee802154_nl_reply(struct sk_buff *msg, struct genl_info *info) ieee802154_nl_reply() argument
92 struct nlmsghdr *nlh = nlmsg_hdr(msg); ieee802154_nl_reply()
95 genlmsg_end(msg, hdr); ieee802154_nl_reply()
97 return genlmsg_reply(msg, info); ieee802154_nl_reply()
H A Dnl-phy.c36 static int ieee802154_nl_fill_phy(struct sk_buff *msg, u32 portid, ieee802154_nl_fill_phy() argument
48 hdr = genlmsg_put(msg, 0, seq, &nl802154_family, flags, ieee802154_nl_fill_phy()
54 if (nla_put_string(msg, IEEE802154_ATTR_PHY_NAME, wpan_phy_name(phy)) || ieee802154_nl_fill_phy()
55 nla_put_u8(msg, IEEE802154_ATTR_PAGE, phy->current_page) || ieee802154_nl_fill_phy()
56 nla_put_u8(msg, IEEE802154_ATTR_CHANNEL, phy->current_channel)) ieee802154_nl_fill_phy()
63 nla_put(msg, IEEE802154_ATTR_CHANNEL_PAGE_LIST, ieee802154_nl_fill_phy()
68 genlmsg_end(msg, hdr); ieee802154_nl_fill_phy()
73 genlmsg_cancel(msg, hdr); ieee802154_nl_fill_phy()
84 struct sk_buff *msg; ieee802154_list_phy() local
102 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); ieee802154_list_phy()
103 if (!msg) ieee802154_list_phy()
106 rc = ieee802154_nl_fill_phy(msg, info->snd_portid, info->snd_seq, ieee802154_list_phy()
113 return genlmsg_reply(msg, info); ieee802154_list_phy()
115 nlmsg_free(msg); ieee802154_list_phy()
171 struct sk_buff *msg; ieee802154_add_iface() local
207 msg = ieee802154_nl_new_reply(info, 0, IEEE802154_ADD_IFACE); ieee802154_add_iface()
208 if (!msg) ieee802154_add_iface()
251 if (nla_put_string(msg, IEEE802154_ATTR_PHY_NAME, wpan_phy_name(phy)) || ieee802154_add_iface()
252 nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name)) ieee802154_add_iface()
258 return ieee802154_nl_reply(msg, info); ieee802154_add_iface()
266 nlmsg_free(msg); ieee802154_add_iface()
274 struct sk_buff *msg; ieee802154_del_iface() local
321 msg = ieee802154_nl_new_reply(info, 0, IEEE802154_DEL_IFACE); ieee802154_del_iface()
322 if (!msg) ieee802154_del_iface()
334 if (nla_put_string(msg, IEEE802154_ATTR_PHY_NAME, wpan_phy_name(phy)) || ieee802154_del_iface()
335 nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, name)) ieee802154_del_iface()
339 return ieee802154_nl_reply(msg, info); ieee802154_del_iface()
342 nlmsg_free(msg); ieee802154_del_iface()
H A Dnl-mac.c37 static int nla_put_hwaddr(struct sk_buff *msg, int type, __le64 hwaddr) nla_put_hwaddr() argument
39 return nla_put_u64(msg, type, swab64((__force u64)hwaddr)); nla_put_hwaddr()
47 static int nla_put_shortaddr(struct sk_buff *msg, int type, __le16 addr) nla_put_shortaddr() argument
49 return nla_put_u16(msg, type, le16_to_cpu(addr)); nla_put_shortaddr()
59 struct sk_buff *msg; ieee802154_nl_start_confirm() local
63 msg = ieee802154_nl_create(0, IEEE802154_START_CONF); ieee802154_nl_start_confirm()
64 if (!msg) ieee802154_nl_start_confirm()
67 if (nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name) || ieee802154_nl_start_confirm()
68 nla_put_u32(msg, IEEE802154_ATTR_DEV_INDEX, dev->ifindex) || ieee802154_nl_start_confirm()
69 nla_put(msg, IEEE802154_ATTR_HW_ADDR, IEEE802154_ADDR_LEN, ieee802154_nl_start_confirm()
71 nla_put_u8(msg, IEEE802154_ATTR_STATUS, status)) ieee802154_nl_start_confirm()
73 return ieee802154_nl_mcast(msg, IEEE802154_COORD_MCGRP); ieee802154_nl_start_confirm()
76 nlmsg_free(msg); ieee802154_nl_start_confirm()
80 static int ieee802154_nl_fill_iface(struct sk_buff *msg, u32 portid, ieee802154_nl_fill_iface() argument
90 hdr = genlmsg_put(msg, 0, seq, &nl802154_family, flags, ieee802154_nl_fill_iface()
105 if (nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name) || ieee802154_nl_fill_iface()
106 nla_put_string(msg, IEEE802154_ATTR_PHY_NAME, wpan_phy_name(phy)) || ieee802154_nl_fill_iface()
107 nla_put_u32(msg, IEEE802154_ATTR_DEV_INDEX, dev->ifindex) || ieee802154_nl_fill_iface()
108 nla_put(msg, IEEE802154_ATTR_HW_ADDR, IEEE802154_ADDR_LEN, ieee802154_nl_fill_iface()
110 nla_put_shortaddr(msg, IEEE802154_ATTR_SHORT_ADDR, short_addr) || ieee802154_nl_fill_iface()
111 nla_put_shortaddr(msg, IEEE802154_ATTR_PAN_ID, pan_id)) ieee802154_nl_fill_iface()
121 if (nla_put_s8(msg, IEEE802154_ATTR_TXPOWER, ieee802154_nl_fill_iface()
123 nla_put_u8(msg, IEEE802154_ATTR_LBT_ENABLED, params.lbt) || ieee802154_nl_fill_iface()
124 nla_put_u8(msg, IEEE802154_ATTR_CCA_MODE, ieee802154_nl_fill_iface()
126 nla_put_s32(msg, IEEE802154_ATTR_CCA_ED_LEVEL, ieee802154_nl_fill_iface()
128 nla_put_u8(msg, IEEE802154_ATTR_CSMA_RETRIES, ieee802154_nl_fill_iface()
130 nla_put_u8(msg, IEEE802154_ATTR_CSMA_MIN_BE, ieee802154_nl_fill_iface()
132 nla_put_u8(msg, IEEE802154_ATTR_CSMA_MAX_BE, ieee802154_nl_fill_iface()
134 nla_put_s8(msg, IEEE802154_ATTR_FRAME_RETRIES, ieee802154_nl_fill_iface()
140 genlmsg_end(msg, hdr); ieee802154_nl_fill_iface()
145 genlmsg_cancel(msg, hdr); ieee802154_nl_fill_iface()
415 struct sk_buff *msg; ieee802154_list_iface() local
425 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); ieee802154_list_iface()
426 if (!msg) ieee802154_list_iface()
429 rc = ieee802154_nl_fill_iface(msg, info->snd_portid, info->snd_seq, ieee802154_list_iface()
436 return genlmsg_reply(msg, info); ieee802154_list_iface()
438 nlmsg_free(msg); ieee802154_list_iface()
608 ieee802154_llsec_fill_key_id(struct sk_buff *msg, ieee802154_llsec_fill_key_id() argument
611 if (nla_put_u8(msg, IEEE802154_ATTR_LLSEC_KEY_MODE, desc->mode)) ieee802154_llsec_fill_key_id()
615 if (nla_put_shortaddr(msg, IEEE802154_ATTR_PAN_ID, ieee802154_llsec_fill_key_id()
620 nla_put_shortaddr(msg, IEEE802154_ATTR_SHORT_ADDR, ieee802154_llsec_fill_key_id()
625 nla_put_hwaddr(msg, IEEE802154_ATTR_HW_ADDR, ieee802154_llsec_fill_key_id()
631 nla_put_u8(msg, IEEE802154_ATTR_LLSEC_KEY_ID, desc->id)) ieee802154_llsec_fill_key_id()
635 nla_put_u32(msg, IEEE802154_ATTR_LLSEC_KEY_SOURCE_SHORT, ieee802154_llsec_fill_key_id()
640 nla_put_hwaddr(msg, IEEE802154_ATTR_LLSEC_KEY_SOURCE_EXTENDED, ieee802154_llsec_fill_key_id()
649 struct sk_buff *msg; ieee802154_llsec_getparams() local
668 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); ieee802154_llsec_getparams()
669 if (!msg) ieee802154_llsec_getparams()
672 hdr = genlmsg_put(msg, 0, info->snd_seq, &nl802154_family, 0, ieee802154_llsec_getparams()
681 if (nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name) || ieee802154_llsec_getparams()
682 nla_put_u32(msg, IEEE802154_ATTR_DEV_INDEX, dev->ifindex) || ieee802154_llsec_getparams()
683 nla_put_u8(msg, IEEE802154_ATTR_LLSEC_ENABLED, params.enabled) || ieee802154_llsec_getparams()
684 nla_put_u8(msg, IEEE802154_ATTR_LLSEC_SECLEVEL, params.out_level) || ieee802154_llsec_getparams()
685 nla_put_u32(msg, IEEE802154_ATTR_LLSEC_FRAME_COUNTER, ieee802154_llsec_getparams()
687 ieee802154_llsec_fill_key_id(msg, &params.out_key)) ieee802154_llsec_getparams()
692 return ieee802154_nl_reply(msg, info); ieee802154_llsec_getparams()
694 nlmsg_free(msg); ieee802154_llsec_getparams()
913 ieee802154_nl_fill_key(struct sk_buff *msg, u32 portid, u32 seq, ieee802154_nl_fill_key() argument
920 hdr = genlmsg_put(msg, 0, seq, &nl802154_family, NLM_F_MULTI, ieee802154_nl_fill_key()
925 if (nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name) || ieee802154_nl_fill_key()
926 nla_put_u32(msg, IEEE802154_ATTR_DEV_INDEX, dev->ifindex) || ieee802154_nl_fill_key()
927 ieee802154_llsec_fill_key_id(msg, &key->id) || ieee802154_nl_fill_key()
928 nla_put_u8(msg, IEEE802154_ATTR_LLSEC_KEY_USAGE_FRAME_TYPES, ieee802154_nl_fill_key()
935 if (nla_put(msg, IEEE802154_ATTR_LLSEC_KEY_USAGE_COMMANDS, ieee802154_nl_fill_key()
940 if (nla_put(msg, IEEE802154_ATTR_LLSEC_KEY_BYTES, ieee802154_nl_fill_key()
944 genlmsg_end(msg, hdr); ieee802154_nl_fill_key()
948 genlmsg_cancel(msg, hdr); ieee802154_nl_fill_key()
1050 ieee802154_nl_fill_dev(struct sk_buff *msg, u32 portid, u32 seq, ieee802154_nl_fill_dev() argument
1056 hdr = genlmsg_put(msg, 0, seq, &nl802154_family, NLM_F_MULTI, ieee802154_nl_fill_dev()
1061 if (nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name) || ieee802154_nl_fill_dev()
1062 nla_put_u32(msg, IEEE802154_ATTR_DEV_INDEX, dev->ifindex) || ieee802154_nl_fill_dev()
1063 nla_put_shortaddr(msg, IEEE802154_ATTR_PAN_ID, desc->pan_id) || ieee802154_nl_fill_dev()
1064 nla_put_shortaddr(msg, IEEE802154_ATTR_SHORT_ADDR, ieee802154_nl_fill_dev()
1066 nla_put_hwaddr(msg, IEEE802154_ATTR_HW_ADDR, desc->hwaddr) || ieee802154_nl_fill_dev()
1067 nla_put_u32(msg, IEEE802154_ATTR_LLSEC_FRAME_COUNTER, ieee802154_nl_fill_dev()
1069 nla_put_u8(msg, IEEE802154_ATTR_LLSEC_DEV_OVERRIDE, ieee802154_nl_fill_dev()
1071 nla_put_u8(msg, IEEE802154_ATTR_LLSEC_DEV_KEY_MODE, desc->key_mode)) ieee802154_nl_fill_dev()
1074 genlmsg_end(msg, hdr); ieee802154_nl_fill_dev()
1078 genlmsg_cancel(msg, hdr); ieee802154_nl_fill_dev()
1156 ieee802154_nl_fill_devkey(struct sk_buff *msg, u32 portid, u32 seq, ieee802154_nl_fill_devkey() argument
1163 hdr = genlmsg_put(msg, 0, seq, &nl802154_family, NLM_F_MULTI, ieee802154_nl_fill_devkey()
1168 if (nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name) || ieee802154_nl_fill_devkey()
1169 nla_put_u32(msg, IEEE802154_ATTR_DEV_INDEX, dev->ifindex) || ieee802154_nl_fill_devkey()
1170 nla_put_hwaddr(msg, IEEE802154_ATTR_HW_ADDR, devaddr) || ieee802154_nl_fill_devkey()
1171 nla_put_u32(msg, IEEE802154_ATTR_LLSEC_FRAME_COUNTER, ieee802154_nl_fill_devkey()
1173 ieee802154_llsec_fill_key_id(msg, &devkey->key_id)) ieee802154_nl_fill_devkey()
1176 genlmsg_end(msg, hdr); ieee802154_nl_fill_devkey()
1180 genlmsg_cancel(msg, hdr); ieee802154_nl_fill_devkey()
1285 ieee802154_nl_fill_seclevel(struct sk_buff *msg, u32 portid, u32 seq, ieee802154_nl_fill_seclevel() argument
1291 hdr = genlmsg_put(msg, 0, seq, &nl802154_family, NLM_F_MULTI, ieee802154_nl_fill_seclevel()
1296 if (nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name) || ieee802154_nl_fill_seclevel()
1297 nla_put_u32(msg, IEEE802154_ATTR_DEV_INDEX, dev->ifindex) || ieee802154_nl_fill_seclevel()
1298 nla_put_u8(msg, IEEE802154_ATTR_LLSEC_FRAME_TYPE, sl->frame_type) || ieee802154_nl_fill_seclevel()
1299 nla_put_u8(msg, IEEE802154_ATTR_LLSEC_SECLEVELS, sl->sec_levels) || ieee802154_nl_fill_seclevel()
1300 nla_put_u8(msg, IEEE802154_ATTR_LLSEC_DEV_OVERRIDE, ieee802154_nl_fill_seclevel()
1305 nla_put_u8(msg, IEEE802154_ATTR_LLSEC_CMD_FRAME_ID, ieee802154_nl_fill_seclevel()
1309 genlmsg_end(msg, hdr); ieee802154_nl_fill_seclevel()
1313 genlmsg_cancel(msg, hdr); ieee802154_nl_fill_seclevel()
H A Dnl802154.c324 nl802154_put_flags(struct sk_buff *msg, int attr, u32 mask) nl802154_put_flags() argument
326 struct nlattr *nl_flags = nla_nest_start(msg, attr); nl802154_put_flags()
334 if ((mask & 1) && nla_put_flag(msg, i)) nl802154_put_flags()
341 nla_nest_end(msg, nl_flags); nl802154_put_flags()
347 struct sk_buff *msg) nl802154_send_wpan_phy_channels()
352 nl_page = nla_nest_start(msg, NL802154_ATTR_CHANNELS_SUPPORTED); nl802154_send_wpan_phy_channels()
357 if (nla_put_u32(msg, NL802154_ATTR_SUPPORTED_CHANNEL, nl802154_send_wpan_phy_channels()
361 nla_nest_end(msg, nl_page); nl802154_send_wpan_phy_channels()
367 nl802154_put_capabilities(struct sk_buff *msg, nl802154_put_capabilities() argument
374 nl_caps = nla_nest_start(msg, NL802154_ATTR_WPAN_PHY_CAPS); nl802154_put_capabilities()
378 nl_channels = nla_nest_start(msg, NL802154_CAP_ATTR_CHANNELS); nl802154_put_capabilities()
384 if (nl802154_put_flags(msg, i, caps->channels[i])) nl802154_put_capabilities()
389 nla_nest_end(msg, nl_channels); nl802154_put_capabilities()
394 nl_ed_lvls = nla_nest_start(msg, nl802154_put_capabilities()
400 if (nla_put_s32(msg, i, caps->cca_ed_levels[i])) nl802154_put_capabilities()
404 nla_nest_end(msg, nl_ed_lvls); nl802154_put_capabilities()
410 nl_tx_pwrs = nla_nest_start(msg, NL802154_CAP_ATTR_TX_POWERS); nl802154_put_capabilities()
415 if (nla_put_s32(msg, i, caps->tx_powers[i])) nl802154_put_capabilities()
419 nla_nest_end(msg, nl_tx_pwrs); nl802154_put_capabilities()
423 if (nl802154_put_flags(msg, NL802154_CAP_ATTR_CCA_MODES, nl802154_put_capabilities()
425 nl802154_put_flags(msg, NL802154_CAP_ATTR_CCA_OPTS, nl802154_put_capabilities()
430 if (nla_put_u8(msg, NL802154_CAP_ATTR_MIN_MINBE, caps->min_minbe) || nl802154_put_capabilities()
431 nla_put_u8(msg, NL802154_CAP_ATTR_MAX_MINBE, caps->max_minbe) || nl802154_put_capabilities()
432 nla_put_u8(msg, NL802154_CAP_ATTR_MIN_MAXBE, caps->min_maxbe) || nl802154_put_capabilities()
433 nla_put_u8(msg, NL802154_CAP_ATTR_MAX_MAXBE, caps->max_maxbe) || nl802154_put_capabilities()
434 nla_put_u8(msg, NL802154_CAP_ATTR_MIN_CSMA_BACKOFFS, nl802154_put_capabilities()
436 nla_put_u8(msg, NL802154_CAP_ATTR_MAX_CSMA_BACKOFFS, nl802154_put_capabilities()
438 nla_put_s8(msg, NL802154_CAP_ATTR_MIN_FRAME_RETRIES, nl802154_put_capabilities()
440 nla_put_s8(msg, NL802154_CAP_ATTR_MAX_FRAME_RETRIES, nl802154_put_capabilities()
442 nl802154_put_flags(msg, NL802154_CAP_ATTR_IFTYPES, nl802154_put_capabilities()
444 nla_put_u32(msg, NL802154_CAP_ATTR_LBT, caps->lbt)) nl802154_put_capabilities()
447 nla_nest_end(msg, nl_caps); nl802154_put_capabilities()
454 struct sk_buff *msg, u32 portid, u32 seq, nl802154_send_wpan_phy()
461 hdr = nl802154hdr_put(msg, portid, seq, flags, cmd); nl802154_send_wpan_phy()
465 if (nla_put_u32(msg, NL802154_ATTR_WPAN_PHY, rdev->wpan_phy_idx) || nl802154_send_wpan_phy()
466 nla_put_string(msg, NL802154_ATTR_WPAN_PHY_NAME, nl802154_send_wpan_phy()
468 nla_put_u32(msg, NL802154_ATTR_GENERATION, nl802154_send_wpan_phy()
478 if (nla_put_u8(msg, NL802154_ATTR_PAGE, nl802154_send_wpan_phy()
480 nla_put_u8(msg, NL802154_ATTR_CHANNEL, nl802154_send_wpan_phy()
487 if (nl802154_send_wpan_phy_channels(rdev, msg)) nl802154_send_wpan_phy()
492 if (nla_put_u32(msg, NL802154_ATTR_CCA_MODE, nl802154_send_wpan_phy()
497 if (nla_put_u32(msg, NL802154_ATTR_CCA_OPT, nl802154_send_wpan_phy()
504 if (nla_put_s32(msg, NL802154_ATTR_TX_POWER, nl802154_send_wpan_phy()
510 if (nla_put_s32(msg, NL802154_ATTR_CCA_ED_LEVEL, nl802154_send_wpan_phy()
515 if (nl802154_put_capabilities(msg, rdev)) nl802154_send_wpan_phy()
518 nl_cmds = nla_nest_start(msg, NL802154_ATTR_SUPPORTED_COMMANDS); nl802154_send_wpan_phy()
527 if (nla_put_u32(msg, i, NL802154_CMD_ ## n)) \ nl802154_send_wpan_phy()
553 nla_nest_end(msg, nl_cmds); nl802154_send_wpan_phy()
556 genlmsg_end(msg, hdr); nl802154_send_wpan_phy()
560 genlmsg_cancel(msg, hdr); nl802154_send_wpan_phy()
671 struct sk_buff *msg; nl802154_get_wpan_phy() local
674 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl802154_get_wpan_phy()
675 if (!msg) nl802154_get_wpan_phy()
678 if (nl802154_send_wpan_phy(rdev, NL802154_CMD_NEW_WPAN_PHY, msg, nl802154_get_wpan_phy()
680 nlmsg_free(msg); nl802154_get_wpan_phy()
684 return genlmsg_reply(msg, info); nl802154_get_wpan_phy()
697 ieee802154_llsec_send_key_id(struct sk_buff *msg, ieee802154_llsec_send_key_id() argument
702 if (nla_put_u32(msg, NL802154_KEY_ID_ATTR_MODE, desc->mode)) ieee802154_llsec_send_key_id()
707 nl_dev_addr = nla_nest_start(msg, NL802154_KEY_ID_ATTR_IMPLICIT); ieee802154_llsec_send_key_id()
711 if (nla_put_le16(msg, NL802154_DEV_ADDR_ATTR_PAN_ID, ieee802154_llsec_send_key_id()
713 nla_put_u32(msg, NL802154_DEV_ADDR_ATTR_MODE, ieee802154_llsec_send_key_id()
719 if (nla_put_le16(msg, NL802154_DEV_ADDR_ATTR_SHORT, ieee802154_llsec_send_key_id()
724 if (nla_put_le64(msg, NL802154_DEV_ADDR_ATTR_EXTENDED, ieee802154_llsec_send_key_id()
733 nla_nest_end(msg, nl_dev_addr); ieee802154_llsec_send_key_id()
739 if (nla_put_le32(msg, NL802154_KEY_ID_ATTR_SOURCE_SHORT, ieee802154_llsec_send_key_id()
744 if (nla_put_le64(msg, NL802154_KEY_ID_ATTR_SOURCE_EXTENDED, ieee802154_llsec_send_key_id()
755 if (nla_put_u8(msg, NL802154_KEY_ID_ATTR_INDEX, desc->id)) ieee802154_llsec_send_key_id()
762 static int nl802154_get_llsec_params(struct sk_buff *msg, nl802154_get_llsec_params() argument
774 if (nla_put_u8(msg, NL802154_ATTR_SEC_ENABLED, params.enabled) || nl802154_get_llsec_params()
775 nla_put_u32(msg, NL802154_ATTR_SEC_OUT_LEVEL, params.out_level) || nl802154_get_llsec_params()
776 nla_put_be32(msg, NL802154_ATTR_SEC_FRAME_COUNTER, nl802154_get_llsec_params()
780 nl_key_id = nla_nest_start(msg, NL802154_ATTR_SEC_OUT_KEY_ID); nl802154_get_llsec_params()
784 ret = ieee802154_llsec_send_key_id(msg, &params.out_key); nl802154_get_llsec_params()
788 nla_nest_end(msg, nl_key_id); nl802154_get_llsec_params()
795 nl802154_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flags, nl802154_send_iface() argument
802 hdr = nl802154hdr_put(msg, portid, seq, flags, nl802154_send_iface()
808 (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex) || nl802154_send_iface()
809 nla_put_string(msg, NL802154_ATTR_IFNAME, dev->name))) nl802154_send_iface()
812 if (nla_put_u32(msg, NL802154_ATTR_WPAN_PHY, rdev->wpan_phy_idx) || nl802154_send_iface()
813 nla_put_u32(msg, NL802154_ATTR_IFTYPE, wpan_dev->iftype) || nl802154_send_iface()
814 nla_put_u64(msg, NL802154_ATTR_WPAN_DEV, wpan_dev_id(wpan_dev)) || nl802154_send_iface()
815 nla_put_u32(msg, NL802154_ATTR_GENERATION, nl802154_send_iface()
821 if (nla_put_le64(msg, NL802154_ATTR_EXTENDED_ADDR, nl802154_send_iface()
823 nla_put_le16(msg, NL802154_ATTR_SHORT_ADDR, nl802154_send_iface()
825 nla_put_le16(msg, NL802154_ATTR_PAN_ID, wpan_dev->pan_id)) nl802154_send_iface()
829 if (nla_put_s8(msg, NL802154_ATTR_MAX_FRAME_RETRIES, nl802154_send_iface()
831 nla_put_u8(msg, NL802154_ATTR_MAX_BE, wpan_dev->max_be) || nl802154_send_iface()
832 nla_put_u8(msg, NL802154_ATTR_MAX_CSMA_BACKOFFS, nl802154_send_iface()
834 nla_put_u8(msg, NL802154_ATTR_MIN_BE, wpan_dev->min_be)) nl802154_send_iface()
838 if (nla_put_u8(msg, NL802154_ATTR_LBT_MODE, wpan_dev->lbt)) nl802154_send_iface()
842 if (nla_put_u8(msg, NL802154_ATTR_ACKREQ_DEFAULT, wpan_dev->ackreq)) nl802154_send_iface()
846 if (nl802154_get_llsec_params(msg, rdev, wpan_dev) < 0) nl802154_send_iface()
850 genlmsg_end(msg, hdr); nl802154_send_iface()
854 genlmsg_cancel(msg, hdr); nl802154_send_iface()
903 struct sk_buff *msg; nl802154_get_interface() local
907 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl802154_get_interface()
908 if (!msg) nl802154_get_interface()
911 if (nl802154_send_iface(msg, info->snd_portid, info->snd_seq, 0, nl802154_get_interface()
913 nlmsg_free(msg); nl802154_get_interface()
917 return genlmsg_reply(msg, info); nl802154_get_interface()
1406 static int nl802154_send_key(struct sk_buff *msg, u32 cmd, u32 portid, nl802154_send_key() argument
1416 hdr = nl802154hdr_put(msg, portid, seq, flags, cmd); nl802154_send_key()
1420 if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex)) nl802154_send_key()
1423 nl_key = nla_nest_start(msg, NL802154_ATTR_SEC_KEY); nl802154_send_key()
1427 nl_key_id = nla_nest_start(msg, NL802154_KEY_ATTR_ID); nl802154_send_key()
1431 if (ieee802154_llsec_send_key_id(msg, &key->id) < 0) nl802154_send_key()
1434 nla_nest_end(msg, nl_key_id); nl802154_send_key()
1436 if (nla_put_u8(msg, NL802154_KEY_ATTR_USAGE_FRAMES, nl802154_send_key()
1444 if (nla_put(msg, NL802154_KEY_ATTR_USAGE_CMDS, nl802154_send_key()
1449 if (nla_put(msg, NL802154_KEY_ATTR_BYTES, NL802154_KEY_SIZE, nl802154_send_key()
1453 nla_nest_end(msg, nl_key); nl802154_send_key()
1454 genlmsg_end(msg, hdr); nl802154_send_key()
1459 genlmsg_cancel(msg, hdr); nl802154_send_key()
1591 static int nl802154_send_device(struct sk_buff *msg, u32 cmd, u32 portid, nl802154_send_device() argument
1600 hdr = nl802154hdr_put(msg, portid, seq, flags, cmd); nl802154_send_device()
1604 if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex)) nl802154_send_device()
1607 nl_device = nla_nest_start(msg, NL802154_ATTR_SEC_DEVICE); nl802154_send_device()
1611 if (nla_put_u32(msg, NL802154_DEV_ATTR_FRAME_COUNTER, nl802154_send_device()
1613 nla_put_le16(msg, NL802154_DEV_ATTR_PAN_ID, dev_desc->pan_id) || nl802154_send_device()
1614 nla_put_le16(msg, NL802154_DEV_ATTR_SHORT_ADDR, nl802154_send_device()
1616 nla_put_le64(msg, NL802154_DEV_ATTR_EXTENDED_ADDR, nl802154_send_device()
1618 nla_put_u8(msg, NL802154_DEV_ATTR_SECLEVEL_EXEMPT, nl802154_send_device()
1620 nla_put_u32(msg, NL802154_DEV_ATTR_KEY_MODE, dev_desc->key_mode)) nl802154_send_device()
1623 nla_nest_end(msg, nl_device); nl802154_send_device()
1624 genlmsg_end(msg, hdr); nl802154_send_device()
1629 genlmsg_cancel(msg, hdr); nl802154_send_device()
1760 static int nl802154_send_devkey(struct sk_buff *msg, u32 cmd, u32 portid, nl802154_send_devkey() argument
1769 hdr = nl802154hdr_put(msg, portid, seq, flags, cmd); nl802154_send_devkey()
1773 if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex)) nl802154_send_devkey()
1776 nl_devkey = nla_nest_start(msg, NL802154_ATTR_SEC_DEVKEY); nl802154_send_devkey()
1780 if (nla_put_le64(msg, NL802154_DEVKEY_ATTR_EXTENDED_ADDR, nl802154_send_devkey()
1782 nla_put_u32(msg, NL802154_DEVKEY_ATTR_FRAME_COUNTER, nl802154_send_devkey()
1786 nl_key_id = nla_nest_start(msg, NL802154_DEVKEY_ATTR_ID); nl802154_send_devkey()
1790 if (ieee802154_llsec_send_key_id(msg, &devkey->key_id) < 0) nl802154_send_devkey()
1793 nla_nest_end(msg, nl_key_id); nl802154_send_devkey()
1794 nla_nest_end(msg, nl_devkey); nl802154_send_devkey()
1795 genlmsg_end(msg, hdr); nl802154_send_devkey()
1800 genlmsg_cancel(msg, hdr); nl802154_send_devkey()
1928 static int nl802154_send_seclevel(struct sk_buff *msg, u32 cmd, u32 portid, nl802154_send_seclevel() argument
1937 hdr = nl802154hdr_put(msg, portid, seq, flags, cmd); nl802154_send_seclevel()
1941 if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex)) nl802154_send_seclevel()
1944 nl_seclevel = nla_nest_start(msg, NL802154_ATTR_SEC_LEVEL); nl802154_send_seclevel()
1948 if (nla_put_u32(msg, NL802154_SECLEVEL_ATTR_FRAME, sl->frame_type) || nl802154_send_seclevel()
1949 nla_put_u32(msg, NL802154_SECLEVEL_ATTR_LEVELS, sl->sec_levels) || nl802154_send_seclevel()
1950 nla_put_u8(msg, NL802154_SECLEVEL_ATTR_DEV_OVERRIDE, nl802154_send_seclevel()
1955 if (nla_put_u32(msg, NL802154_SECLEVEL_ATTR_CMD_FRAME, nl802154_send_seclevel()
1960 nla_nest_end(msg, nl_seclevel); nl802154_send_seclevel()
1961 genlmsg_end(msg, hdr); nl802154_send_seclevel()
1966 genlmsg_cancel(msg, hdr); nl802154_send_seclevel()
346 nl802154_send_wpan_phy_channels(struct cfg802154_registered_device *rdev, struct sk_buff *msg) nl802154_send_wpan_phy_channels() argument
452 nl802154_send_wpan_phy(struct cfg802154_registered_device *rdev, enum nl802154_commands cmd, struct sk_buff *msg, u32 portid, u32 seq, int flags) nl802154_send_wpan_phy() argument
/linux-4.4.14/drivers/staging/wlan-ng/
H A Dprism2mgmt.c104 * msgp ptr to msg buffer
120 struct p80211msg_dot11req_scan *msg = msgp; prism2mgmt_scan() local
135 msg->resultcode.data = P80211ENUM_resultcode_not_supported; prism2mgmt_scan()
148 msg->resultcode.data = prism2mgmt_scan()
161 msg->resultcode.data = prism2mgmt_scan()
171 if (msg->scantype.data != P80211ENUM_scantype_active) prism2mgmt_scan()
172 word = cpu_to_le16(msg->maxchanneltime.data); prism2mgmt_scan()
191 for (i = 0; i < msg->channellist.data.len; i++) { prism2mgmt_scan()
192 u8 channel = msg->channellist.data.data[i]; prism2mgmt_scan()
202 scanreq.ssid.len = cpu_to_le16(msg->ssid.data.len); prism2mgmt_scan()
203 memcpy(scanreq.ssid.data, msg->ssid.data.data, msg->ssid.data.len); prism2mgmt_scan()
210 msg->resultcode.data = prism2mgmt_scan()
224 msg->resultcode.data = prism2mgmt_scan()
238 msg->resultcode.data = prism2mgmt_scan()
248 msg->resultcode.data = prism2mgmt_scan()
259 msg->resultcode.data = prism2mgmt_scan()
270 msg->resultcode.data = prism2mgmt_scan()
279 msg->resultcode.data = prism2mgmt_scan()
287 timeout = msg->channellist.data.len * msg->maxchanneltime.data; prism2mgmt_scan()
300 msg->resultcode.data = prism2mgmt_scan()
308 msg->numbss.status = P80211ENUM_msgitem_status_data_ok; prism2mgmt_scan()
312 msg->numbss.data = hw->scanflag; prism2mgmt_scan()
323 msg->resultcode.data = prism2mgmt_scan()
335 msg->resultcode.data = prism2mgmt_scan()
341 msg->resultcode.data = P80211ENUM_resultcode_success; prism2mgmt_scan()
344 msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; prism2mgmt_scan()
357 * msgp ptr to msg buffer
516 * msgp ptr to msg buffer
532 struct p80211msg_dot11req_start *msg = msgp; prism2mgmt_start() local
542 memcpy(&wlandev->ssid, &msg->ssid.data, sizeof(msg->ssid.data)); prism2mgmt_start()
551 msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; prism2mgmt_start()
552 msg->resultcode.data = P80211ENUM_resultcode_not_supported; prism2mgmt_start()
556 msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; prism2mgmt_start()
561 pstr = (p80211pstrd_t *) &(msg->ssid.data); prism2mgmt_start()
582 word = msg->beaconperiod.data; prism2mgmt_start()
591 word = msg->dschannel.data; prism2mgmt_start()
599 word = p80211rate_to_p2bit(msg->basicrate1.data); prism2mgmt_start()
600 if (msg->basicrate2.status == P80211ENUM_msgitem_status_data_ok) prism2mgmt_start()
601 word |= p80211rate_to_p2bit(msg->basicrate2.data); prism2mgmt_start()
603 if (msg->basicrate3.status == P80211ENUM_msgitem_status_data_ok) prism2mgmt_start()
604 word |= p80211rate_to_p2bit(msg->basicrate3.data); prism2mgmt_start()
606 if (msg->basicrate4.status == P80211ENUM_msgitem_status_data_ok) prism2mgmt_start()
607 word |= p80211rate_to_p2bit(msg->basicrate4.data); prism2mgmt_start()
609 if (msg->basicrate5.status == P80211ENUM_msgitem_status_data_ok) prism2mgmt_start()
610 word |= p80211rate_to_p2bit(msg->basicrate5.data); prism2mgmt_start()
612 if (msg->basicrate6.status == P80211ENUM_msgitem_status_data_ok) prism2mgmt_start()
613 word |= p80211rate_to_p2bit(msg->basicrate6.data); prism2mgmt_start()
615 if (msg->basicrate7.status == P80211ENUM_msgitem_status_data_ok) prism2mgmt_start()
616 word |= p80211rate_to_p2bit(msg->basicrate7.data); prism2mgmt_start()
618 if (msg->basicrate8.status == P80211ENUM_msgitem_status_data_ok) prism2mgmt_start()
619 word |= p80211rate_to_p2bit(msg->basicrate8.data); prism2mgmt_start()
629 word = p80211rate_to_p2bit(msg->operationalrate1.data); prism2mgmt_start()
630 if (msg->operationalrate2.status == P80211ENUM_msgitem_status_data_ok) prism2mgmt_start()
631 word |= p80211rate_to_p2bit(msg->operationalrate2.data); prism2mgmt_start()
633 if (msg->operationalrate3.status == P80211ENUM_msgitem_status_data_ok) prism2mgmt_start()
634 word |= p80211rate_to_p2bit(msg->operationalrate3.data); prism2mgmt_start()
636 if (msg->operationalrate4.status == P80211ENUM_msgitem_status_data_ok) prism2mgmt_start()
637 word |= p80211rate_to_p2bit(msg->operationalrate4.data); prism2mgmt_start()
639 if (msg->operationalrate5.status == P80211ENUM_msgitem_status_data_ok) prism2mgmt_start()
640 word |= p80211rate_to_p2bit(msg->operationalrate5.data); prism2mgmt_start()
642 if (msg->operationalrate6.status == P80211ENUM_msgitem_status_data_ok) prism2mgmt_start()
643 word |= p80211rate_to_p2bit(msg->operationalrate6.data); prism2mgmt_start()
645 if (msg->operationalrate7.status == P80211ENUM_msgitem_status_data_ok) prism2mgmt_start()
646 word |= p80211rate_to_p2bit(msg->operationalrate7.data); prism2mgmt_start()
648 if (msg->operationalrate8.status == P80211ENUM_msgitem_status_data_ok) prism2mgmt_start()
649 word |= p80211rate_to_p2bit(msg->operationalrate8.data); prism2mgmt_start()
666 if (msg->bsstype.data == P80211ENUM_bsstype_independent) { prism2mgmt_start()
680 msg->resultcode.data = P80211ENUM_resultcode_success; prism2mgmt_start()
685 msg->resultcode.data = P80211ENUM_resultcode_invalid_parameters; prism2mgmt_start()
700 * msgp ptr to msg buffer
714 struct p80211msg_p2req_readpda *msg = msgp; prism2mgmt_readpda() local
723 msg->resultcode.data = prism2mgmt_readpda()
725 msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; prism2mgmt_readpda()
731 msg->pda.data, prism2mgmt_readpda()
738 msg->resultcode.data = prism2mgmt_readpda()
740 msg->resultcode.status = prism2mgmt_readpda()
744 msg->pda.status = P80211ENUM_msgitem_status_data_ok; prism2mgmt_readpda()
745 msg->resultcode.data = P80211ENUM_resultcode_success; prism2mgmt_readpda()
746 msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; prism2mgmt_readpda()
766 * msgp ptr to msg buffer
780 struct p80211msg_p2req_ramdl_state *msg = msgp; prism2mgmt_ramdl_state() local
785 msg->resultcode.data = prism2mgmt_ramdl_state()
787 msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; prism2mgmt_ramdl_state()
796 msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; prism2mgmt_ramdl_state()
797 if (msg->enable.data == P80211ENUM_truth_true) { prism2mgmt_ramdl_state()
798 if (hfa384x_drvr_ramdl_enable(hw, msg->exeaddr.data)) { prism2mgmt_ramdl_state()
799 msg->resultcode.data = prism2mgmt_ramdl_state()
802 msg->resultcode.data = P80211ENUM_resultcode_success; prism2mgmt_ramdl_state()
806 msg->resultcode.data = P80211ENUM_resultcode_success; prism2mgmt_ramdl_state()
821 * msgp ptr to msg buffer
835 struct p80211msg_p2req_ramdl_write *msg = msgp; prism2mgmt_ramdl_write() local
843 msg->resultcode.data = prism2mgmt_ramdl_write()
845 msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; prism2mgmt_ramdl_write()
849 msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; prism2mgmt_ramdl_write()
851 if (msg->len.data > sizeof(msg->data.data)) { prism2mgmt_ramdl_write()
852 msg->resultcode.status = prism2mgmt_ramdl_write()
857 addr = msg->addr.data; prism2mgmt_ramdl_write()
858 len = msg->len.data; prism2mgmt_ramdl_write()
859 buf = msg->data.data; prism2mgmt_ramdl_write()
861 msg->resultcode.data = P80211ENUM_resultcode_refused; prism2mgmt_ramdl_write()
863 msg->resultcode.data = P80211ENUM_resultcode_success; prism2mgmt_ramdl_write()
882 * msgp ptr to msg buffer
897 struct p80211msg_p2req_flashdl_state *msg = msgp; prism2mgmt_flashdl_state() local
902 msg->resultcode.data = prism2mgmt_flashdl_state()
904 msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; prism2mgmt_flashdl_state()
913 msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; prism2mgmt_flashdl_state()
914 if (msg->enable.data == P80211ENUM_truth_true) { prism2mgmt_flashdl_state()
916 msg->resultcode.data = prism2mgmt_flashdl_state()
919 msg->resultcode.data = P80211ENUM_resultcode_success; prism2mgmt_flashdl_state()
923 msg->resultcode.data = P80211ENUM_resultcode_success; prism2mgmt_flashdl_state()
937 msg->resultcode.data = prism2mgmt_flashdl_state()
953 * msgp ptr to msg buffer
967 struct p80211msg_p2req_flashdl_write *msg = msgp; prism2mgmt_flashdl_write() local
975 msg->resultcode.data = prism2mgmt_flashdl_write()
977 msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; prism2mgmt_flashdl_write()
986 msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; prism2mgmt_flashdl_write()
988 if (msg->len.data > sizeof(msg->data.data)) { prism2mgmt_flashdl_write()
989 msg->resultcode.status = prism2mgmt_flashdl_write()
994 addr = msg->addr.data; prism2mgmt_flashdl_write()
995 len = msg->len.data; prism2mgmt_flashdl_write()
996 buf = msg->data.data; prism2mgmt_flashdl_write()
998 msg->resultcode.data = P80211ENUM_resultcode_refused; prism2mgmt_flashdl_write()
1000 msg->resultcode.data = P80211ENUM_resultcode_success; prism2mgmt_flashdl_write()
1012 * msgp ptr to msg buffer
1030 struct p80211msg_lnxreq_autojoin *msg = msgp; prism2mgmt_autojoin() local
1038 memcpy(&wlandev->ssid, &msg->ssid.data, sizeof(msg->ssid.data)); prism2mgmt_autojoin()
1048 if (msg->authtype.data == P80211ENUM_authalg_sharedkey) prism2mgmt_autojoin()
1057 pstr = (p80211pstrd_t *) &(msg->ssid.data); prism2mgmt_autojoin()
1070 msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; prism2mgmt_autojoin()
1071 msg->resultcode.data = P80211ENUM_resultcode_success; prism2mgmt_autojoin()
1083 * msgp ptr to msg buffer
1098 struct p80211msg_lnxreq_wlansniff *msg = msgp; prism2mgmt_wlansniff() local
1103 msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; prism2mgmt_wlansniff()
1104 switch (msg->enable.data) { prism2mgmt_wlansniff()
1108 msg->resultcode.data = prism2mgmt_wlansniff()
1167 msg->resultcode.data = P80211ENUM_resultcode_success; prism2mgmt_wlansniff()
1214 word = msg->channel.data; prism2mgmt_wlansniff()
1239 if ((msg->keepwepflags.status == prism2mgmt_wlansniff()
1241 && (msg->keepwepflags.data != prism2mgmt_wlansniff()
1261 if ((msg->stripfcs.status == P80211ENUM_msgitem_status_data_ok) prism2mgmt_wlansniff()
1262 && (msg->stripfcs.data == P80211ENUM_truth_true)) { prism2mgmt_wlansniff()
1269 if (msg->packet_trunc.status == prism2mgmt_wlansniff()
1271 hw->sniff_truncate = msg->packet_trunc.data; prism2mgmt_wlansniff()
1297 if ((msg->prismheader.status == prism2mgmt_wlansniff()
1299 && (msg->prismheader.data == P80211ENUM_truth_true)) { prism2mgmt_wlansniff()
1303 if ((msg->wlanheader.status == prism2mgmt_wlansniff()
1305 && (msg->wlanheader.data == P80211ENUM_truth_true)) { prism2mgmt_wlansniff()
1312 msg->resultcode.data = P80211ENUM_resultcode_success; prism2mgmt_wlansniff()
1315 msg->resultcode.data = P80211ENUM_resultcode_invalid_parameters; prism2mgmt_wlansniff()
1320 msg->resultcode.data = P80211ENUM_resultcode_refused; prism2mgmt_wlansniff()
H A Dprism2mib.c92 struct p80211msg_dot11req_mibset *msg, void *data);
99 struct p80211msg_dot11req_mibset *msg,
106 struct p80211msg_dot11req_mibset *msg, void *data);
112 struct p80211msg_dot11req_mibset *msg, void *data);
118 struct p80211msg_dot11req_mibset *msg,
125 struct p80211msg_dot11req_mibset *msg,
132 struct p80211msg_dot11req_mibset *msg,
139 struct p80211msg_dot11req_mibset *msg,
146 struct p80211msg_dot11req_mibset *msg, void *data);
247 * msgp ptr to msg buffer
268 struct p80211msg_dot11req_mibset *msg = msgp; prism2mgmt_mibset_mibget() local
271 msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; prism2mgmt_mibset_mibget()
272 msg->resultcode.data = P80211ENUM_resultcode_success; prism2mgmt_mibset_mibget()
287 mibitem = (p80211itemd_t *) msg->mibattribute.data; prism2mgmt_mibset_mibget()
294 msg->resultcode.data = P80211ENUM_resultcode_not_supported; prism2mgmt_mibset_mibget()
304 isget = (msg->msgcode == DIDmsg_dot11req_mibget); prism2mgmt_mibset_mibget()
308 msg->resultcode.data = prism2mgmt_mibset_mibget()
314 msg->resultcode.data = prism2mgmt_mibset_mibget()
328 result = mib->func(mib, isget, wlandev, hw, msg, (void *)mibitem->data); prism2mgmt_mibset_mibget()
330 if (msg->resultcode.data == P80211ENUM_resultcode_success) { prism2mgmt_mibset_mibget()
333 msg->resultcode.data = prism2mgmt_mibset_mibget()
337 msg->mibattribute.status = prism2mgmt_mibset_mibget()
365 * msg Message structure.
378 struct p80211msg_dot11req_mibset *msg, prism2mib_bytearea2pstr()
415 * msg Message structure.
428 struct p80211msg_dot11req_mibset *msg, void *data) prism2mib_uint32()
462 * msg Message structure.
475 struct p80211msg_dot11req_mibset *msg, void *data) prism2mib_flag()
519 * msg Message structure.
532 struct p80211msg_dot11req_mibset *msg, prism2mib_wepdefaultkey()
569 * msg Message structure.
582 struct p80211msg_dot11req_mibset *msg, prism2mib_privacyinvoked()
592 return prism2mib_flag(mib, isget, wlandev, hw, msg, data); prism2mib_privacyinvoked()
611 * msg Message structure.
624 struct p80211msg_dot11req_mibset *msg, prism2mib_excludeunencrypted()
628 return prism2mib_flag(mib, isget, wlandev, hw, msg, data); prism2mib_excludeunencrypted()
647 * msg Message structure.
660 struct p80211msg_dot11req_mibset *msg, prism2mib_fragmentationthreshold()
670 msg->resultcode.data = prism2mib_fragmentationthreshold()
675 result = prism2mib_uint32(mib, isget, wlandev, hw, msg, data); prism2mib_fragmentationthreshold()
696 * msg Message structure.
709 struct p80211msg_dot11req_mibset *msg, void *data) prism2mib_priv()
792 * msg wlan message
814 * msg wlan message
374 prism2mib_bytearea2pstr(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, struct p80211msg_dot11req_mibset *msg, void *data) prism2mib_bytearea2pstr() argument
424 prism2mib_uint32(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, struct p80211msg_dot11req_mibset *msg, void *data) prism2mib_uint32() argument
471 prism2mib_flag(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, struct p80211msg_dot11req_mibset *msg, void *data) prism2mib_flag() argument
528 prism2mib_wepdefaultkey(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, struct p80211msg_dot11req_mibset *msg, void *data) prism2mib_wepdefaultkey() argument
578 prism2mib_privacyinvoked(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, struct p80211msg_dot11req_mibset *msg, void *data) prism2mib_privacyinvoked() argument
620 prism2mib_excludeunencrypted(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, struct p80211msg_dot11req_mibset *msg, void *data) prism2mib_excludeunencrypted() argument
656 prism2mib_fragmentationthreshold(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, struct p80211msg_dot11req_mibset *msg, void *data) prism2mib_fragmentationthreshold() argument
705 prism2mib_priv(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, struct p80211msg_dot11req_mibset *msg, void *data) prism2mib_priv() argument
H A Dp80211req.c75 static void p80211req_handlemsg(wlandevice_t *wlandev, struct p80211msg *msg);
98 struct p80211msg *msg = (struct p80211msg *) msgbuf; p80211req_dorequest() local
102 msg->msgcode == DIDmsg_lnxreq_ifstate) || p80211req_dorequest()
110 (msg->msgcode != DIDmsg_dot11req_mibget)) { p80211req_dorequest()
121 /* Allow p80211 to look at msg and handle if desired. */ p80211req_dorequest()
124 p80211req_handlemsg(wlandev, msg); p80211req_dorequest()
128 wlandev->mlmerequest(wlandev, msg); p80211req_dorequest()
131 return 0; /* if result==0, msg->status still may contain an err */ p80211req_dorequest()
144 * msg message structure
147 * nothing (any results are set in the status field of the msg)
152 static void p80211req_handlemsg(wlandevice_t *wlandev, struct p80211msg *msg) p80211req_handlemsg() argument
154 switch (msg->msgcode) { p80211req_handlemsg()
158 (struct p80211msg_lnxreq_hostwep *) msg; p80211req_handlemsg()
170 int isget = (msg->msgcode == DIDmsg_dot11req_mibget); p80211req_handlemsg()
172 (struct p80211msg_dot11req_mibget *) msg; p80211req_handlemsg()
176 } /* switch msg->msgcode */ p80211req_handlemsg()
/linux-4.4.14/drivers/net/can/usb/
H A Desd_usb2.c183 } msg; member in struct:esd_usb2_msg
227 struct esd_usb2_msg *msg) esd_usb2_rx_event()
232 u32 id = le32_to_cpu(msg->msg.rx.id) & ESD_IDMASK; esd_usb2_rx_event()
235 u8 state = msg->msg.rx.data[0]; esd_usb2_rx_event()
236 u8 ecc = msg->msg.rx.data[1]; esd_usb2_rx_event()
237 u8 txerr = msg->msg.rx.data[2]; esd_usb2_rx_event()
238 u8 rxerr = msg->msg.rx.data[3]; esd_usb2_rx_event()
313 struct esd_usb2_msg *msg) esd_usb2_rx_can_msg()
324 id = le32_to_cpu(msg->msg.rx.id); esd_usb2_rx_can_msg()
327 esd_usb2_rx_event(priv, msg); esd_usb2_rx_can_msg()
336 cf->can_dlc = get_can_dlc(msg->msg.rx.dlc); esd_usb2_rx_can_msg()
341 if (msg->msg.rx.dlc & ESD_RTR) { esd_usb2_rx_can_msg()
345 cf->data[i] = msg->msg.rx.data[i]; esd_usb2_rx_can_msg()
357 struct esd_usb2_msg *msg) esd_usb2_tx_done_msg()
366 context = &priv->tx_contexts[msg->msg.txdone.hnd & (MAX_TX_URBS - 1)]; esd_usb2_tx_done_msg()
368 if (!msg->msg.txdone.status) { esd_usb2_tx_done_msg()
406 struct esd_usb2_msg *msg; esd_usb2_read_bulk_callback() local
408 msg = (struct esd_usb2_msg *)(urb->transfer_buffer + pos); esd_usb2_read_bulk_callback()
410 switch (msg->msg.hdr.cmd) { esd_usb2_read_bulk_callback()
412 if (msg->msg.rx.net >= dev->net_count) { esd_usb2_read_bulk_callback()
417 esd_usb2_rx_can_msg(dev->nets[msg->msg.rx.net], msg); esd_usb2_read_bulk_callback()
421 if (msg->msg.txdone.net >= dev->net_count) { esd_usb2_read_bulk_callback()
426 esd_usb2_tx_done_msg(dev->nets[msg->msg.txdone.net], esd_usb2_read_bulk_callback()
427 msg); esd_usb2_read_bulk_callback()
431 pos += msg->msg.hdr.len << 2; esd_usb2_read_bulk_callback()
522 static int esd_usb2_send_msg(struct esd_usb2 *dev, struct esd_usb2_msg *msg) esd_usb2_send_msg() argument
528 msg, esd_usb2_send_msg()
529 msg->msg.hdr.len << 2, esd_usb2_send_msg()
535 struct esd_usb2_msg *msg) esd_usb2_wait_msg()
541 msg, esd_usb2_wait_msg()
542 sizeof(*msg), esd_usb2_wait_msg()
620 struct esd_usb2_msg *msg; esd_usb2_start() local
623 msg = kmalloc(sizeof(*msg), GFP_KERNEL); esd_usb2_start()
624 if (!msg) { esd_usb2_start()
642 msg->msg.hdr.cmd = CMD_IDADD; esd_usb2_start()
643 msg->msg.hdr.len = 2 + ESD_MAX_ID_SEGMENT; esd_usb2_start()
644 msg->msg.filter.net = priv->index; esd_usb2_start()
645 msg->msg.filter.option = ESD_ID_ENABLE; /* start with segment 0 */ esd_usb2_start()
647 msg->msg.filter.mask[i] = cpu_to_le32(0xffffffff); esd_usb2_start()
649 msg->msg.filter.mask[ESD_MAX_ID_SEGMENT] = cpu_to_le32(0x00000001); esd_usb2_start()
651 err = esd_usb2_send_msg(dev, msg); esd_usb2_start()
667 kfree(msg); esd_usb2_start()
720 struct esd_usb2_msg *msg; esd_usb2_start_xmit() local
748 msg = (struct esd_usb2_msg *)buf; esd_usb2_start_xmit()
750 msg->msg.hdr.len = 3; /* minimal length */ esd_usb2_start_xmit()
751 msg->msg.hdr.cmd = CMD_CAN_TX; esd_usb2_start_xmit()
752 msg->msg.tx.net = priv->index; esd_usb2_start_xmit()
753 msg->msg.tx.dlc = cf->can_dlc; esd_usb2_start_xmit()
754 msg->msg.tx.id = cpu_to_le32(cf->can_id & CAN_ERR_MASK); esd_usb2_start_xmit()
757 msg->msg.tx.dlc |= ESD_RTR; esd_usb2_start_xmit()
760 msg->msg.tx.id |= cpu_to_le32(ESD_EXTID); esd_usb2_start_xmit()
763 msg->msg.tx.data[i] = cf->data[i]; esd_usb2_start_xmit()
765 msg->msg.hdr.len += (cf->can_dlc + 3) >> 2; esd_usb2_start_xmit()
788 msg->msg.tx.hnd = 0x80000000 | i; /* returned in TX done message */ esd_usb2_start_xmit()
791 msg->msg.hdr.len << 2, esd_usb2_start_xmit()
846 struct esd_usb2_msg *msg; esd_usb2_close() local
849 msg = kmalloc(sizeof(*msg), GFP_KERNEL); esd_usb2_close()
850 if (!msg) esd_usb2_close()
854 msg->msg.hdr.cmd = CMD_IDADD; esd_usb2_close()
855 msg->msg.hdr.len = 2 + ESD_MAX_ID_SEGMENT; esd_usb2_close()
856 msg->msg.filter.net = priv->index; esd_usb2_close()
857 msg->msg.filter.option = ESD_ID_ENABLE; /* start with segment 0 */ esd_usb2_close()
859 msg->msg.filter.mask[i] = 0; esd_usb2_close()
860 if (esd_usb2_send_msg(priv->usb2, msg) < 0) esd_usb2_close()
864 msg->msg.hdr.len = 2; esd_usb2_close()
865 msg->msg.hdr.cmd = CMD_SETBAUD; esd_usb2_close()
866 msg->msg.setbaud.net = priv->index; esd_usb2_close()
867 msg->msg.setbaud.rsvd = 0; esd_usb2_close()
868 msg->msg.setbaud.baud = cpu_to_le32(ESD_USB2_NO_BAUDRATE); esd_usb2_close()
869 if (esd_usb2_send_msg(priv->usb2, msg) < 0) esd_usb2_close()
878 kfree(msg); esd_usb2_close()
906 struct esd_usb2_msg *msg; esd_usb2_set_bittiming() local
933 msg = kmalloc(sizeof(*msg), GFP_KERNEL); esd_usb2_set_bittiming()
934 if (!msg) esd_usb2_set_bittiming()
937 msg->msg.hdr.len = 2; esd_usb2_set_bittiming()
938 msg->msg.hdr.cmd = CMD_SETBAUD; esd_usb2_set_bittiming()
939 msg->msg.setbaud.net = priv->index; esd_usb2_set_bittiming()
940 msg->msg.setbaud.rsvd = 0; esd_usb2_set_bittiming()
941 msg->msg.setbaud.baud = cpu_to_le32(canbtr); esd_usb2_set_bittiming()
945 err = esd_usb2_send_msg(priv->usb2, msg); esd_usb2_set_bittiming()
947 kfree(msg); esd_usb2_set_bittiming()
1051 struct esd_usb2_msg *msg; esd_usb2_probe() local
1066 msg = kmalloc(sizeof(*msg), GFP_KERNEL); esd_usb2_probe()
1067 if (!msg) { esd_usb2_probe()
1073 msg->msg.hdr.cmd = CMD_VERSION; esd_usb2_probe()
1074 msg->msg.hdr.len = 2; esd_usb2_probe()
1075 msg->msg.version.rsvd = 0; esd_usb2_probe()
1076 msg->msg.version.flags = 0; esd_usb2_probe()
1077 msg->msg.version.drv_version = 0; esd_usb2_probe()
1079 err = esd_usb2_send_msg(dev, msg); esd_usb2_probe()
1085 err = esd_usb2_wait_msg(dev, msg); esd_usb2_probe()
1091 dev->net_count = (int)msg->msg.version_reply.nets; esd_usb2_probe()
1092 dev->version = le32_to_cpu(msg->msg.version_reply.version); esd_usb2_probe()
1111 kfree(msg); esd_usb2_probe()
226 esd_usb2_rx_event(struct esd_usb2_net_priv *priv, struct esd_usb2_msg *msg) esd_usb2_rx_event() argument
312 esd_usb2_rx_can_msg(struct esd_usb2_net_priv *priv, struct esd_usb2_msg *msg) esd_usb2_rx_can_msg() argument
356 esd_usb2_tx_done_msg(struct esd_usb2_net_priv *priv, struct esd_usb2_msg *msg) esd_usb2_tx_done_msg() argument
534 esd_usb2_wait_msg(struct esd_usb2 *dev, struct esd_usb2_msg *msg) esd_usb2_wait_msg() argument
H A Dkvaser_usb.c104 /* Can msg ids */
259 u8 msg[14]; member in struct:kvaser_msg_tx_can
282 u8 msg[14]; member in struct:leaf_msg_rx_can
289 u8 msg[14]; member in struct:usbcan_msg_rx_can
556 struct kvaser_msg *msg) kvaser_usb_send_msg()
563 msg, msg->len, &actual_len, kvaser_usb_send_msg()
568 struct kvaser_msg *msg) kvaser_usb_wait_msg()
611 memcpy(msg, tmp, tmp->len); kvaser_usb_wait_msg()
630 struct kvaser_msg *msg; kvaser_usb_send_simple_msg() local
633 msg = kmalloc(sizeof(*msg), GFP_KERNEL); kvaser_usb_send_simple_msg()
634 if (!msg) kvaser_usb_send_simple_msg()
637 msg->id = msg_id; kvaser_usb_send_simple_msg()
638 msg->len = MSG_HEADER_LEN + sizeof(struct kvaser_msg_simple); kvaser_usb_send_simple_msg()
639 msg->u.simple.channel = channel; kvaser_usb_send_simple_msg()
640 msg->u.simple.tid = 0xff; kvaser_usb_send_simple_msg()
642 rc = kvaser_usb_send_msg(dev, msg); kvaser_usb_send_simple_msg()
644 kfree(msg); kvaser_usb_send_simple_msg()
650 struct kvaser_msg msg; kvaser_usb_get_software_info() local
657 err = kvaser_usb_wait_msg(dev, CMD_GET_SOFTWARE_INFO_REPLY, &msg); kvaser_usb_get_software_info()
663 dev->fw_version = le32_to_cpu(msg.u.leaf.softinfo.fw_version); kvaser_usb_get_software_info()
665 le16_to_cpu(msg.u.leaf.softinfo.max_outstanding_tx); kvaser_usb_get_software_info()
668 dev->fw_version = le32_to_cpu(msg.u.usbcan.softinfo.fw_version); kvaser_usb_get_software_info()
670 le16_to_cpu(msg.u.usbcan.softinfo.max_outstanding_tx); kvaser_usb_get_software_info()
679 struct kvaser_msg msg; kvaser_usb_get_card_info() local
686 err = kvaser_usb_wait_msg(dev, CMD_GET_CARD_INFO_REPLY, &msg); kvaser_usb_get_card_info()
690 dev->nchannels = msg.u.cardinfo.nchannels; kvaser_usb_get_card_info()
700 const struct kvaser_msg *msg) kvaser_usb_tx_acknowledge()
710 channel = msg->u.tx_acknowledge_header.channel; kvaser_usb_tx_acknowledge()
711 tid = msg->u.tx_acknowledge_header.tid; kvaser_usb_tx_acknowledge()
778 struct kvaser_msg *msg; kvaser_usb_simple_msg_async() local
795 msg = (struct kvaser_msg *)buf; kvaser_usb_simple_msg_async()
796 msg->len = MSG_HEADER_LEN + sizeof(struct kvaser_msg_simple); kvaser_usb_simple_msg_async()
797 msg->id = msg_id; kvaser_usb_simple_msg_async()
798 msg->u.simple.channel = priv->channel; kvaser_usb_simple_msg_async()
803 buf, msg->len, kvaser_usb_simple_msg_async()
1016 const struct kvaser_msg *msg) kvaser_usbcan_rx_error()
1020 switch (msg->id) { kvaser_usbcan_rx_error()
1023 es.channel = msg->u.usbcan.chip_state_event.channel; kvaser_usbcan_rx_error()
1024 es.status = msg->u.usbcan.chip_state_event.status; kvaser_usbcan_rx_error()
1025 es.txerr = msg->u.usbcan.chip_state_event.tx_errors_count; kvaser_usbcan_rx_error()
1026 es.rxerr = msg->u.usbcan.chip_state_event.rx_errors_count; kvaser_usbcan_rx_error()
1032 es.status = msg->u.usbcan.error_event.status_ch0; kvaser_usbcan_rx_error()
1033 es.txerr = msg->u.usbcan.error_event.tx_errors_count_ch0; kvaser_usbcan_rx_error()
1034 es.rxerr = msg->u.usbcan.error_event.rx_errors_count_ch0; kvaser_usbcan_rx_error()
1036 msg->u.usbcan.error_event.status_ch1; kvaser_usbcan_rx_error()
1044 es.status = msg->u.usbcan.error_event.status_ch1; kvaser_usbcan_rx_error()
1045 es.txerr = msg->u.usbcan.error_event.tx_errors_count_ch1; kvaser_usbcan_rx_error()
1046 es.rxerr = msg->u.usbcan.error_event.rx_errors_count_ch1; kvaser_usbcan_rx_error()
1048 msg->u.usbcan.error_event.status_ch0; kvaser_usbcan_rx_error()
1054 dev_err(dev->udev->dev.parent, "Invalid msg id (%d)\n", kvaser_usbcan_rx_error()
1055 msg->id); kvaser_usbcan_rx_error()
1060 const struct kvaser_msg *msg) kvaser_leaf_rx_error()
1064 switch (msg->id) { kvaser_leaf_rx_error()
1066 es.channel = msg->u.leaf.error_event.channel; kvaser_leaf_rx_error()
1067 es.status = msg->u.leaf.error_event.status; kvaser_leaf_rx_error()
1068 es.txerr = msg->u.leaf.error_event.tx_errors_count; kvaser_leaf_rx_error()
1069 es.rxerr = msg->u.leaf.error_event.rx_errors_count; kvaser_leaf_rx_error()
1070 es.leaf.error_factor = msg->u.leaf.error_event.error_factor; kvaser_leaf_rx_error()
1073 es.channel = msg->u.leaf.log_message.channel; kvaser_leaf_rx_error()
1074 es.status = msg->u.leaf.log_message.data[0]; kvaser_leaf_rx_error()
1075 es.txerr = msg->u.leaf.log_message.data[2]; kvaser_leaf_rx_error()
1076 es.rxerr = msg->u.leaf.log_message.data[3]; kvaser_leaf_rx_error()
1077 es.leaf.error_factor = msg->u.leaf.log_message.data[1]; kvaser_leaf_rx_error()
1080 es.channel = msg->u.leaf.chip_state_event.channel; kvaser_leaf_rx_error()
1081 es.status = msg->u.leaf.chip_state_event.status; kvaser_leaf_rx_error()
1082 es.txerr = msg->u.leaf.chip_state_event.tx_errors_count; kvaser_leaf_rx_error()
1083 es.rxerr = msg->u.leaf.chip_state_event.rx_errors_count; kvaser_leaf_rx_error()
1087 dev_err(dev->udev->dev.parent, "Invalid msg id (%d)\n", kvaser_leaf_rx_error()
1088 msg->id); kvaser_leaf_rx_error()
1096 const struct kvaser_msg *msg) kvaser_usb_rx_can_err()
1102 if (msg->u.rx_can_header.flag & (MSG_FLAG_ERROR_FRAME | kvaser_usb_rx_can_err()
1105 msg->u.rx_can_header.flag); kvaser_usb_rx_can_err()
1111 if (msg->u.rx_can_header.flag & MSG_FLAG_OVERRUN) { kvaser_usb_rx_can_err()
1131 const struct kvaser_msg *msg) kvaser_usb_rx_can_msg()
1137 u8 channel = msg->u.rx_can_header.channel; kvaser_usb_rx_can_msg()
1149 if ((msg->u.rx_can_header.flag & MSG_FLAG_ERROR_FRAME) && kvaser_usb_rx_can_msg()
1150 (dev->family == KVASER_LEAF && msg->id == CMD_LEAF_LOG_MESSAGE)) { kvaser_usb_rx_can_msg()
1151 kvaser_leaf_rx_error(dev, msg); kvaser_usb_rx_can_msg()
1153 } else if (msg->u.rx_can_header.flag & (MSG_FLAG_ERROR_FRAME | kvaser_usb_rx_can_msg()
1156 kvaser_usb_rx_can_err(priv, msg); kvaser_usb_rx_can_msg()
1158 } else if (msg->u.rx_can_header.flag & ~MSG_FLAG_REMOTE_FRAME) { kvaser_usb_rx_can_msg()
1161 msg->u.rx_can_header.flag); kvaser_usb_rx_can_msg()
1167 rx_msg = msg->u.leaf.rx_can.msg; kvaser_usb_rx_can_msg()
1170 rx_msg = msg->u.usbcan.rx_can.msg; kvaser_usb_rx_can_msg()
1180 if (dev->family == KVASER_LEAF && msg->id == CMD_LEAF_LOG_MESSAGE) { kvaser_usb_rx_can_msg()
1181 cf->can_id = le32_to_cpu(msg->u.leaf.log_message.id); kvaser_usb_rx_can_msg()
1187 cf->can_dlc = get_can_dlc(msg->u.leaf.log_message.dlc); kvaser_usb_rx_can_msg()
1189 if (msg->u.leaf.log_message.flags & MSG_FLAG_REMOTE_FRAME) kvaser_usb_rx_can_msg()
1192 memcpy(cf->data, &msg->u.leaf.log_message.data, kvaser_usb_rx_can_msg()
1197 if (msg->id == CMD_RX_EXT_MESSAGE) { kvaser_usb_rx_can_msg()
1207 if (msg->u.rx_can_header.flag & MSG_FLAG_REMOTE_FRAME) kvaser_usb_rx_can_msg()
1220 const struct kvaser_msg *msg) kvaser_usb_start_chip_reply()
1223 u8 channel = msg->u.simple.channel; kvaser_usb_start_chip_reply()
1243 const struct kvaser_msg *msg) kvaser_usb_stop_chip_reply()
1246 u8 channel = msg->u.simple.channel; kvaser_usb_stop_chip_reply()
1260 const struct kvaser_msg *msg) kvaser_usb_handle_message()
1262 switch (msg->id) { kvaser_usb_handle_message()
1264 kvaser_usb_start_chip_reply(dev, msg); kvaser_usb_handle_message()
1268 kvaser_usb_stop_chip_reply(dev, msg); kvaser_usb_handle_message()
1273 kvaser_usb_rx_can_msg(dev, msg); kvaser_usb_handle_message()
1279 kvaser_usb_rx_can_msg(dev, msg); kvaser_usb_handle_message()
1285 kvaser_leaf_rx_error(dev, msg); kvaser_usb_handle_message()
1287 kvaser_usbcan_rx_error(dev, msg); kvaser_usb_handle_message()
1291 kvaser_usb_tx_acknowledge(dev, msg); kvaser_usb_handle_message()
1302 "Unhandled message (%d)\n", msg->id); kvaser_usb_handle_message()
1310 struct kvaser_msg *msg; kvaser_usb_read_bulk_callback() local
1327 msg = urb->transfer_buffer + pos; kvaser_usb_read_bulk_callback()
1338 if (msg->len == 0) { kvaser_usb_read_bulk_callback()
1344 if (pos + msg->len > urb->actual_length) { kvaser_usb_read_bulk_callback()
1349 kvaser_usb_handle_message(dev, msg); kvaser_usb_read_bulk_callback()
1350 pos += msg->len; kvaser_usb_read_bulk_callback()
1447 struct kvaser_msg *msg; kvaser_usb_set_opt_mode() local
1450 msg = kmalloc(sizeof(*msg), GFP_KERNEL); kvaser_usb_set_opt_mode()
1451 if (!msg) kvaser_usb_set_opt_mode()
1454 msg->id = CMD_SET_CTRL_MODE; kvaser_usb_set_opt_mode()
1455 msg->len = MSG_HEADER_LEN + sizeof(struct kvaser_msg_ctrl_mode); kvaser_usb_set_opt_mode()
1456 msg->u.ctrl_mode.tid = 0xff; kvaser_usb_set_opt_mode()
1457 msg->u.ctrl_mode.channel = priv->channel; kvaser_usb_set_opt_mode()
1460 msg->u.ctrl_mode.ctrl_mode = KVASER_CTRL_MODE_SILENT; kvaser_usb_set_opt_mode()
1462 msg->u.ctrl_mode.ctrl_mode = KVASER_CTRL_MODE_NORMAL; kvaser_usb_set_opt_mode()
1464 rc = kvaser_usb_send_msg(priv->dev, msg); kvaser_usb_set_opt_mode()
1466 kfree(msg); kvaser_usb_set_opt_mode()
1580 struct kvaser_msg *msg; kvaser_usb_flush_queue() local
1583 msg = kmalloc(sizeof(*msg), GFP_KERNEL); kvaser_usb_flush_queue()
1584 if (!msg) kvaser_usb_flush_queue()
1587 msg->id = CMD_FLUSH_QUEUE; kvaser_usb_flush_queue()
1588 msg->len = MSG_HEADER_LEN + sizeof(struct kvaser_msg_flush_queue); kvaser_usb_flush_queue()
1589 msg->u.flush_queue.channel = priv->channel; kvaser_usb_flush_queue()
1590 msg->u.flush_queue.flags = 0x00; kvaser_usb_flush_queue()
1592 rc = kvaser_usb_send_msg(priv->dev, msg); kvaser_usb_flush_queue()
1594 kfree(msg); kvaser_usb_flush_queue()
1657 struct kvaser_msg *msg; kvaser_usb_start_xmit() local
1680 msg = buf; kvaser_usb_start_xmit()
1681 msg->len = MSG_HEADER_LEN + sizeof(struct kvaser_msg_tx_can); kvaser_usb_start_xmit()
1682 msg->u.tx_can.channel = priv->channel; kvaser_usb_start_xmit()
1686 msg_tx_can_flags = &msg->u.tx_can.leaf.flags; kvaser_usb_start_xmit()
1689 msg_tx_can_flags = &msg->u.tx_can.usbcan.flags; kvaser_usb_start_xmit()
1696 msg->id = CMD_TX_EXT_MESSAGE; kvaser_usb_start_xmit()
1697 msg->u.tx_can.msg[0] = (cf->can_id >> 24) & 0x1f; kvaser_usb_start_xmit()
1698 msg->u.tx_can.msg[1] = (cf->can_id >> 18) & 0x3f; kvaser_usb_start_xmit()
1699 msg->u.tx_can.msg[2] = (cf->can_id >> 14) & 0x0f; kvaser_usb_start_xmit()
1700 msg->u.tx_can.msg[3] = (cf->can_id >> 6) & 0xff; kvaser_usb_start_xmit()
1701 msg->u.tx_can.msg[4] = cf->can_id & 0x3f; kvaser_usb_start_xmit()
1703 msg->id = CMD_TX_STD_MESSAGE; kvaser_usb_start_xmit()
1704 msg->u.tx_can.msg[0] = (cf->can_id >> 6) & 0x1f; kvaser_usb_start_xmit()
1705 msg->u.tx_can.msg[1] = cf->can_id & 0x3f; kvaser_usb_start_xmit()
1708 msg->u.tx_can.msg[5] = cf->can_dlc; kvaser_usb_start_xmit()
1709 memcpy(&msg->u.tx_can.msg[6], cf->data, cf->can_dlc); kvaser_usb_start_xmit()
1742 msg->u.tx_can.tid = context->echo_index; kvaser_usb_start_xmit()
1747 buf, msg->len, kvaser_usb_start_xmit()
1805 struct kvaser_msg *msg; kvaser_usb_set_bittiming() local
1808 msg = kmalloc(sizeof(*msg), GFP_KERNEL); kvaser_usb_set_bittiming()
1809 if (!msg) kvaser_usb_set_bittiming()
1812 msg->id = CMD_SET_BUS_PARAMS; kvaser_usb_set_bittiming()
1813 msg->len = MSG_HEADER_LEN + sizeof(struct kvaser_msg_busparams); kvaser_usb_set_bittiming()
1814 msg->u.busparams.channel = priv->channel; kvaser_usb_set_bittiming()
1815 msg->u.busparams.tid = 0xff; kvaser_usb_set_bittiming()
1816 msg->u.busparams.bitrate = cpu_to_le32(bt->bitrate); kvaser_usb_set_bittiming()
1817 msg->u.busparams.sjw = bt->sjw; kvaser_usb_set_bittiming()
1818 msg->u.busparams.tseg1 = bt->prop_seg + bt->phase_seg1; kvaser_usb_set_bittiming()
1819 msg->u.busparams.tseg2 = bt->phase_seg2; kvaser_usb_set_bittiming()
1822 msg->u.busparams.no_samp = 3; kvaser_usb_set_bittiming()
1824 msg->u.busparams.no_samp = 1; kvaser_usb_set_bittiming()
1826 rc = kvaser_usb_send_msg(dev, msg); kvaser_usb_set_bittiming()
1828 kfree(msg); kvaser_usb_set_bittiming()
555 kvaser_usb_send_msg(const struct kvaser_usb *dev, struct kvaser_msg *msg) kvaser_usb_send_msg() argument
567 kvaser_usb_wait_msg(const struct kvaser_usb *dev, u8 id, struct kvaser_msg *msg) kvaser_usb_wait_msg() argument
699 kvaser_usb_tx_acknowledge(const struct kvaser_usb *dev, const struct kvaser_msg *msg) kvaser_usb_tx_acknowledge() argument
1015 kvaser_usbcan_rx_error(const struct kvaser_usb *dev, const struct kvaser_msg *msg) kvaser_usbcan_rx_error() argument
1059 kvaser_leaf_rx_error(const struct kvaser_usb *dev, const struct kvaser_msg *msg) kvaser_leaf_rx_error() argument
1095 kvaser_usb_rx_can_err(const struct kvaser_usb_net_priv *priv, const struct kvaser_msg *msg) kvaser_usb_rx_can_err() argument
1130 kvaser_usb_rx_can_msg(const struct kvaser_usb *dev, const struct kvaser_msg *msg) kvaser_usb_rx_can_msg() argument
1219 kvaser_usb_start_chip_reply(const struct kvaser_usb *dev, const struct kvaser_msg *msg) kvaser_usb_start_chip_reply() argument
1242 kvaser_usb_stop_chip_reply(const struct kvaser_usb *dev, const struct kvaser_msg *msg) kvaser_usb_stop_chip_reply() argument
1259 kvaser_usb_handle_message(const struct kvaser_usb *dev, const struct kvaser_msg *msg) kvaser_usb_handle_message() argument
H A Dems_usb.c131 u8 msg[8]; member in struct:cpc_can_msg
204 u8 length; /* length of data within union 'msg' */
218 } msg; member in struct:ems_cpc_msg
309 static void ems_usb_rx_can_msg(struct ems_usb *dev, struct ems_cpc_msg *msg) ems_usb_rx_can_msg() argument
320 cf->can_id = le32_to_cpu(msg->msg.can_msg.id); ems_usb_rx_can_msg()
321 cf->can_dlc = get_can_dlc(msg->msg.can_msg.length & 0xF); ems_usb_rx_can_msg()
323 if (msg->type == CPC_MSG_TYPE_EXT_CAN_FRAME || ems_usb_rx_can_msg()
324 msg->type == CPC_MSG_TYPE_EXT_RTR_FRAME) ems_usb_rx_can_msg()
327 if (msg->type == CPC_MSG_TYPE_RTR_FRAME || ems_usb_rx_can_msg()
328 msg->type == CPC_MSG_TYPE_EXT_RTR_FRAME) { ems_usb_rx_can_msg()
332 cf->data[i] = msg->msg.can_msg.msg[i]; ems_usb_rx_can_msg()
340 static void ems_usb_rx_err(struct ems_usb *dev, struct ems_cpc_msg *msg) ems_usb_rx_err() argument
350 if (msg->type == CPC_MSG_TYPE_CAN_STATE) { ems_usb_rx_err()
351 u8 state = msg->msg.can_state; ems_usb_rx_err()
366 } else if (msg->type == CPC_MSG_TYPE_CAN_FRAME_ERROR) { ems_usb_rx_err()
367 u8 ecc = msg->msg.error.cc.regs.sja1000.ecc; ems_usb_rx_err()
368 u8 txerr = msg->msg.error.cc.regs.sja1000.txerr; ems_usb_rx_err()
369 u8 rxerr = msg->msg.error.cc.regs.sja1000.rxerr; ems_usb_rx_err()
401 } else if (msg->type == CPC_MSG_TYPE_OVERRUN) { ems_usb_rx_err()
441 struct ems_cpc_msg *msg; ems_usb_read_bulk_callback() local
450 msg = (struct ems_cpc_msg *)&ibuf[start]; ems_usb_read_bulk_callback()
452 switch (msg->type) { ems_usb_read_bulk_callback()
455 ems_usb_rx_err(dev, msg); ems_usb_read_bulk_callback()
462 ems_usb_rx_can_msg(dev, msg); ems_usb_read_bulk_callback()
467 ems_usb_rx_err(dev, msg); ems_usb_read_bulk_callback()
472 ems_usb_rx_err(dev, msg); ems_usb_read_bulk_callback()
476 start += CPC_MSG_HEADER_LEN + msg->length; ems_usb_read_bulk_callback()
542 static int ems_usb_command_msg(struct ems_usb *dev, struct ems_cpc_msg *msg) ems_usb_command_msg() argument
547 memcpy(&dev->tx_msg_buffer[CPC_HEADER_SIZE], msg, ems_usb_command_msg()
548 msg->length + CPC_MSG_HEADER_LEN); ems_usb_command_msg()
555 msg->length + CPC_MSG_HEADER_LEN + CPC_HEADER_SIZE, ems_usb_command_msg()
564 dev->active_params.msg.can_params.cc_params.sja1000.mode = mode; ems_usb_write_mode()
582 cmd.msg.generic[0] = val; ems_usb_control_cmd()
745 struct ems_cpc_msg *msg; ems_usb_start_xmit() local
769 msg = (struct ems_cpc_msg *)&buf[CPC_HEADER_SIZE]; ems_usb_start_xmit()
771 msg->msg.can_msg.id = cpu_to_le32(cf->can_id & CAN_ERR_MASK); ems_usb_start_xmit()
772 msg->msg.can_msg.length = cf->can_dlc; ems_usb_start_xmit()
775 msg->type = cf->can_id & CAN_EFF_FLAG ? ems_usb_start_xmit()
778 msg->length = CPC_CAN_MSG_MIN_SIZE; ems_usb_start_xmit()
780 msg->type = cf->can_id & CAN_EFF_FLAG ? ems_usb_start_xmit()
784 msg->msg.can_msg.msg[i] = cf->data[i]; ems_usb_start_xmit()
786 msg->length = CPC_CAN_MSG_MIN_SIZE + cf->can_dlc; ems_usb_start_xmit()
935 dev->active_params.msg.can_params.cc_params.sja1000.btr0 = btr0; ems_usb_set_bittiming()
936 dev->active_params.msg.can_params.cc_params.sja1000.btr1 = btr1; ems_usb_set_bittiming()
941 static void init_params_sja1000(struct ems_cpc_msg *msg) init_params_sja1000() argument
944 &msg->msg.can_params.cc_params.sja1000; init_params_sja1000()
946 msg->type = CPC_CMD_TYPE_CAN_PARAMS; init_params_sja1000()
947 msg->length = sizeof(struct cpc_can_params); init_params_sja1000()
948 msg->msgid = 0; init_params_sja1000()
950 msg->msg.can_params.cc_type = CPC_CC_TYPE_SJA1000; init_params_sja1000()
/linux-4.4.14/drivers/hsi/clients/
H A Dhsi_char.c129 static void hsc_add_tail(struct hsc_channel *channel, struct hsi_msg *msg, hsc_add_tail() argument
135 list_add_tail(&msg->link, queue); hsc_add_tail()
142 struct hsi_msg *msg = NULL; hsc_get_first_msg() local
150 msg = list_first_entry(queue, struct hsi_msg, link); hsc_get_first_msg()
151 list_del(&msg->link); hsc_get_first_msg()
155 return msg; hsc_get_first_msg()
158 static inline void hsc_msg_free(struct hsi_msg *msg) hsc_msg_free() argument
160 kfree(sg_virt(msg->sgt.sgl)); hsc_msg_free()
161 hsi_free_msg(msg); hsc_msg_free()
166 struct hsi_msg *msg, *tmp; hsc_free_list() local
168 list_for_each_entry_safe(msg, tmp, list, link) { list_for_each_entry_safe()
169 list_del(&msg->link); list_for_each_entry_safe()
170 hsc_msg_free(msg); list_for_each_entry_safe()
188 struct hsi_msg *msg; hsc_msg_alloc() local
191 msg = hsi_alloc_msg(1, GFP_KERNEL); hsc_msg_alloc()
192 if (!msg) hsc_msg_alloc()
196 hsi_free_msg(msg); hsc_msg_alloc()
199 sg_init_one(msg->sgt.sgl, buf, alloc_size); hsc_msg_alloc()
203 return msg; hsc_msg_alloc()
210 struct hsi_msg *msg; hsc_msgs_alloc() local
214 msg = hsc_msg_alloc(max_data_size); hsc_msgs_alloc()
215 if (!msg) hsc_msgs_alloc()
217 msg->channel = channel->ch; hsc_msgs_alloc()
218 list_add_tail(&msg->link, &channel->free_msgs_list); hsc_msgs_alloc()
228 static inline unsigned int hsc_msg_len_get(struct hsi_msg *msg) hsc_msg_len_get() argument
230 return msg->sgt.sgl->length; hsc_msg_len_get()
233 static inline void hsc_msg_len_set(struct hsi_msg *msg, unsigned int len) hsc_msg_len_set() argument
235 msg->sgt.sgl->length = len; hsc_msg_len_set()
238 static void hsc_rx_completed(struct hsi_msg *msg) hsc_rx_completed() argument
240 struct hsc_client_data *cl_data = hsi_client_drvdata(msg->cl); hsc_rx_completed()
241 struct hsc_channel *channel = cl_data->channels + msg->channel; hsc_rx_completed()
244 hsc_add_tail(channel, msg, &channel->rx_msgs_queue); hsc_rx_completed()
247 hsc_add_tail(channel, msg, &channel->free_msgs_list); hsc_rx_completed()
251 static void hsc_rx_msg_destructor(struct hsi_msg *msg) hsc_rx_msg_destructor() argument
253 msg->status = HSI_STATUS_ERROR; hsc_rx_msg_destructor()
254 hsc_msg_len_set(msg, 0); hsc_rx_msg_destructor()
255 hsc_rx_completed(msg); hsc_rx_msg_destructor()
258 static void hsc_tx_completed(struct hsi_msg *msg) hsc_tx_completed() argument
260 struct hsc_client_data *cl_data = hsi_client_drvdata(msg->cl); hsc_tx_completed()
261 struct hsc_channel *channel = cl_data->channels + msg->channel; hsc_tx_completed()
264 hsc_add_tail(channel, msg, &channel->tx_msgs_queue); hsc_tx_completed()
267 hsc_add_tail(channel, msg, &channel->free_msgs_list); hsc_tx_completed()
271 static void hsc_tx_msg_destructor(struct hsi_msg *msg) hsc_tx_msg_destructor() argument
273 msg->status = HSI_STATUS_ERROR; hsc_tx_msg_destructor()
274 hsc_msg_len_set(msg, 0); hsc_tx_msg_destructor()
275 hsc_tx_completed(msg); hsc_tx_msg_destructor()
278 static void hsc_break_req_destructor(struct hsi_msg *msg) hsc_break_req_destructor() argument
280 struct hsc_client_data *cl_data = hsi_client_drvdata(msg->cl); hsc_break_req_destructor()
282 hsi_free_msg(msg); hsc_break_req_destructor()
286 static void hsc_break_received(struct hsi_msg *msg) hsc_break_received() argument
288 struct hsc_client_data *cl_data = hsi_client_drvdata(msg->cl); hsc_break_received()
307 hsi_flush(msg->cl); hsc_break_received()
308 ret = hsi_async_read(msg->cl, msg); hsc_break_received()
310 hsc_break_req_destructor(msg); hsc_break_received()
316 struct hsi_msg *msg; hsc_break_request() local
322 msg = hsi_alloc_msg(0, GFP_KERNEL); hsc_break_request()
323 if (!msg) { hsc_break_request()
327 msg->break_frame = 1; hsc_break_request()
328 msg->complete = hsc_break_received; hsc_break_request()
329 msg->destructor = hsc_break_req_destructor; hsc_break_request()
330 ret = hsi_async_read(cl, msg); hsc_break_request()
332 hsc_break_req_destructor(msg); hsc_break_request()
339 struct hsi_msg *msg; hsc_break_send() local
342 msg = hsi_alloc_msg(0, GFP_ATOMIC); hsc_break_send()
343 if (!msg) hsc_break_send()
345 msg->break_frame = 1; hsc_break_send()
346 msg->complete = hsi_free_msg; hsc_break_send()
347 msg->destructor = hsi_free_msg; hsc_break_send()
348 ret = hsi_async_write(cl, msg); hsc_break_send()
350 hsi_free_msg(msg); hsc_break_send()
429 struct hsi_msg *msg; hsc_read() local
442 msg = hsc_get_first_msg(channel, &channel->free_msgs_list); hsc_read()
443 if (!msg) { hsc_read()
447 hsc_msg_len_set(msg, len); hsc_read()
448 msg->complete = hsc_rx_completed; hsc_read()
449 msg->destructor = hsc_rx_msg_destructor; hsc_read()
450 ret = hsi_async_read(channel->cl, msg); hsc_read()
452 hsc_add_tail(channel, msg, &channel->free_msgs_list); hsc_read()
464 msg = hsc_get_first_msg(channel, &channel->rx_msgs_queue); hsc_read()
465 if (msg) { hsc_read()
466 if (msg->status != HSI_STATUS_ERROR) { hsc_read()
468 sg_virt(msg->sgt.sgl), hsc_msg_len_get(msg)); hsc_read()
472 ret = hsc_msg_len_get(msg); hsc_read()
476 hsc_add_tail(channel, msg, &channel->free_msgs_list); hsc_read()
488 struct hsi_msg *msg; hsc_write() local
499 msg = hsc_get_first_msg(channel, &channel->free_msgs_list); hsc_write()
500 if (!msg) { hsc_write()
504 if (copy_from_user(sg_virt(msg->sgt.sgl), (void __user *)buf, len)) { hsc_write()
508 hsc_msg_len_set(msg, len); hsc_write()
509 msg->complete = hsc_tx_completed; hsc_write()
510 msg->destructor = hsc_tx_msg_destructor; hsc_write()
511 ret = hsi_async_write(channel->cl, msg); hsc_write()
523 msg = hsc_get_first_msg(channel, &channel->tx_msgs_queue); hsc_write()
524 if (msg) { hsc_write()
525 if (msg->status == HSI_STATUS_ERROR) hsc_write()
528 ret = hsc_msg_len_get(msg); hsc_write()
530 hsc_add_tail(channel, msg, &channel->free_msgs_list); hsc_write()
H A Dssi_protocol.c161 static void ssip_rxcmd_complete(struct hsi_msg *msg);
163 static inline void ssip_set_cmd(struct hsi_msg *msg, u32 cmd) ssip_set_cmd() argument
167 data = sg_virt(msg->sgt.sgl); ssip_set_cmd()
171 static inline u32 ssip_get_cmd(struct hsi_msg *msg) ssip_get_cmd() argument
175 data = sg_virt(msg->sgt.sgl); ssip_get_cmd()
180 static void ssip_skb_to_msg(struct sk_buff *skb, struct hsi_msg *msg) ssip_skb_to_msg() argument
186 BUG_ON(msg->sgt.nents != (unsigned int)(skb_shinfo(skb)->nr_frags + 1)); ssip_skb_to_msg()
188 sg = msg->sgt.sgl; ssip_skb_to_msg()
198 static void ssip_free_data(struct hsi_msg *msg) ssip_free_data() argument
202 skb = msg->context; ssip_free_data()
203 pr_debug("free data: msg %p context %p skb %p\n", msg, msg->context, ssip_free_data()
205 msg->destructor = NULL; ssip_free_data()
207 hsi_free_msg(msg); ssip_free_data()
213 struct hsi_msg *msg; ssip_alloc_data() local
215 msg = hsi_alloc_msg(skb_shinfo(skb)->nr_frags + 1, flags); ssip_alloc_data()
216 if (!msg) ssip_alloc_data()
218 ssip_skb_to_msg(skb, msg); ssip_alloc_data()
219 msg->destructor = ssip_free_data; ssip_alloc_data()
220 msg->channel = ssi->channel_id_data; ssip_alloc_data()
221 msg->context = skb; ssip_alloc_data()
223 return msg; ssip_alloc_data()
226 static inline void ssip_release_cmd(struct hsi_msg *msg) ssip_release_cmd() argument
228 struct ssi_protocol *ssi = hsi_client_drvdata(msg->cl); ssip_release_cmd()
230 dev_dbg(&msg->cl->device, "Release cmd 0x%08x\n", ssip_get_cmd(msg)); ssip_release_cmd()
232 list_add_tail(&msg->link, &ssi->cmdqueue); ssip_release_cmd()
238 struct hsi_msg *msg; ssip_claim_cmd() local
243 msg = list_first_entry(&ssi->cmdqueue, struct hsi_msg, link); ssip_claim_cmd()
244 list_del(&msg->link); ssip_claim_cmd()
246 msg->destructor = ssip_release_cmd; ssip_claim_cmd()
248 return msg; ssip_claim_cmd()
253 struct hsi_msg *msg, *tmp; ssip_free_cmds() local
255 list_for_each_entry_safe(msg, tmp, &ssi->cmdqueue, link) { ssip_free_cmds()
256 list_del(&msg->link); ssip_free_cmds()
257 msg->destructor = NULL; ssip_free_cmds()
258 kfree(sg_virt(msg->sgt.sgl)); ssip_free_cmds()
259 hsi_free_msg(msg); ssip_free_cmds()
265 struct hsi_msg *msg; ssip_alloc_cmds() local
270 msg = hsi_alloc_msg(1, GFP_KERNEL); ssip_alloc_cmds()
271 if (!msg) ssip_alloc_cmds()
275 hsi_free_msg(msg); ssip_alloc_cmds()
278 sg_init_one(msg->sgt.sgl, buf, sizeof(*buf)); ssip_alloc_cmds()
279 msg->channel = ssi->channel_id_cmd; ssip_alloc_cmds()
280 list_add_tail(&msg->link, &ssi->cmdqueue); ssip_alloc_cmds()
400 struct hsi_msg *msg; ssip_reset() local
420 msg = list_entry(head, struct hsi_msg, link); ssip_reset()
423 ssip_free_data(msg); ssip_reset()
432 struct hsi_msg *msg; ssip_dump_state() local
444 list_for_each_entry(msg, &ssi->txqueue, link) ssip_dump_state()
445 dev_err(&cl->device, "pending TX data (%p)\n", msg); ssip_dump_state()
452 struct hsi_msg *msg; ssip_error() local
456 msg = ssip_claim_cmd(ssi); ssip_error()
457 msg->complete = ssip_rxcmd_complete; ssip_error()
458 hsi_async_read(cl, msg); ssip_error()
498 struct hsi_msg *msg; ssip_send_bootinfo_req_cmd() local
501 msg = ssip_claim_cmd(ssi); ssip_send_bootinfo_req_cmd()
502 ssip_set_cmd(msg, SSIP_BOOTINFO_REQ_CMD(SSIP_LOCAL_VERID)); ssip_send_bootinfo_req_cmd()
503 msg->complete = ssip_release_cmd; ssip_send_bootinfo_req_cmd()
504 hsi_async_write(cl, msg); ssip_send_bootinfo_req_cmd()
506 msg = ssip_claim_cmd(ssi); ssip_send_bootinfo_req_cmd()
507 msg->complete = ssip_rxcmd_complete; ssip_send_bootinfo_req_cmd()
508 hsi_async_read(cl, msg); ssip_send_bootinfo_req_cmd()
514 struct hsi_msg *msg; ssip_start_rx() local
536 msg = ssip_claim_cmd(ssi); ssip_start_rx()
537 ssip_set_cmd(msg, SSIP_READY_CMD); ssip_start_rx()
538 msg->complete = ssip_release_cmd; ssip_start_rx()
540 hsi_async_write(cl, msg); ssip_start_rx()
554 static void ssip_free_strans(struct hsi_msg *msg) ssip_free_strans() argument
556 ssip_free_data(msg->context); ssip_free_strans()
557 ssip_release_cmd(msg); ssip_free_strans()
560 static void ssip_strans_complete(struct hsi_msg *msg) ssip_strans_complete() argument
562 struct hsi_client *cl = msg->cl; ssip_strans_complete()
566 data = msg->context; ssip_strans_complete()
567 ssip_release_cmd(msg); ssip_strans_complete()
577 struct hsi_msg *msg, *dmsg; ssip_xmit() local
590 msg = ssip_claim_cmd(ssi); ssip_xmit()
592 msg->context = dmsg; ssip_xmit()
593 msg->complete = ssip_strans_complete; ssip_xmit()
594 msg->destructor = ssip_free_strans; ssip_xmit()
597 ssip_set_cmd(msg, SSIP_START_TRANS_CMD(SSIP_BYTES_TO_FRAMES(skb->len), ssip_xmit()
606 return hsi_async_write(cl, msg); ssip_xmit()
641 static void ssip_rx_data_complete(struct hsi_msg *msg) ssip_rx_data_complete() argument
643 struct hsi_client *cl = msg->cl; ssip_rx_data_complete()
647 if (msg->status == HSI_STATUS_ERROR) { ssip_rx_data_complete()
649 ssip_free_data(msg); ssip_rx_data_complete()
654 skb = msg->context; ssip_rx_data_complete()
656 hsi_free_msg(msg); ssip_rx_data_complete()
662 struct hsi_msg *msg; ssip_rx_bootinforeq() local
686 msg = ssip_claim_cmd(ssi); ssip_rx_bootinforeq()
687 ssip_set_cmd(msg, SSIP_BOOTINFO_RESP_CMD(SSIP_LOCAL_VERID)); ssip_rx_bootinforeq()
688 msg->complete = ssip_release_cmd; ssip_rx_bootinforeq()
689 hsi_async_write(cl, msg); ssip_rx_bootinforeq()
773 struct hsi_msg *msg; ssip_rx_strans() local
800 msg = ssip_alloc_data(ssi, skb, GFP_ATOMIC); ssip_rx_strans()
801 if (unlikely(!msg)) { ssip_rx_strans()
802 dev_err(&cl->device, "No memory for RX data msg\n"); ssip_rx_strans()
805 msg->complete = ssip_rx_data_complete; ssip_rx_strans()
806 hsi_async_read(cl, msg); ssip_rx_strans()
815 static void ssip_rxcmd_complete(struct hsi_msg *msg) ssip_rxcmd_complete() argument
817 struct hsi_client *cl = msg->cl; ssip_rxcmd_complete()
818 u32 cmd = ssip_get_cmd(msg); ssip_rxcmd_complete()
821 if (msg->status == HSI_STATUS_ERROR) { ssip_rxcmd_complete()
823 ssip_release_cmd(msg); ssip_rxcmd_complete()
827 hsi_async_read(cl, msg); ssip_rxcmd_complete()
854 static void ssip_swbreak_complete(struct hsi_msg *msg) ssip_swbreak_complete() argument
856 struct hsi_client *cl = msg->cl; ssip_swbreak_complete()
859 ssip_release_cmd(msg); ssip_swbreak_complete()
876 static void ssip_tx_data_complete(struct hsi_msg *msg) ssip_tx_data_complete() argument
878 struct hsi_client *cl = msg->cl; ssip_tx_data_complete()
882 if (msg->status == HSI_STATUS_ERROR) { ssip_tx_data_complete()
901 ssip_free_data(msg); ssip_tx_data_complete()
972 struct hsi_msg *msg; ssip_pn_xmit() local
991 msg = ssip_alloc_data(ssi, skb, GFP_ATOMIC); ssip_pn_xmit()
992 if (!msg) { ssip_pn_xmit()
996 msg->complete = ssip_tx_data_complete; ssip_pn_xmit()
1004 list_add_tail(&msg->link, &ssi->txqueue); ssip_pn_xmit()
1029 hsi_free_msg(msg); ssip_pn_xmit()
H A Dcmt_speech.c46 u32 msg; member in struct:char_queue
163 entry->msg = message; cs_notify()
181 data = entry->msg; cs_pop_entry()
210 static inline void cs_set_cmd(struct hsi_msg *msg, u32 cmd) cs_set_cmd() argument
212 u32 *data = sg_virt(msg->sgt.sgl); cs_set_cmd()
216 static inline u32 cs_get_cmd(struct hsi_msg *msg) cs_get_cmd() argument
218 u32 *data = sg_virt(msg->sgt.sgl); cs_get_cmd()
222 static void cs_release_cmd(struct hsi_msg *msg) cs_release_cmd() argument
224 struct cs_hsi_iface *hi = msg->context; cs_release_cmd()
226 list_add_tail(&msg->link, &hi->cmdqueue); cs_release_cmd()
229 static void cs_cmd_destructor(struct hsi_msg *msg) cs_cmd_destructor() argument
231 struct cs_hsi_iface *hi = msg->context; cs_cmd_destructor()
240 if (msg->ttype == HSI_MSG_READ) cs_cmd_destructor()
243 else if (msg->ttype == HSI_MSG_WRITE && cs_cmd_destructor()
247 cs_release_cmd(msg); cs_cmd_destructor()
254 struct hsi_msg *msg; cs_claim_cmd() local
258 msg = list_first_entry(&ssi->cmdqueue, struct hsi_msg, link); cs_claim_cmd()
259 list_del(&msg->link); cs_claim_cmd()
260 msg->destructor = cs_cmd_destructor; cs_claim_cmd()
262 return msg; cs_claim_cmd()
267 struct hsi_msg *msg, *tmp; cs_free_cmds() local
269 list_for_each_entry_safe(msg, tmp, &ssi->cmdqueue, link) { cs_free_cmds()
270 list_del(&msg->link); cs_free_cmds()
271 msg->destructor = NULL; cs_free_cmds()
272 kfree(sg_virt(msg->sgt.sgl)); cs_free_cmds()
273 hsi_free_msg(msg); cs_free_cmds()
279 struct hsi_msg *msg; cs_alloc_cmds() local
286 msg = hsi_alloc_msg(1, GFP_KERNEL); cs_alloc_cmds()
287 if (!msg) cs_alloc_cmds()
291 hsi_free_msg(msg); cs_alloc_cmds()
294 sg_init_one(msg->sgt.sgl, buf, sizeof(*buf)); cs_alloc_cmds()
295 msg->channel = cs_char_data.channel_id_cmd; cs_alloc_cmds()
296 msg->context = hi; cs_alloc_cmds()
297 list_add_tail(&msg->link, &hi->cmdqueue); cs_alloc_cmds()
307 static void cs_hsi_data_destructor(struct hsi_msg *msg) cs_hsi_data_destructor() argument
309 struct cs_hsi_iface *hi = msg->context; cs_hsi_data_destructor()
310 const char *dir = (msg->ttype == HSI_MSG_READ) ? "TX" : "RX"; cs_hsi_data_destructor()
318 if (msg->ttype == HSI_MSG_READ) cs_hsi_data_destructor()
324 msg->status = HSI_STATUS_COMPLETED; cs_hsi_data_destructor()
365 static void cs_hsi_free_data_msg(struct hsi_msg *msg) cs_hsi_free_data_msg() argument
367 WARN_ON(msg->status != HSI_STATUS_COMPLETED && cs_hsi_free_data_msg()
368 msg->status != HSI_STATUS_ERROR); cs_hsi_free_data_msg()
369 hsi_free_msg(msg); cs_hsi_free_data_msg()
379 struct hsi_msg *msg, const char *info, __cs_hsi_error_pre()
383 dev_err(&hi->cl->device, "HSI %s error, msg %d, state %u\n", __cs_hsi_error_pre()
384 info, msg->status, *state); __cs_hsi_error_pre()
405 struct hsi_msg *msg) cs_hsi_control_read_error()
407 __cs_hsi_error_pre(hi, msg, "control read", &hi->control_state); cs_hsi_control_read_error()
408 cs_release_cmd(msg); cs_hsi_control_read_error()
414 struct hsi_msg *msg) cs_hsi_control_write_error()
416 __cs_hsi_error_pre(hi, msg, "control write", &hi->control_state); cs_hsi_control_write_error()
417 cs_release_cmd(msg); cs_hsi_control_write_error()
423 static void cs_hsi_data_read_error(struct cs_hsi_iface *hi, struct hsi_msg *msg) cs_hsi_data_read_error() argument
425 __cs_hsi_error_pre(hi, msg, "data read", &hi->data_state); cs_hsi_data_read_error()
431 struct hsi_msg *msg) cs_hsi_data_write_error()
433 __cs_hsi_error_pre(hi, msg, "data write", &hi->data_state); cs_hsi_data_write_error()
438 static void cs_hsi_read_on_control_complete(struct hsi_msg *msg) cs_hsi_read_on_control_complete() argument
440 u32 cmd = cs_get_cmd(msg); cs_hsi_read_on_control_complete()
441 struct cs_hsi_iface *hi = msg->context; cs_hsi_read_on_control_complete()
445 if (msg->status == HSI_STATUS_ERROR) { cs_hsi_read_on_control_complete()
447 cs_hsi_control_read_error(hi, msg); cs_hsi_read_on_control_complete()
452 cs_release_cmd(msg); cs_hsi_read_on_control_complete()
471 static void cs_hsi_peek_on_control_complete(struct hsi_msg *msg) cs_hsi_peek_on_control_complete() argument
473 struct cs_hsi_iface *hi = msg->context; cs_hsi_peek_on_control_complete()
476 if (msg->status == HSI_STATUS_ERROR) { cs_hsi_peek_on_control_complete()
478 cs_hsi_control_read_error(hi, msg); cs_hsi_peek_on_control_complete()
485 msg->sgt.nents = 1; cs_hsi_peek_on_control_complete()
486 msg->complete = cs_hsi_read_on_control_complete; cs_hsi_peek_on_control_complete()
487 ret = hsi_async_read(hi->cl, msg); cs_hsi_peek_on_control_complete()
489 cs_hsi_control_read_error(hi, msg); cs_hsi_peek_on_control_complete()
494 struct hsi_msg *msg; cs_hsi_read_on_control() local
512 msg = cs_claim_cmd(hi); cs_hsi_read_on_control()
515 msg->sgt.nents = 0; cs_hsi_read_on_control()
516 msg->complete = cs_hsi_peek_on_control_complete; cs_hsi_read_on_control()
517 ret = hsi_async_read(hi->cl, msg); cs_hsi_read_on_control()
519 cs_hsi_control_read_error(hi, msg); cs_hsi_read_on_control()
522 static void cs_hsi_write_on_control_complete(struct hsi_msg *msg) cs_hsi_write_on_control_complete() argument
524 struct cs_hsi_iface *hi = msg->context; cs_hsi_write_on_control_complete()
525 if (msg->status == HSI_STATUS_COMPLETED) { cs_hsi_write_on_control_complete()
528 cs_release_cmd(msg); cs_hsi_write_on_control_complete()
530 } else if (msg->status == HSI_STATUS_ERROR) { cs_hsi_write_on_control_complete()
531 cs_hsi_control_write_error(hi, msg); cs_hsi_write_on_control_complete()
535 msg->status); cs_hsi_write_on_control_complete()
541 struct hsi_msg *msg; cs_hsi_write_on_control() local
556 msg = cs_claim_cmd(hi); cs_hsi_write_on_control()
559 cs_set_cmd(msg, message); cs_hsi_write_on_control()
560 msg->sgt.nents = 1; cs_hsi_write_on_control()
561 msg->complete = cs_hsi_write_on_control_complete; cs_hsi_write_on_control()
564 ret = hsi_async_write(hi->cl, msg); cs_hsi_write_on_control()
568 cs_hsi_control_write_error(hi, msg); cs_hsi_write_on_control()
586 static void cs_hsi_read_on_data_complete(struct hsi_msg *msg) cs_hsi_read_on_data_complete() argument
588 struct cs_hsi_iface *hi = msg->context; cs_hsi_read_on_data_complete()
591 if (unlikely(msg->status == HSI_STATUS_ERROR)) { cs_hsi_read_on_data_complete()
592 cs_hsi_data_read_error(hi, msg); cs_hsi_read_on_data_complete()
613 static void cs_hsi_peek_on_data_complete(struct hsi_msg *msg) cs_hsi_peek_on_data_complete() argument
615 struct cs_hsi_iface *hi = msg->context; cs_hsi_peek_on_data_complete()
619 if (unlikely(msg->status == HSI_STATUS_ERROR)) { cs_hsi_peek_on_data_complete()
620 cs_hsi_data_read_error(hi, msg); cs_hsi_peek_on_data_complete()
625 cs_hsi_data_read_error(hi, msg); cs_hsi_peek_on_data_complete()
637 sg_init_one(msg->sgt.sgl, address, hi->buf_size); cs_hsi_peek_on_data_complete()
638 msg->sgt.nents = 1; cs_hsi_peek_on_data_complete()
639 msg->complete = cs_hsi_read_on_data_complete; cs_hsi_peek_on_data_complete()
640 ret = hsi_async_read(hi->cl, msg); cs_hsi_peek_on_data_complete()
642 cs_hsi_data_read_error(hi, msg); cs_hsi_peek_on_data_complete()
689 static void cs_hsi_write_on_data_complete(struct hsi_msg *msg) cs_hsi_write_on_data_complete() argument
691 struct cs_hsi_iface *hi = msg->context; cs_hsi_write_on_data_complete()
693 if (msg->status == HSI_STATUS_COMPLETED) { cs_hsi_write_on_data_complete()
700 cs_hsi_data_write_error(hi, msg); cs_hsi_write_on_data_complete()
378 __cs_hsi_error_pre(struct cs_hsi_iface *hi, struct hsi_msg *msg, const char *info, unsigned int *state) __cs_hsi_error_pre() argument
404 cs_hsi_control_read_error(struct cs_hsi_iface *hi, struct hsi_msg *msg) cs_hsi_control_read_error() argument
413 cs_hsi_control_write_error(struct cs_hsi_iface *hi, struct hsi_msg *msg) cs_hsi_control_write_error() argument
430 cs_hsi_data_write_error(struct cs_hsi_iface *hi, struct hsi_msg *msg) cs_hsi_data_write_error() argument
/linux-4.4.14/drivers/staging/lustre/lustre/ptlrpc/
H A Dpack_generic.c161 int lustre_packed_msg_size(struct lustre_msg *msg) lustre_packed_msg_size() argument
163 switch (msg->lm_magic) { lustre_packed_msg_size()
165 return lustre_msg_size_v2(msg->lm_bufcount, msg->lm_buflens); lustre_packed_msg_size()
167 CERROR("incorrect message magic: %08x\n", msg->lm_magic); lustre_packed_msg_size()
173 void lustre_init_msg_v2(struct lustre_msg_v2 *msg, int count, __u32 *lens, lustre_init_msg_v2() argument
179 msg->lm_bufcount = count; lustre_init_msg_v2()
181 msg->lm_magic = LUSTRE_MSG_MAGIC_V2; lustre_init_msg_v2()
184 msg->lm_buflens[i] = lens[i]; lustre_init_msg_v2()
189 ptr = (char *)msg + lustre_msg_hdr_size_v2(count); lustre_init_msg_v2()
391 CDEBUG(D_INFO, "msg %p buffer[%d] not present (count %d)\n", lustre_msg_buf_v2()
398 CERROR("msg %p buffer[%d] size %d too small (required %d, opc=%d)\n", lustre_msg_buf_v2()
417 LASSERTF(0, "incorrect message magic: %08x (msg:%p)\n", lustre_msg_buf()
424 static int lustre_shrink_msg_v2(struct lustre_msg_v2 *msg, int segment, lustre_shrink_msg_v2() argument
430 LASSERT(msg); lustre_shrink_msg_v2()
431 LASSERT(msg->lm_bufcount > segment); lustre_shrink_msg_v2()
432 LASSERT(msg->lm_buflens[segment] >= newlen); lustre_shrink_msg_v2()
434 if (msg->lm_buflens[segment] == newlen) lustre_shrink_msg_v2()
437 if (move_data && msg->lm_bufcount > segment + 1) { lustre_shrink_msg_v2()
438 tail = lustre_msg_buf_v2(msg, segment + 1, 0); lustre_shrink_msg_v2()
439 for (n = segment + 1; n < msg->lm_bufcount; n++) lustre_shrink_msg_v2()
440 tail_len += cfs_size_round(msg->lm_buflens[n]); lustre_shrink_msg_v2()
443 msg->lm_buflens[segment] = newlen; lustre_shrink_msg_v2()
446 newpos = lustre_msg_buf_v2(msg, segment + 1, 0); lustre_shrink_msg_v2()
452 return lustre_msg_size_v2(msg->lm_bufcount, msg->lm_buflens); lustre_shrink_msg_v2()
456 * for @msg, shrink @segment to size @newlen. if @move_data is non-zero,
463 * return new msg size after shrinking.
468 * + caller should NOT keep pointers to msg buffers which higher than @segment
471 int lustre_shrink_msg(struct lustre_msg *msg, int segment, lustre_shrink_msg() argument
474 switch (msg->lm_magic) { lustre_shrink_msg()
476 return lustre_shrink_msg_v2(msg, segment, newlen, move_data); lustre_shrink_msg()
478 LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic); lustre_shrink_msg()
634 CERROR("bad lustre msg magic: %08x\n", lustre_unpack_req_ptlrpc_body()
646 CERROR("bad lustre msg magic: %08x\n", lustre_unpack_rep_ptlrpc_body()
709 CERROR("can't unpack string in msg %p buffer[%d]\n", m, index); lustre_msg_string()
716 CERROR("can't unpack non-NULL terminated string in msg %p buffer[%d] len %d\n", lustre_msg_string()
723 CERROR("can't unpack short string in msg %p buffer[%d] len %d: strlen %d\n", lustre_msg_string()
728 CERROR("can't unpack oversized string in msg %p buffer[%d] len %d strlen %d: max %d expected\n", lustre_msg_string()
738 static inline void *__lustre_swab_buf(struct lustre_msg *msg, int index, __lustre_swab_buf() argument
743 LASSERT(msg != NULL); __lustre_swab_buf()
744 switch (msg->lm_magic) { __lustre_swab_buf()
746 ptr = lustre_msg_buf_v2(msg, index, min_size); __lustre_swab_buf()
749 CERROR("incorrect message magic: %08x\n", msg->lm_magic); __lustre_swab_buf()
758 static inline struct ptlrpc_body *lustre_msg_ptlrpc_body(struct lustre_msg *msg) lustre_msg_ptlrpc_body() argument
760 return lustre_msg_buf_v2(msg, MSG_PTLRPC_BODY_OFF, lustre_msg_ptlrpc_body()
764 __u32 lustre_msghdr_get_flags(struct lustre_msg *msg) lustre_msghdr_get_flags() argument
766 switch (msg->lm_magic) { lustre_msghdr_get_flags()
769 return msg->lm_flags; lustre_msghdr_get_flags()
771 CERROR("incorrect message magic: %08x\n", msg->lm_magic); lustre_msghdr_get_flags()
777 void lustre_msghdr_set_flags(struct lustre_msg *msg, __u32 flags) lustre_msghdr_set_flags() argument
779 switch (msg->lm_magic) { lustre_msghdr_set_flags()
781 msg->lm_flags = flags; lustre_msghdr_set_flags()
784 LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic); lustre_msghdr_set_flags()
788 __u32 lustre_msg_get_flags(struct lustre_msg *msg) lustre_msg_get_flags() argument
790 switch (msg->lm_magic) { lustre_msg_get_flags()
792 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_get_flags()
797 CERROR("invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_get_flags()
808 void lustre_msg_add_flags(struct lustre_msg *msg, int flags) lustre_msg_add_flags() argument
810 switch (msg->lm_magic) { lustre_msg_add_flags()
812 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_add_flags()
814 LASSERTF(pb, "invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_add_flags()
819 LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_add_flags()
824 void lustre_msg_set_flags(struct lustre_msg *msg, int flags) lustre_msg_set_flags() argument
826 switch (msg->lm_magic) { lustre_msg_set_flags()
828 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_set_flags()
830 LASSERTF(pb, "invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_set_flags()
835 LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_set_flags()
840 void lustre_msg_clear_flags(struct lustre_msg *msg, int flags) lustre_msg_clear_flags() argument
842 switch (msg->lm_magic) { lustre_msg_clear_flags()
844 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_clear_flags()
846 LASSERTF(pb, "invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_clear_flags()
851 LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_clear_flags()
856 __u32 lustre_msg_get_op_flags(struct lustre_msg *msg) lustre_msg_get_op_flags() argument
858 switch (msg->lm_magic) { lustre_msg_get_op_flags()
860 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_get_op_flags()
865 CERROR("invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_get_op_flags()
874 void lustre_msg_add_op_flags(struct lustre_msg *msg, int flags) lustre_msg_add_op_flags() argument
876 switch (msg->lm_magic) { lustre_msg_add_op_flags()
878 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_add_op_flags()
880 LASSERTF(pb, "invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_add_op_flags()
885 LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_add_op_flags()
890 struct lustre_handle *lustre_msg_get_handle(struct lustre_msg *msg) lustre_msg_get_handle() argument
892 switch (msg->lm_magic) { lustre_msg_get_handle()
894 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_get_handle()
897 CERROR("invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_get_handle()
903 CERROR("incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_get_handle()
909 __u32 lustre_msg_get_type(struct lustre_msg *msg) lustre_msg_get_type() argument
911 switch (msg->lm_magic) { lustre_msg_get_type()
913 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_get_type()
916 CERROR("invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_get_type()
922 CERROR("incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_get_type()
928 void lustre_msg_add_version(struct lustre_msg *msg, int version) lustre_msg_add_version() argument
930 switch (msg->lm_magic) { lustre_msg_add_version()
932 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_add_version()
934 LASSERTF(pb, "invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_add_version()
939 LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_add_version()
944 __u32 lustre_msg_get_opc(struct lustre_msg *msg) lustre_msg_get_opc() argument
946 switch (msg->lm_magic) { lustre_msg_get_opc()
948 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_get_opc()
951 CERROR("invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_get_opc()
957 CERROR("incorrect message magic: %08x (msg:%p)\n", lustre_msg_get_opc()
958 msg->lm_magic, msg); lustre_msg_get_opc()
964 __u64 lustre_msg_get_last_committed(struct lustre_msg *msg) lustre_msg_get_last_committed() argument
966 switch (msg->lm_magic) { lustre_msg_get_last_committed()
968 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_get_last_committed()
971 CERROR("invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_get_last_committed()
977 CERROR("incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_get_last_committed()
983 __u64 *lustre_msg_get_versions(struct lustre_msg *msg) lustre_msg_get_versions() argument
985 switch (msg->lm_magic) { lustre_msg_get_versions()
987 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_get_versions()
990 CERROR("invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_get_versions()
996 CERROR("incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_get_versions()
1002 __u64 lustre_msg_get_transno(struct lustre_msg *msg) lustre_msg_get_transno() argument
1004 switch (msg->lm_magic) { lustre_msg_get_transno()
1006 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_get_transno()
1009 CERROR("invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_get_transno()
1015 CERROR("incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_get_transno()
1021 int lustre_msg_get_status(struct lustre_msg *msg) lustre_msg_get_status() argument
1023 switch (msg->lm_magic) { lustre_msg_get_status()
1025 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_get_status()
1030 CERROR("invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_get_status()
1041 __u64 lustre_msg_get_slv(struct lustre_msg *msg) lustre_msg_get_slv() argument
1043 switch (msg->lm_magic) { lustre_msg_get_slv()
1045 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_get_slv()
1048 CERROR("invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_get_slv()
1054 CERROR("invalid msg magic %08x\n", msg->lm_magic); lustre_msg_get_slv()
1060 void lustre_msg_set_slv(struct lustre_msg *msg, __u64 slv) lustre_msg_set_slv() argument
1062 switch (msg->lm_magic) { lustre_msg_set_slv()
1064 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_set_slv()
1067 CERROR("invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_set_slv()
1074 CERROR("invalid msg magic %x\n", msg->lm_magic); lustre_msg_set_slv()
1080 __u32 lustre_msg_get_limit(struct lustre_msg *msg) lustre_msg_get_limit() argument
1082 switch (msg->lm_magic) { lustre_msg_get_limit()
1084 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_get_limit()
1087 CERROR("invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_get_limit()
1093 CERROR("invalid msg magic %x\n", msg->lm_magic); lustre_msg_get_limit()
1099 void lustre_msg_set_limit(struct lustre_msg *msg, __u64 limit) lustre_msg_set_limit() argument
1101 switch (msg->lm_magic) { lustre_msg_set_limit()
1103 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_set_limit()
1106 CERROR("invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_set_limit()
1113 CERROR("invalid msg magic %08x\n", msg->lm_magic); lustre_msg_set_limit()
1119 __u32 lustre_msg_get_conn_cnt(struct lustre_msg *msg) lustre_msg_get_conn_cnt() argument
1121 switch (msg->lm_magic) { lustre_msg_get_conn_cnt()
1123 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_get_conn_cnt()
1126 CERROR("invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_get_conn_cnt()
1132 CERROR("incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_get_conn_cnt()
1138 __u32 lustre_msg_get_magic(struct lustre_msg *msg) lustre_msg_get_magic() argument
1140 switch (msg->lm_magic) { lustre_msg_get_magic()
1142 return msg->lm_magic; lustre_msg_get_magic()
1144 CERROR("incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_get_magic()
1150 __u32 lustre_msg_get_timeout(struct lustre_msg *msg) lustre_msg_get_timeout() argument
1152 switch (msg->lm_magic) { lustre_msg_get_timeout()
1154 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_get_timeout()
1157 CERROR("invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_get_timeout()
1164 CERROR("incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_get_timeout()
1169 __u32 lustre_msg_get_service_time(struct lustre_msg *msg) lustre_msg_get_service_time() argument
1171 switch (msg->lm_magic) { lustre_msg_get_service_time()
1173 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_get_service_time()
1176 CERROR("invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_get_service_time()
1183 CERROR("incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_get_service_time()
1188 __u32 lustre_msg_get_cksum(struct lustre_msg *msg) lustre_msg_get_cksum() argument
1190 switch (msg->lm_magic) { lustre_msg_get_cksum()
1192 return msg->lm_cksum; lustre_msg_get_cksum()
1194 CERROR("incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_get_cksum()
1199 __u32 lustre_msg_calc_cksum(struct lustre_msg *msg) lustre_msg_calc_cksum() argument
1201 switch (msg->lm_magic) { lustre_msg_calc_cksum()
1203 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_calc_cksum()
1208 lustre_msg_buflen(msg, MSG_PTLRPC_BODY_OFF), lustre_msg_calc_cksum()
1213 CERROR("incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_calc_cksum()
1218 void lustre_msg_set_handle(struct lustre_msg *msg, struct lustre_handle *handle) lustre_msg_set_handle() argument
1220 switch (msg->lm_magic) { lustre_msg_set_handle()
1222 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_set_handle()
1224 LASSERTF(pb, "invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_set_handle()
1229 LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_set_handle()
1234 void lustre_msg_set_type(struct lustre_msg *msg, __u32 type) lustre_msg_set_type() argument
1236 switch (msg->lm_magic) { lustre_msg_set_type()
1238 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_set_type()
1240 LASSERTF(pb, "invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_set_type()
1245 LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_set_type()
1250 void lustre_msg_set_opc(struct lustre_msg *msg, __u32 opc) lustre_msg_set_opc() argument
1252 switch (msg->lm_magic) { lustre_msg_set_opc()
1254 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_set_opc()
1256 LASSERTF(pb, "invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_set_opc()
1261 LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_set_opc()
1266 void lustre_msg_set_versions(struct lustre_msg *msg, __u64 *versions) lustre_msg_set_versions() argument
1268 switch (msg->lm_magic) { lustre_msg_set_versions()
1270 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_set_versions()
1272 LASSERTF(pb, "invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_set_versions()
1280 LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_set_versions()
1285 void lustre_msg_set_transno(struct lustre_msg *msg, __u64 transno) lustre_msg_set_transno() argument
1287 switch (msg->lm_magic) { lustre_msg_set_transno()
1289 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_set_transno()
1291 LASSERTF(pb, "invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_set_transno()
1296 LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_set_transno()
1301 void lustre_msg_set_status(struct lustre_msg *msg, __u32 status) lustre_msg_set_status() argument
1303 switch (msg->lm_magic) { lustre_msg_set_status()
1305 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_set_status()
1307 LASSERTF(pb, "invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_set_status()
1312 LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_set_status()
1317 void lustre_msg_set_conn_cnt(struct lustre_msg *msg, __u32 conn_cnt) lustre_msg_set_conn_cnt() argument
1319 switch (msg->lm_magic) { lustre_msg_set_conn_cnt()
1321 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_set_conn_cnt()
1323 LASSERTF(pb, "invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_set_conn_cnt()
1328 LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_set_conn_cnt()
1333 void lustre_msg_set_timeout(struct lustre_msg *msg, __u32 timeout) lustre_msg_set_timeout() argument
1335 switch (msg->lm_magic) { lustre_msg_set_timeout()
1337 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_set_timeout()
1339 LASSERTF(pb, "invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_set_timeout()
1344 LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_set_timeout()
1348 void lustre_msg_set_service_time(struct lustre_msg *msg, __u32 service_time) lustre_msg_set_service_time() argument
1350 switch (msg->lm_magic) { lustre_msg_set_service_time()
1352 struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); lustre_msg_set_service_time()
1354 LASSERTF(pb, "invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_set_service_time()
1359 LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_set_service_time()
1363 void lustre_msg_set_jobid(struct lustre_msg *msg, char *jobid) lustre_msg_set_jobid() argument
1365 switch (msg->lm_magic) { lustre_msg_set_jobid()
1367 __u32 opc = lustre_msg_get_opc(msg); lustre_msg_set_jobid()
1376 pb = lustre_msg_buf_v2(msg, MSG_PTLRPC_BODY_OFF, lustre_msg_set_jobid()
1378 LASSERTF(pb, "invalid msg %p: no ptlrpc body!\n", msg); lustre_msg_set_jobid()
1387 LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_set_jobid()
1392 void lustre_msg_set_cksum(struct lustre_msg *msg, __u32 cksum) lustre_msg_set_cksum() argument
1394 switch (msg->lm_magic) { lustre_msg_set_cksum()
1396 msg->lm_cksum = cksum; lustre_msg_set_cksum()
1399 LASSERTF(0, "incorrect message magic: %08x\n", msg->lm_magic); lustre_msg_set_cksum()
2147 CERROR("bad lustre msg magic: %#08X\n", req_ptlrpc_body_swabbed()
H A Dsec_plain.c99 static int plain_unpack_bsd(struct lustre_msg *msg, int swabbed) plain_unpack_bsd() argument
103 if (bulk_sec_desc_unpack(msg, PLAIN_PACK_BULK_OFF, swabbed)) plain_unpack_bsd()
106 bsd = lustre_msg_buf(msg, PLAIN_PACK_BULK_OFF, PLAIN_BSD_SIZE); plain_unpack_bsd()
109 lustre_msg_buflen(msg, PLAIN_PACK_BULK_OFF)); plain_unpack_bsd()
193 struct lustre_msg *msg = req->rq_reqbuf; plain_ctx_sign() local
196 msg->lm_secflvr = req->rq_flvr.sf_rpc; plain_ctx_sign()
198 phdr = lustre_msg_buf(msg, PLAIN_PACK_HDR_OFF, 0); plain_ctx_sign()
209 req->rq_reqdata_len = lustre_msg_size_v2(msg->lm_bufcount, plain_ctx_sign()
210 msg->lm_buflens); plain_ctx_sign()
217 struct lustre_msg *msg = req->rq_repdata; plain_ctx_verify() local
222 if (msg->lm_bufcount != PLAIN_PACK_SEGMENTS) { plain_ctx_verify()
223 CERROR("unexpected reply buf count %u\n", msg->lm_bufcount); plain_ctx_verify()
229 phdr = lustre_msg_buf(msg, PLAIN_PACK_HDR_OFF, sizeof(*phdr)); plain_ctx_verify()
256 lustre_msg_buf(msg, PLAIN_PACK_MSG_OFF, 0), plain_ctx_verify()
257 lustre_msg_buflen(msg, PLAIN_PACK_MSG_OFF), plain_ctx_verify()
259 if (cksum != msg->lm_cksum) { plain_ctx_verify()
262 cpu_to_le32(cksum), msg->lm_cksum); plain_ctx_verify()
277 if (plain_unpack_bsd(msg, swabbed)) plain_ctx_verify()
282 req->rq_repmsg = lustre_msg_buf(msg, PLAIN_PACK_MSG_OFF, 0); plain_ctx_verify()
283 req->rq_replen = lustre_msg_buflen(msg, PLAIN_PACK_MSG_OFF); plain_ctx_verify()
647 /* compute new embedded msg size. */ plain_enlarge_reqbuf()
654 /* compute new wrapper msg size. */ plain_enlarge_reqbuf()
712 struct lustre_msg *msg = req->rq_reqbuf; plain_accept() local
727 if (msg->lm_bufcount < PLAIN_PACK_SEGMENTS) { plain_accept()
728 CERROR("unexpected request buf count %u\n", msg->lm_bufcount); plain_accept()
734 phdr = lustre_msg_buf(msg, PLAIN_PACK_HDR_OFF, sizeof(*phdr)); plain_accept()
754 if (sptlrpc_unpack_user_desc(msg, PLAIN_PACK_USER_OFF, plain_accept()
761 req->rq_user_desc = lustre_msg_buf(msg, PLAIN_PACK_USER_OFF, 0); plain_accept()
765 if (plain_unpack_bsd(msg, swabbed)) plain_accept()
771 req->rq_reqmsg = lustre_msg_buf(msg, PLAIN_PACK_MSG_OFF, 0); plain_accept()
772 req->rq_reqlen = msg->lm_buflens[PLAIN_PACK_MSG_OFF]; plain_accept()
836 struct lustre_msg_v2 *msg = rs->rs_repbuf; plain_authorize() local
841 LASSERT(msg); plain_authorize()
843 if (req->rq_replen != msg->lm_buflens[PLAIN_PACK_MSG_OFF]) plain_authorize()
844 len = lustre_shrink_msg(msg, PLAIN_PACK_MSG_OFF, plain_authorize()
847 len = lustre_msg_size_v2(msg->lm_bufcount, msg->lm_buflens); plain_authorize()
849 msg->lm_secflvr = req->rq_flvr.sf_rpc; plain_authorize()
851 phdr = lustre_msg_buf(msg, PLAIN_PACK_HDR_OFF, 0); plain_authorize()
870 lustre_msg_buf(msg, PLAIN_PACK_MSG_OFF, 0), plain_authorize()
871 lustre_msg_buflen(msg, PLAIN_PACK_MSG_OFF), plain_authorize()
872 NULL, 0, (unsigned char *)&msg->lm_cksum, &hsize); plain_authorize()
/linux-4.4.14/sound/soc/intel/atom/sst/
H A Dsst_ipc.c40 struct sst_block *msg = NULL; sst_create_block() local
43 msg = kzalloc(sizeof(*msg), GFP_KERNEL); sst_create_block()
44 if (!msg) sst_create_block()
46 msg->condition = false; sst_create_block()
47 msg->on = true; sst_create_block()
48 msg->msg_id = msg_id; sst_create_block()
49 msg->drv_id = drv_id; sst_create_block()
51 list_add_tail(&msg->node, &ctx->block_list); sst_create_block()
54 return msg; sst_create_block()
96 "Block not found or a response received for a short msg for ipc %d, drv_id %d\n", sst_wake_up_block()
127 struct ipc_post *msg = ipc_msg; sst_post_message_mrfld() local
140 "sst: Busy wait failed, cant send this msg\n"); sst_post_message_mrfld()
153 "Empty msg queue... NO Action\n"); sst_post_message_mrfld()
163 /* copy msg from list */ sst_post_message_mrfld()
164 msg = list_entry(sst_drv_ctx->ipc_dispatch_list.next, sst_post_message_mrfld()
166 list_del(&msg->node); sst_post_message_mrfld()
169 msg->mrfld_header.p.header_high.full); sst_post_message_mrfld()
171 msg->mrfld_header.p.header_low_payload); sst_post_message_mrfld()
173 if (msg->mrfld_header.p.header_high.part.large) sst_post_message_mrfld()
175 msg->mailbox_data, sst_post_message_mrfld()
176 msg->mrfld_header.p.header_low_payload); sst_post_message_mrfld()
178 sst_shim_write64(sst_drv_ctx->shim, SST_IPCX, msg->mrfld_header.full); sst_post_message_mrfld()
182 kfree(msg->mailbox_data); sst_post_message_mrfld()
183 kfree(msg); sst_post_message_mrfld()
217 * process_fw_init - process the FW init msg
219 * @msg: IPC message mailbox data from FW
221 * This function processes the FW init msg from FW
225 void *msg) process_fw_init()
228 (struct ipc_header_fw_init *)msg; process_fw_init()
231 dev_dbg(sst_drv_ctx->dev, "*** FW Init msg came***\n"); process_fw_init()
245 struct ipc_post *msg) process_fw_async_msg()
255 msg_high = msg->mrfld_header.p.header_high; process_fw_async_msg()
256 msg_low = msg->mrfld_header.p.header_low_payload; process_fw_async_msg()
257 msg_id = ((struct ipc_dsp_hdr *)msg->mailbox_data)->cmd_id; process_fw_async_msg()
258 data_offset = (msg->mailbox_data + sizeof(struct ipc_dsp_hdr)); process_fw_async_msg()
263 pipe_id = ((struct ipc_dsp_hdr *)msg->mailbox_data)->pipe_id; process_fw_async_msg()
278 pipe_id = ((struct ipc_dsp_hdr *)msg->mailbox_data)->pipe_id; process_fw_async_msg()
288 dev_err(sst_drv_ctx->dev, "FW sent async error msg:\n"); process_fw_async_msg()
299 pipe_id = ((struct ipc_dsp_hdr *)msg->mailbox_data)->pipe_id; process_fw_async_msg()
309 "Unrecognized async msg from FW msg_id %#x\n", msg_id); process_fw_async_msg()
314 struct ipc_post *msg) sst_process_reply_mrfld()
323 msg_high = msg->mrfld_header.p.header_high; sst_process_reply_mrfld()
324 msg_low = msg->mrfld_header.p.header_low_payload; sst_process_reply_mrfld()
327 msg->mrfld_header.p.header_high.full, sst_process_reply_mrfld()
328 msg->mrfld_header.p.header_low_payload); sst_process_reply_mrfld()
335 process_fw_async_msg(sst_drv_ctx, msg); sst_process_reply_mrfld()
355 data = kmemdup((void *)msg->mailbox_data, msg_low, GFP_KERNEL); sst_process_reply_mrfld()
224 process_fw_init(struct intel_sst_drv *sst_drv_ctx, void *msg) process_fw_init() argument
244 process_fw_async_msg(struct intel_sst_drv *sst_drv_ctx, struct ipc_post *msg) process_fw_async_msg() argument
313 sst_process_reply_mrfld(struct intel_sst_drv *sst_drv_ctx, struct ipc_post *msg) sst_process_reply_mrfld() argument
H A Dsst_pvt.c129 * Observed that FW processes the alloc msg and replies even sst_wait_timeout()
167 struct ipc_post *msg; sst_create_ipc_msg() local
169 msg = kzalloc(sizeof(struct ipc_post), GFP_ATOMIC); sst_create_ipc_msg()
170 if (!msg) sst_create_ipc_msg()
173 msg->mailbox_data = kzalloc(SST_MAILBOX_SIZE, GFP_ATOMIC); sst_create_ipc_msg()
174 if (!msg->mailbox_data) { sst_create_ipc_msg()
175 kfree(msg); sst_create_ipc_msg()
179 msg->mailbox_data = NULL; sst_create_ipc_msg()
181 msg->is_large = large; sst_create_ipc_msg()
182 *arg = msg; sst_create_ipc_msg()
234 struct ipc_post *msg = NULL; sst_prepare_and_post_msg() local
245 &msg, large, sst, &block, ipc_msg, pvt_id); sst_prepare_and_post_msg()
247 ret = sst_create_ipc_msg(&msg, large); sst_prepare_and_post_msg()
256 sst_fill_header_mrfld(&msg->mrfld_header, ipc_msg, sst_prepare_and_post_msg()
258 msg->mrfld_header.p.header_low_payload = sizeof(dsp_hdr) + mbox_data_len; sst_prepare_and_post_msg()
259 msg->mrfld_header.p.header_high.part.res_rqd = !sync; sst_prepare_and_post_msg()
261 msg->mrfld_header.p.header_high.full); sst_prepare_and_post_msg()
263 msg->mrfld_header.p.header_high.part.res_rqd); sst_prepare_and_post_msg()
264 dev_dbg(sst->dev, "msg->mrfld_header.p.header_low_payload:%d", sst_prepare_and_post_msg()
265 msg->mrfld_header.p.header_low_payload); sst_prepare_and_post_msg()
268 memcpy(msg->mailbox_data, &dsp_hdr, sizeof(dsp_hdr)); sst_prepare_and_post_msg()
270 memcpy(msg->mailbox_data + sizeof(dsp_hdr), sst_prepare_and_post_msg()
276 sst->ops->post_message(sst, msg, true); sst_prepare_and_post_msg()
278 sst_add_to_dispatch_list_and_post(sst, msg); sst_prepare_and_post_msg()
314 int msg, int task_id, int large, int drv_id) sst_fill_header_mrfld()
317 header->p.header_high.part.msg_id = msg; sst_fill_header_mrfld()
326 void sst_fill_header_dsp(struct ipc_dsp_hdr *dsp, int msg, sst_fill_header_dsp() argument
329 dsp->cmd_id = msg; sst_fill_header_dsp()
417 struct ipc_post *msg) sst_add_to_dispatch_list_and_post()
422 list_add_tail(&msg->node, &sst->ipc_dispatch_list); sst_add_to_dispatch_list_and_post()
313 sst_fill_header_mrfld(union ipc_header_mrfld *header, int msg, int task_id, int large, int drv_id) sst_fill_header_mrfld() argument
416 sst_add_to_dispatch_list_and_post(struct intel_sst_drv *sst, struct ipc_post *msg) sst_add_to_dispatch_list_and_post() argument
/linux-4.4.14/drivers/leds/
H A Dleds-ipaq-micro.c39 struct ipaq_micro_msg msg = { micro_leds_brightness_set() local
44 msg.tx_data[0] = LED_GREEN; micro_leds_brightness_set()
45 msg.tx_data[1] = 0; micro_leds_brightness_set()
47 msg.tx_data[2] = 0; /* Duty cycle 256 */ micro_leds_brightness_set()
48 msg.tx_data[3] = 1; micro_leds_brightness_set()
50 msg.tx_data[2] = 1; micro_leds_brightness_set()
51 msg.tx_data[3] = 0; /* Duty cycle 256 */ micro_leds_brightness_set()
53 ipaq_micro_tx_msg_sync(micro, &msg); micro_leds_brightness_set()
76 struct ipaq_micro_msg msg = { micro_leds_blink_set() local
81 msg.tx_data[0] = LED_GREEN; micro_leds_blink_set()
91 msg.tx_data[1] = 0; micro_leds_blink_set()
93 msg.tx_data[2] = 0; micro_leds_blink_set()
95 msg.tx_data[2] = (u8) DIV_ROUND_CLOSEST(*delay_on, 100); micro_leds_blink_set()
97 msg.tx_data[3] = 0; micro_leds_blink_set()
99 msg.tx_data[3] = (u8) DIV_ROUND_CLOSEST(*delay_off, 100); micro_leds_blink_set()
100 return ipaq_micro_tx_msg_sync(micro, &msg); micro_leds_blink_set()
/linux-4.4.14/drivers/media/pci/cx23885/
H A Dcx23885-i2c.c78 const struct i2c_msg *msg, int joined_rlen) i2c_sendbytes()
86 dprintk(1, "%s(msg->wlen=%d, nextmsg->rlen=%d)\n", __func__, i2c_sendbytes()
87 msg->len, joined_rlen); i2c_sendbytes()
89 dprintk(1, "%s(msg->len=%d)\n", __func__, msg->len); i2c_sendbytes()
92 if (msg->len == 0) { i2c_sendbytes()
93 cx_write(bus->reg_addr, msg->addr << 25); i2c_sendbytes()
106 addr = (msg->addr << 25) | msg->buf[0]; i2c_sendbytes()
107 wdata = msg->buf[0]; i2c_sendbytes()
110 if (msg->len > 1) i2c_sendbytes()
122 printk(" <W %02x %02x", msg->addr << 1, msg->buf[0]); i2c_sendbytes()
127 for (cnt = 1; cnt < msg->len; cnt++) { i2c_sendbytes()
129 wdata = msg->buf[cnt]; i2c_sendbytes()
132 if (cnt < msg->len - 1) i2c_sendbytes()
144 dprintk(1, " %02x", msg->buf[cnt]); i2c_sendbytes()
149 return msg->len; i2c_sendbytes()
159 const struct i2c_msg *msg, int joined) i2c_readbytes()
168 dprintk(1, "%s(msg->len=%d)\n", __func__, msg->len); i2c_readbytes()
171 if (msg->len == 0) { i2c_readbytes()
172 cx_write(bus->reg_addr, msg->addr << 25); i2c_readbytes()
188 dprintk(1, " <R %02x", (msg->addr << 1) + 1); i2c_readbytes()
191 for (cnt = 0; cnt < msg->len; cnt++) { i2c_readbytes()
195 if (cnt < msg->len - 1) i2c_readbytes()
198 cx_write(bus->reg_addr, msg->addr << 25); i2c_readbytes()
203 msg->buf[cnt] = cx_read(bus->reg_rdata) & 0xff; i2c_readbytes()
205 dprintk(1, " %02x", msg->buf[cnt]); i2c_readbytes()
210 return msg->len; i2c_readbytes()
367 struct i2c_msg msg; cx23885_av_clk() local
378 msg.addr = 0x44; cx23885_av_clk()
379 msg.flags = I2C_M_TEN; cx23885_av_clk()
380 msg.len = 3; cx23885_av_clk()
381 msg.buf = buffer; cx23885_av_clk()
383 i2c_xfer(&dev->i2c_bus[2].i2c_adap, &msg, 1); cx23885_av_clk()
77 i2c_sendbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg, int joined_rlen) i2c_sendbytes() argument
158 i2c_readbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg, int joined) i2c_readbytes() argument
H A Dnetup-init.c29 struct i2c_msg msg = { i2c_av_write() local
40 ret = i2c_transfer(i2c, &msg, 1); i2c_av_write()
50 struct i2c_msg msg = { i2c_av_write4() local
64 ret = i2c_transfer(i2c, &msg, 1); i2c_av_write4()
74 struct i2c_msg msg = { i2c_av_read() local
84 ret = i2c_transfer(i2c, &msg, 1); i2c_av_read()
89 msg.flags = I2C_M_RD; i2c_av_read()
90 msg.len = 1; i2c_av_read()
92 ret = i2c_transfer(i2c, &msg, 1); i2c_av_read()
H A Dnetup-eeprom.c34 struct i2c_msg msg[] = { netup_eeprom_read() local
52 ret = i2c_transfer(i2c_adap, msg, 2); netup_eeprom_read()
68 struct i2c_msg msg[] = { netup_eeprom_write() local
80 ret = i2c_transfer(i2c_adap, msg, 1); netup_eeprom_write()
/linux-4.4.14/arch/sparc/kernel/
H A Dsstate.c21 static void do_set_sstate(unsigned long state, const char *msg) do_set_sstate() argument
28 err = sun4v_mach_set_soft_state(state, kimage_addr_to_ra(msg)); do_set_sstate()
31 "state[%lx] msg[%s], err=%lu\n", do_set_sstate()
32 state, msg, err); do_set_sstate()
51 const char *msg; sstate_reboot_call() local
56 msg = rebooting_msg; sstate_reboot_call()
60 msg = halting_msg; sstate_reboot_call()
64 msg = poweroff_msg; sstate_reboot_call()
68 do_set_sstate(HV_SOFT_STATE_TRANSITION, msg); sstate_reboot_call()
/linux-4.4.14/sound/hda/
H A Dtrace.h21 TP_STRUCT__entry(__dynamic_array(char, msg, HDAC_MSG_MAX)),
23 snprintf(__get_str(msg), HDAC_MSG_MAX,
27 TP_printk("%s", __get_str(msg))
33 TP_STRUCT__entry(__dynamic_array(char, msg, HDAC_MSG_MAX)),
35 snprintf(__get_str(msg), HDAC_MSG_MAX,
39 TP_printk("%s", __get_str(msg))
45 TP_STRUCT__entry(__dynamic_array(char, msg, HDAC_MSG_MAX)),
47 snprintf(__get_str(msg), HDAC_MSG_MAX,
51 TP_printk("%s", __get_str(msg))
/linux-4.4.14/drivers/media/usb/dvb-usb/
H A Ddw2102.c170 static int dw2102_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], dw2102_i2c_transfer() argument
186 value = msg[0].buf[0];/* register */ dw2102_i2c_transfer()
187 for (i = 0; i < msg[1].len; i++) { dw2102_i2c_transfer()
190 msg[1].buf[i] = buf6[0]; dw2102_i2c_transfer()
194 switch (msg[0].addr) { dw2102_i2c_transfer()
198 buf6[1] = msg[0].buf[0]; dw2102_i2c_transfer()
199 buf6[2] = msg[0].buf[1]; dw2102_i2c_transfer()
204 if (msg[0].flags == 0) { dw2102_i2c_transfer()
209 buf6[3] = msg[0].buf[0]; dw2102_i2c_transfer()
210 buf6[4] = msg[0].buf[1]; dw2102_i2c_transfer()
211 buf6[5] = msg[0].buf[2]; dw2102_i2c_transfer()
212 buf6[6] = msg[0].buf[3]; dw2102_i2c_transfer()
219 msg[0].buf[0] = buf6[0]; dw2102_i2c_transfer()
225 msg[0].buf[0] = buf6[0]; dw2102_i2c_transfer()
226 msg[0].buf[1] = buf6[1]; dw2102_i2c_transfer()
230 buf6[1] = msg[0].buf[0]; dw2102_i2c_transfer()
244 struct i2c_msg msg[], int num) dw2102_serit_i2c_transfer()
257 buf6[0] = msg[0].addr << 1; dw2102_serit_i2c_transfer()
258 buf6[1] = msg[0].len; dw2102_serit_i2c_transfer()
259 buf6[2] = msg[0].buf[0]; dw2102_serit_i2c_transfer()
261 buf6, msg[0].len + 2, DW210X_WRITE_MSG); dw2102_serit_i2c_transfer()
264 buf6, msg[1].len + 2, DW210X_READ_MSG); dw2102_serit_i2c_transfer()
265 memcpy(msg[1].buf, buf6 + 2, msg[1].len); dw2102_serit_i2c_transfer()
269 switch (msg[0].addr) { dw2102_serit_i2c_transfer()
272 buf6[0] = msg[0].addr << 1; dw2102_serit_i2c_transfer()
273 buf6[1] = msg[0].len; dw2102_serit_i2c_transfer()
274 memcpy(buf6 + 2, msg[0].buf, msg[0].len); dw2102_serit_i2c_transfer()
276 msg[0].len + 2, DW210X_WRITE_MSG); dw2102_serit_i2c_transfer()
281 msg[0].buf[0] = buf6[0]; dw2102_serit_i2c_transfer()
282 msg[0].buf[1] = buf6[1]; dw2102_serit_i2c_transfer()
286 buf6[1] = msg[0].buf[0]; dw2102_serit_i2c_transfer()
298 static int dw2102_earda_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num) dw2102_earda_i2c_transfer() argument
314 if (2 + msg[1].len > sizeof(ibuf)) { dw2102_earda_i2c_transfer()
316 msg[1].len); dw2102_earda_i2c_transfer()
321 obuf[0] = msg[0].addr << 1; dw2102_earda_i2c_transfer()
322 obuf[1] = msg[0].len; dw2102_earda_i2c_transfer()
323 obuf[2] = msg[0].buf[0]; dw2102_earda_i2c_transfer()
325 obuf, msg[0].len + 2, DW210X_WRITE_MSG); dw2102_earda_i2c_transfer()
328 ibuf, msg[1].len + 2, DW210X_READ_MSG); dw2102_earda_i2c_transfer()
329 memcpy(msg[1].buf, ibuf + 2, msg[1].len); dw2102_earda_i2c_transfer()
334 switch (msg[0].addr) { dw2102_earda_i2c_transfer()
339 if (2 + msg[0].len > sizeof(obuf)) { dw2102_earda_i2c_transfer()
341 msg[1].len); dw2102_earda_i2c_transfer()
346 obuf[0] = msg[0].addr << 1; dw2102_earda_i2c_transfer()
347 obuf[1] = msg[0].len; dw2102_earda_i2c_transfer()
348 memcpy(obuf + 2, msg[0].buf, msg[0].len); dw2102_earda_i2c_transfer()
350 obuf, msg[0].len + 2, DW210X_WRITE_MSG); dw2102_earda_i2c_transfer()
357 if (2 + msg[0].len > sizeof(obuf)) { dw2102_earda_i2c_transfer()
359 msg[1].len); dw2102_earda_i2c_transfer()
364 obuf[0] = msg[0].addr << 1; dw2102_earda_i2c_transfer()
365 obuf[1] = msg[0].len; dw2102_earda_i2c_transfer()
366 memcpy(obuf + 2, msg[0].buf, msg[0].len); dw2102_earda_i2c_transfer()
368 obuf, msg[0].len + 2, DW210X_WRITE_MSG); dw2102_earda_i2c_transfer()
375 memcpy(msg[0].buf, ibuf , 2); dw2102_earda_i2c_transfer()
381 obuf[1] = msg[0].buf[0]; dw2102_earda_i2c_transfer()
397 static int dw2104_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num) dw2104_i2c_transfer() argument
408 switch (msg[j].addr) { dw2104_i2c_transfer()
413 memcpy(msg[j].buf, ibuf , 2); dw2104_i2c_transfer()
419 obuf[1] = msg[j].buf[0]; dw2104_i2c_transfer()
429 if (msg[j].flags == I2C_M_RD) { dw2104_i2c_transfer()
433 if (2 + msg[j].len > sizeof(ibuf)) { dw2104_i2c_transfer()
435 msg[j].len); dw2104_i2c_transfer()
441 (msg[j].addr << 1) + 1, 0, dw2104_i2c_transfer()
442 ibuf, msg[j].len + 2, dw2104_i2c_transfer()
444 memcpy(msg[j].buf, ibuf + 2, msg[j].len); dw2104_i2c_transfer()
446 } else if (((msg[j].buf[0] == 0xb0) && dw2104_i2c_transfer()
447 (msg[j].addr == 0x68)) || dw2104_i2c_transfer()
448 ((msg[j].buf[0] == 0xf7) && dw2104_i2c_transfer()
449 (msg[j].addr == 0x55))) { dw2104_i2c_transfer()
452 obuf[0] = msg[j].addr << 1; dw2104_i2c_transfer()
453 obuf[1] = (msg[j].len > 15 ? 17 : msg[j].len); dw2104_i2c_transfer()
454 obuf[2] = msg[j].buf[0]; dw2104_i2c_transfer()
455 len = msg[j].len - 1; dw2104_i2c_transfer()
458 memcpy(obuf + 3, msg[j].buf + i, dw2104_i2c_transfer()
470 if (2 + msg[j].len > sizeof(obuf)) { dw2104_i2c_transfer()
472 msg[j].len); dw2104_i2c_transfer()
477 obuf[0] = msg[j].addr << 1; dw2104_i2c_transfer()
478 obuf[1] = msg[j].len; dw2104_i2c_transfer()
479 memcpy(obuf + 2, msg[j].buf, msg[j].len); dw2104_i2c_transfer()
481 obuf, msg[j].len + 2, dw2104_i2c_transfer()
496 static int dw3101_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], dw3101_i2c_transfer() argument
514 if (2 + msg[1].len > sizeof(ibuf)) { dw3101_i2c_transfer()
516 msg[1].len); dw3101_i2c_transfer()
520 obuf[0] = msg[0].addr << 1; dw3101_i2c_transfer()
521 obuf[1] = msg[0].len; dw3101_i2c_transfer()
522 obuf[2] = msg[0].buf[0]; dw3101_i2c_transfer()
524 obuf, msg[0].len + 2, DW210X_WRITE_MSG); dw3101_i2c_transfer()
527 ibuf, msg[1].len + 2, DW210X_READ_MSG); dw3101_i2c_transfer()
528 memcpy(msg[1].buf, ibuf + 2, msg[1].len); dw3101_i2c_transfer()
533 switch (msg[0].addr) { dw3101_i2c_transfer()
539 if (2 + msg[0].len > sizeof(obuf)) { dw3101_i2c_transfer()
541 msg[0].len); dw3101_i2c_transfer()
545 obuf[0] = msg[0].addr << 1; dw3101_i2c_transfer()
546 obuf[1] = msg[0].len; dw3101_i2c_transfer()
547 memcpy(obuf + 2, msg[0].buf, msg[0].len); dw3101_i2c_transfer()
549 obuf, msg[0].len + 2, DW210X_WRITE_MSG); dw3101_i2c_transfer()
556 memcpy(msg[0].buf, ibuf , 2); dw3101_i2c_transfer()
565 deb_xfer("%02x:%02x: %s ", i, msg[i].addr, dw3101_i2c_transfer()
566 msg[i].flags == 0 ? ">>>" : "<<<"); dw3101_i2c_transfer()
567 debug_dump(msg[i].buf, msg[i].len, deb_xfer); dw3101_i2c_transfer()
576 static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], s6x0_i2c_transfer() argument
590 switch (msg[j].addr) { s6x0_i2c_transfer()
595 memcpy(msg[j].buf, ibuf + 3, 2); s6x0_i2c_transfer()
602 obuf[1] = msg[j].buf[1];/* off-on */ s6x0_i2c_transfer()
606 obuf[1] = msg[j].buf[0];/* 13v-18v */ s6x0_i2c_transfer()
615 obuf[1] = msg[j].buf[0]; s6x0_i2c_transfer()
626 if (msg[j].flags == I2C_M_RD) { s6x0_i2c_transfer()
630 if (msg[j].len > sizeof(ibuf)) { s6x0_i2c_transfer()
632 msg[j].len); s6x0_i2c_transfer()
638 ibuf, msg[j].len, s6x0_i2c_transfer()
640 memcpy(msg[j].buf, ibuf, msg[j].len); s6x0_i2c_transfer()
642 } else if ((msg[j].buf[0] == 0xb0) && s6x0_i2c_transfer()
643 (msg[j].addr == 0x68)) { s6x0_i2c_transfer()
646 obuf[0] = (msg[j].len > 16 ? s6x0_i2c_transfer()
647 18 : msg[j].len + 1); s6x0_i2c_transfer()
648 obuf[1] = msg[j].addr << 1; s6x0_i2c_transfer()
649 obuf[2] = msg[j].buf[0]; s6x0_i2c_transfer()
650 len = msg[j].len - 1; s6x0_i2c_transfer()
653 memcpy(obuf + 3, msg[j].buf + i, s6x0_i2c_transfer()
665 if (2 + msg[j].len > sizeof(obuf)) { s6x0_i2c_transfer()
667 msg[j].len); s6x0_i2c_transfer()
672 obuf[0] = msg[j + 1].len; s6x0_i2c_transfer()
673 obuf[1] = (msg[j].addr << 1); s6x0_i2c_transfer()
674 memcpy(obuf + 2, msg[j].buf, msg[j].len); s6x0_i2c_transfer()
678 obuf, msg[j].len + 2, s6x0_i2c_transfer()
685 if (2 + msg[j].len > sizeof(obuf)) { s6x0_i2c_transfer()
687 msg[j].len); s6x0_i2c_transfer()
691 obuf[0] = msg[j].len + 1; s6x0_i2c_transfer()
692 obuf[1] = (msg[j].addr << 1); s6x0_i2c_transfer()
693 memcpy(obuf + 2, msg[j].buf, msg[j].len); s6x0_i2c_transfer()
695 obuf, msg[j].len + 2, s6x0_i2c_transfer()
710 static int su3000_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], su3000_i2c_transfer() argument
723 switch (msg[0].addr) { su3000_i2c_transfer()
725 obuf[0] = msg[0].buf[0] + 0x36; su3000_i2c_transfer()
735 msg[0].buf[1] = ibuf[0]; su3000_i2c_transfer()
736 msg[0].buf[0] = ibuf[1]; su3000_i2c_transfer()
741 obuf[1] = msg[0].addr; su3000_i2c_transfer()
742 obuf[2] = msg[0].len; su3000_i2c_transfer()
744 memcpy(&obuf[3], msg[0].buf, msg[0].len); su3000_i2c_transfer()
746 if (dvb_usb_generic_rw(d, obuf, msg[0].len + 3, su3000_i2c_transfer()
755 obuf[1] = msg[0].len; su3000_i2c_transfer()
756 obuf[2] = msg[1].len; su3000_i2c_transfer()
757 obuf[3] = msg[0].addr; su3000_i2c_transfer()
758 memcpy(&obuf[4], msg[0].buf, msg[0].len); su3000_i2c_transfer()
760 if (dvb_usb_generic_rw(d, obuf, msg[0].len + 4, su3000_i2c_transfer()
761 ibuf, msg[1].len + 1, 0) < 0) su3000_i2c_transfer()
764 memcpy(msg[1].buf, &ibuf[1], msg[1].len); su3000_i2c_transfer()
843 struct i2c_msg msg[] = { s6x0_read_mac_address() local
859 ret = s6x0_i2c_transfer(&d->i2c_adap, msg, 2); s6x0_read_mac_address()
882 struct i2c_msg msg = { su3000_streaming_ctrl() local
889 i2c_transfer(&adap->dev->i2c_adap, &msg, 1); su3000_streaming_ctrl()
915 struct i2c_msg msg[] = { su3000_read_mac_address() local
932 if (i2c_transfer(&d->i2c_adap, msg, 2) != 2) su3000_read_mac_address()
958 struct i2c_msg msg = { dw210x_set_voltage() local
968 msg.buf = command_18v; dw210x_set_voltage()
970 msg.buf = command_13v; dw210x_set_voltage()
972 i2c_transfer(&udev_adap->dev->i2c_adap, &msg, 1); dw210x_set_voltage()
995 struct i2c_msg msg = { dw210x_led_ctrl() local
1005 msg.buf = led_on; dw210x_led_ctrl()
1006 i2c_transfer(&udev_adap->dev->i2c_adap, &msg, 1); dw210x_led_ctrl()
1606 struct i2c_msg msg = { dw2102_rc_query() local
1613 if (d->props.i2c_algo->master_xfer(&d->i2c_adap, &msg, 1) == 1) { dw2102_rc_query()
1614 if (msg.buf[0] != 0xff) { dw2102_rc_query()
1627 struct i2c_msg msg = { prof_rc_query() local
1634 if (d->props.i2c_algo->master_xfer(&d->i2c_adap, &msg, 1) == 1) { prof_rc_query()
1635 if (msg.buf[0] != 0xff) { prof_rc_query()
1648 struct i2c_msg msg = { su3000_rc_query() local
1655 if (d->props.i2c_algo->master_xfer(&d->i2c_adap, &msg, 1) == 1) { su3000_rc_query()
1656 if (msg.buf[0] != 0xff) { su3000_rc_query()
243 dw2102_serit_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num) dw2102_serit_i2c_transfer() argument
H A Dfriio-fe.c32 struct i2c_msg msg[2]; jdvbt90502_reg_read() local
38 msg[0].addr = state->config.demod_address; jdvbt90502_reg_read()
39 msg[0].flags = 0; jdvbt90502_reg_read()
40 msg[0].buf = wbuf; jdvbt90502_reg_read()
41 msg[0].len = sizeof(wbuf); jdvbt90502_reg_read()
43 msg[1].addr = msg[0].addr; jdvbt90502_reg_read()
44 msg[1].flags = I2C_M_RD; jdvbt90502_reg_read()
45 msg[1].buf = buf; jdvbt90502_reg_read()
46 msg[1].len = count; jdvbt90502_reg_read()
48 ret = i2c_transfer(state->i2c, msg, 2); jdvbt90502_reg_read()
60 struct i2c_msg msg; jdvbt90502_single_reg_write() local
66 msg.addr = state->config.demod_address; jdvbt90502_single_reg_write()
67 msg.flags = 0; jdvbt90502_single_reg_write()
68 msg.buf = wbuf; jdvbt90502_single_reg_write()
69 msg.len = sizeof(wbuf); jdvbt90502_single_reg_write()
71 if (i2c_transfer(state->i2c, &msg, 1) != 1) { jdvbt90502_single_reg_write()
131 struct i2c_msg msg[2]; jdvbt90502_pll_set_freq() local
151 msg[0].addr = state->config.demod_address; jdvbt90502_pll_set_freq()
152 msg[0].flags = 0; jdvbt90502_pll_set_freq()
153 msg[0].buf = pll_freq_cmd; jdvbt90502_pll_set_freq()
154 msg[0].len = sizeof(pll_freq_cmd); jdvbt90502_pll_set_freq()
156 ret = i2c_transfer(state->i2c, &msg[0], 1); jdvbt90502_pll_set_freq()
170 msg[1].addr = msg[0].addr; jdvbt90502_pll_set_freq()
171 msg[1].flags = 0; jdvbt90502_pll_set_freq()
172 msg[1].buf = pll_agc_cmd; jdvbt90502_pll_set_freq()
173 msg[1].len = sizeof(pll_agc_cmd); jdvbt90502_pll_set_freq()
175 ret = i2c_transfer(state->i2c, &msg[1], 1); jdvbt90502_pll_set_freq()
377 struct i2c_msg msg; jdvbt90502_init() local
383 msg.addr = state->config.demod_address; jdvbt90502_init()
384 msg.flags = 0; jdvbt90502_init()
385 msg.len = 2; jdvbt90502_init()
387 msg.buf = init_code[i]; jdvbt90502_init()
388 ret = i2c_transfer(state->i2c, &msg, 1); jdvbt90502_init()
H A Dfriio.c27 * This is done by a control msg to the FE with the I2C data accompanied, and
53 deb_xfer("not supported ctrl-msg, aborting."); gl861_i2c_ctrlmsg_data()
109 static int gl861_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], gl861_i2c_xfer() argument
124 if (i + 1 < num && (msg[i + 1].flags & I2C_M_RD)) { gl861_i2c_xfer()
125 if (gl861_i2c_msg(d, msg[i].addr, gl861_i2c_xfer()
126 msg[i].buf, msg[i].len, gl861_i2c_xfer()
127 msg[i + 1].buf, msg[i + 1].len) < 0) gl861_i2c_xfer()
131 if (gl861_i2c_msg(d, msg[i].addr, msg[i].buf, gl861_i2c_xfer()
132 msg[i].len, NULL, 0) < 0) gl861_i2c_xfer()
150 struct i2c_msg msg; friio_ext_ctl() local
159 msg.addr = 0x00; friio_ext_ctl()
160 msg.flags = 0; friio_ext_ctl()
161 msg.len = 2; friio_ext_ctl()
162 msg.buf = buf; friio_ext_ctl()
168 ret = gl861_i2c_xfer(&adap->dev->i2c_adap, &msg, 1); friio_ext_ctl()
170 ret += gl861_i2c_xfer(&adap->dev->i2c_adap, &msg, 1); friio_ext_ctl()
173 ret += gl861_i2c_xfer(&adap->dev->i2c_adap, &msg, 1); friio_ext_ctl()
175 ret += gl861_i2c_xfer(&adap->dev->i2c_adap, &msg, 1); friio_ext_ctl()
183 ret += gl861_i2c_xfer(&adap->dev->i2c_adap, &msg, 1); friio_ext_ctl()
185 ret += gl861_i2c_xfer(&adap->dev->i2c_adap, &msg, 1); friio_ext_ctl()
191 ret += gl861_i2c_xfer(&adap->dev->i2c_adap, &msg, 1); friio_ext_ctl()
193 ret += gl861_i2c_xfer(&adap->dev->i2c_adap, &msg, 1); friio_ext_ctl()
H A Ddtv5100.c70 static int dtv5100_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], dtv5100_i2c_xfer() argument
84 if (i+1 < num && (msg[i+1].flags & I2C_M_RD)) { dtv5100_i2c_xfer()
85 if (dtv5100_i2c_msg(d, msg[i].addr, msg[i].buf, dtv5100_i2c_xfer()
86 msg[i].len, msg[i+1].buf, dtv5100_i2c_xfer()
87 msg[i+1].len) < 0) dtv5100_i2c_xfer()
90 } else if (dtv5100_i2c_msg(d, msg[i].addr, msg[i].buf, dtv5100_i2c_xfer()
91 msg[i].len, NULL, 0) < 0) dtv5100_i2c_xfer()
/linux-4.4.14/drivers/s390/crypto/
H A Dzcrypt_msgtype6.h137 } __packed * msg = ap_msg->message; rng_type6CPRB_msgX() local
143 .ToCardLen1 = sizeof(*msg) - sizeof(msg->hdr), rng_type6CPRB_msgX()
144 .FromCardLen1 = sizeof(*msg) - sizeof(msg->hdr), rng_type6CPRB_msgX()
150 .req_parml = sizeof(*msg) - sizeof(msg->hdr) - rng_type6CPRB_msgX()
151 sizeof(msg->cprbx), rng_type6CPRB_msgX()
152 .rpl_msgbl = sizeof(*msg) - sizeof(msg->hdr), rng_type6CPRB_msgX()
155 msg->hdr = static_type6_hdrX; rng_type6CPRB_msgX()
156 msg->hdr.FromCardLen2 = random_number_length, rng_type6CPRB_msgX()
157 msg->cprbx = local_cprbx; rng_type6CPRB_msgX()
158 msg->cprbx.rpl_datal = random_number_length, rng_type6CPRB_msgX()
159 msg->cprbx.domain = AP_QID_QUEUE(ap_dev->qid); rng_type6CPRB_msgX()
160 memcpy(msg->function_code, msg->hdr.function_code, 0x02); rng_type6CPRB_msgX()
161 msg->rule_length = 0x0a; rng_type6CPRB_msgX()
162 memcpy(msg->rule, "RANDOM ", 8); rng_type6CPRB_msgX()
163 msg->verb_length = 0x02; rng_type6CPRB_msgX()
164 msg->key_length = 0x02; rng_type6CPRB_msgX()
165 ap_msg->length = sizeof(*msg); rng_type6CPRB_msgX()
H A Dzcrypt_msgtype6.c187 } __packed * msg = ap_msg->message; ICAMEX_msg_to_type6MEX_msgX() local
191 msg->length = mex->inputdatalength + 2; ICAMEX_msg_to_type6MEX_msgX()
192 if (copy_from_user(msg->text, mex->inputdata, mex->inputdatalength)) ICAMEX_msg_to_type6MEX_msgX()
196 size = zcrypt_type6_mex_key_en(mex, msg->text+mex->inputdatalength, 1); ICAMEX_msg_to_type6MEX_msgX()
199 size += sizeof(*msg) + mex->inputdatalength; ICAMEX_msg_to_type6MEX_msgX()
202 msg->hdr = static_type6_hdrX; ICAMEX_msg_to_type6MEX_msgX()
203 msg->hdr.ToCardLen1 = size - sizeof(msg->hdr); ICAMEX_msg_to_type6MEX_msgX()
204 msg->hdr.FromCardLen1 = PCIXCC_MAX_ICA_RESPONSE_SIZE - sizeof(msg->hdr); ICAMEX_msg_to_type6MEX_msgX()
206 msg->cprbx = static_cprbx; ICAMEX_msg_to_type6MEX_msgX()
207 msg->cprbx.domain = AP_QID_QUEUE(zdev->ap_dev->qid); ICAMEX_msg_to_type6MEX_msgX()
208 msg->cprbx.rpl_msgbl = msg->hdr.FromCardLen1; ICAMEX_msg_to_type6MEX_msgX()
210 msg->fr = (zdev->user_space_type == ZCRYPT_PCIXCC_MCL2) ? ICAMEX_msg_to_type6MEX_msgX()
213 msg->cprbx.req_parml = size - sizeof(msg->hdr) - sizeof(msg->cprbx); ICAMEX_msg_to_type6MEX_msgX()
255 } __packed * msg = ap_msg->message; ICACRT_msg_to_type6CRT_msgX() local
259 msg->length = crt->inputdatalength + 2; ICACRT_msg_to_type6CRT_msgX()
260 if (copy_from_user(msg->text, crt->inputdata, crt->inputdatalength)) ICACRT_msg_to_type6CRT_msgX()
264 size = zcrypt_type6_crt_key(crt, msg->text + crt->inputdatalength, 1); ICACRT_msg_to_type6CRT_msgX()
267 size += sizeof(*msg) + crt->inputdatalength; /* total size of msg */ ICACRT_msg_to_type6CRT_msgX()
270 msg->hdr = static_type6_hdrX; ICACRT_msg_to_type6CRT_msgX()
271 msg->hdr.ToCardLen1 = size - sizeof(msg->hdr); ICACRT_msg_to_type6CRT_msgX()
272 msg->hdr.FromCardLen1 = PCIXCC_MAX_ICA_RESPONSE_SIZE - sizeof(msg->hdr); ICACRT_msg_to_type6CRT_msgX()
274 msg->cprbx = static_cprbx; ICACRT_msg_to_type6CRT_msgX()
275 msg->cprbx.domain = AP_QID_QUEUE(zdev->ap_dev->qid); ICACRT_msg_to_type6CRT_msgX()
276 msg->cprbx.req_parml = msg->cprbx.rpl_msgbl = ICACRT_msg_to_type6CRT_msgX()
277 size - sizeof(msg->hdr) - sizeof(msg->cprbx); ICACRT_msg_to_type6CRT_msgX()
279 msg->fr = (zdev->user_space_type == ZCRYPT_PCIXCC_MCL2) ? ICACRT_msg_to_type6CRT_msgX()
311 } __packed * msg = ap_msg->message; XCRB_msg_to_type6CPRB_msgX() local
361 msg->hdr = static_type6_hdrX; XCRB_msg_to_type6CPRB_msgX()
362 memcpy(msg->hdr.agent_id , &(xcRB->agent_ID), sizeof(xcRB->agent_ID)); XCRB_msg_to_type6CPRB_msgX()
363 msg->hdr.ToCardLen1 = xcRB->request_control_blk_length; XCRB_msg_to_type6CPRB_msgX()
365 msg->hdr.offset2 = msg->hdr.offset1 + rcblen; XCRB_msg_to_type6CPRB_msgX()
366 msg->hdr.ToCardLen2 = xcRB->request_data_length; XCRB_msg_to_type6CPRB_msgX()
368 msg->hdr.FromCardLen1 = xcRB->reply_control_blk_length; XCRB_msg_to_type6CPRB_msgX()
369 msg->hdr.FromCardLen2 = xcRB->reply_data_length; XCRB_msg_to_type6CPRB_msgX()
372 if (copy_from_user(&(msg->cprbx), xcRB->request_control_blk_addr, XCRB_msg_to_type6CPRB_msgX()
375 if (msg->cprbx.cprb_len + sizeof(msg->hdr.function_code) > XCRB_msg_to_type6CPRB_msgX()
378 function_code = ((unsigned char *)&msg->cprbx) + msg->cprbx.cprb_len; XCRB_msg_to_type6CPRB_msgX()
379 memcpy(msg->hdr.function_code, function_code, XCRB_msg_to_type6CPRB_msgX()
380 sizeof(msg->hdr.function_code)); XCRB_msg_to_type6CPRB_msgX()
415 } __packed * msg = ap_msg->message; xcrb_msg_to_type6_ep11cprb_msgx() local
443 msg->hdr = static_type6_ep11_hdr; xcrb_msg_to_type6_ep11cprb_msgx()
444 msg->hdr.ToCardLen1 = xcRB->req_len; xcrb_msg_to_type6_ep11cprb_msgx()
445 msg->hdr.FromCardLen1 = xcRB->resp_len; xcrb_msg_to_type6_ep11cprb_msgx()
448 if (copy_from_user(&(msg->cprbx.cprb_len), xcrb_msg_to_type6_ep11cprb_msgx()
461 if (!((msg->cprbx.flags & 0x80) == 0x80)) { xcrb_msg_to_type6_ep11cprb_msgx()
462 msg->cprbx.target_id = (unsigned int) xcrb_msg_to_type6_ep11cprb_msgx()
465 if ((msg->pld_lenfmt & 0x80) == 0x80) { /*ext.len.fmt 2 or 3*/ xcrb_msg_to_type6_ep11cprb_msgx()
466 switch (msg->pld_lenfmt & 0x03) { xcrb_msg_to_type6_ep11cprb_msgx()
479 payload_hdr = (struct pld_hdr *)((&(msg->pld_lenfmt))+lfmt); xcrb_msg_to_type6_ep11cprb_msgx()
551 struct type86x_reply *msg = reply->message; convert_type86_ica() local
556 service_rc = msg->cprbx.ccp_rtcode; convert_type86_ica()
558 service_rs = msg->cprbx.ccp_rscode; convert_type86_ica()
578 msg->hdr.reply_code); convert_type86_ica()
581 data = msg->text; convert_type86_ica()
582 reply_len = msg->length - 2; convert_type86_ica()
624 struct type86_fmt2_msg *msg = reply->message; convert_type86_xcrb() local
629 data + msg->fmt2.offset1, msg->fmt2.count1)) convert_type86_xcrb()
631 xcRB->reply_control_blk_length = msg->fmt2.count1; convert_type86_xcrb()
634 if (msg->fmt2.count2) convert_type86_xcrb()
636 data + msg->fmt2.offset2, msg->fmt2.count2)) convert_type86_xcrb()
638 xcRB->reply_data_length = msg->fmt2.count2; convert_type86_xcrb()
655 struct type86_fmt2_msg *msg = reply->message; convert_type86_ep11_xcrb() local
658 if (xcRB->resp_len < msg->fmt2.count1) convert_type86_ep11_xcrb()
663 data + msg->fmt2.offset1, msg->fmt2.count1)) convert_type86_ep11_xcrb()
665 xcRB->resp_len = msg->fmt2.count1; convert_type86_ep11_xcrb()
677 } __packed * msg = reply->message; convert_type86_rng() local
680 if (msg->cprbx.ccp_rtcode != 0 || msg->cprbx.ccp_rscode != 0) convert_type86_rng()
682 memcpy(buffer, data + msg->fmt2.offset2, msg->fmt2.count2); convert_type86_rng()
683 return msg->fmt2.count2; convert_type86_rng()
691 struct type86x_reply *msg = reply->message; convert_response_ica() local
699 if (msg->cprbx.ccp_rtcode && convert_response_ica()
700 (msg->cprbx.ccp_rscode == 0x14f) && convert_response_ica()
708 if (msg->hdr.reply_code) convert_response_ica()
710 if (msg->cprbx.cprb_ver_id == 0x02) convert_response_ica()
729 struct type86x_reply *msg = reply->message; convert_response_xcrb() local
738 if (msg->hdr.reply_code) { convert_response_xcrb()
739 memcpy(&(xcRB->status), msg->fmt2.apfs, sizeof(u32)); convert_response_xcrb()
742 if (msg->cprbx.cprb_ver_id == 0x02) convert_response_xcrb()
760 struct type86_ep11_reply *msg = reply->message; convert_response_ep11_xcrb() local
768 if (msg->hdr.reply_code) convert_response_ep11_xcrb()
770 if (msg->cprbx.cprb_ver_id == 0x04) convert_response_ep11_xcrb()
787 struct type86x_reply *msg = reply->message; convert_response_rng() local
789 switch (msg->hdr.type) { convert_response_rng()
794 if (msg->hdr.reply_code) convert_response_rng()
796 if (msg->cprbx.cprb_ver_id == 0x02) convert_response_rng()
812 * "msg" has finished with the reply message "reply".
815 * @msg: pointer to the AP message
819 struct ap_message *msg, zcrypt_msgtype6_receive()
827 (struct response_type *) msg->private; zcrypt_msgtype6_receive()
842 memcpy(msg->message, reply->message, length); zcrypt_msgtype6_receive()
847 memcpy(msg->message, reply->message, length); zcrypt_msgtype6_receive()
850 memcpy(msg->message, &error_reply, zcrypt_msgtype6_receive()
854 memcpy(msg->message, reply->message, sizeof(error_reply)); zcrypt_msgtype6_receive()
861 * "msg" has finished with the reply message "reply".
864 * @msg: pointer to the AP message
868 struct ap_message *msg, zcrypt_msgtype6_receive_ep11()
876 (struct response_type *)msg->private; zcrypt_msgtype6_receive_ep11()
890 memcpy(msg->message, reply->message, length); zcrypt_msgtype6_receive_ep11()
893 memcpy(msg->message, &error_reply, sizeof(error_reply)); zcrypt_msgtype6_receive_ep11()
896 memcpy(msg->message, reply->message, sizeof(error_reply)); zcrypt_msgtype6_receive_ep11()
818 zcrypt_msgtype6_receive(struct ap_device *ap_dev, struct ap_message *msg, struct ap_message *reply) zcrypt_msgtype6_receive() argument
867 zcrypt_msgtype6_receive_ep11(struct ap_device *ap_dev, struct ap_message *msg, struct ap_message *reply) zcrypt_msgtype6_receive_ep11() argument
/linux-4.4.14/drivers/media/pci/cx25821/
H A Dcx25821-i2c.c81 const struct i2c_msg *msg, int joined_rlen) i2c_sendbytes()
89 dprintk(1, "%s(msg->wlen=%d, nextmsg->rlen=%d)\n", __func__, i2c_sendbytes()
90 msg->len, joined_rlen); i2c_sendbytes()
92 dprintk(1, "%s(msg->len=%d)\n", __func__, msg->len); i2c_sendbytes()
95 if (msg->len == 0) { i2c_sendbytes()
96 cx_write(bus->reg_addr, msg->addr << 25); i2c_sendbytes()
110 addr = (msg->addr << 25) | msg->buf[0]; i2c_sendbytes()
111 wdata = msg->buf[0]; i2c_sendbytes()
115 if (msg->len > 1) i2c_sendbytes()
136 for (cnt = 1; cnt < msg->len; cnt++) { i2c_sendbytes()
138 wdata = msg->buf[cnt]; i2c_sendbytes()
141 if (cnt < msg->len - 1) i2c_sendbytes()
158 dprintk(1, " %02x", msg->buf[cnt]); i2c_sendbytes()
164 return msg->len; i2c_sendbytes()
175 const struct i2c_msg *msg, int joined) i2c_readbytes()
183 dprintk(1, "6-%s(msg->len=%d)\n", __func__, msg->len); i2c_readbytes()
186 if (msg->len == 0) { i2c_readbytes()
187 cx_write(bus->reg_addr, msg->addr << 25); i2c_readbytes()
202 dprintk(1, " <R %02x", (msg->addr << 1) + 1); i2c_readbytes()
205 for (cnt = 0; cnt < msg->len; cnt++) { i2c_readbytes()
209 if (cnt < msg->len - 1) i2c_readbytes()
212 cx_write(bus->reg_addr, msg->addr << 25); i2c_readbytes()
220 msg->buf[cnt] = cx_read(bus->reg_rdata) & 0xff; i2c_readbytes()
223 dprintk(1, " %02x", msg->buf[cnt]); i2c_readbytes()
229 return msg->len; i2c_readbytes()
338 struct i2c_msg msg;
349 msg.addr = 0x44;
350 msg.flags = I2C_M_TEN;
351 msg.len = 3;
352 msg.buf = buffer;
354 i2c_xfer(&dev->i2c_bus[0].i2c_adap, &msg, 1);
80 i2c_sendbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg, int joined_rlen) i2c_sendbytes() argument
174 i2c_readbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg, int joined) i2c_readbytes() argument
/linux-4.4.14/drivers/net/ethernet/qualcomm/
H A Dqca_7k.c51 struct spi_message *msg; qcaspi_read_register() local
57 msg = &qca->spi_msg1; qcaspi_read_register()
62 spi_sync(qca->spi_dev, msg); qcaspi_read_register()
64 msg = &qca->spi_msg2; qcaspi_read_register()
74 ret = spi_sync(qca->spi_dev, msg); qcaspi_read_register()
77 ret = msg->status; qcaspi_read_register()
92 struct spi_message *msg; qcaspi_write_register() local
99 msg = &qca->spi_msg1; qcaspi_write_register()
104 spi_sync(qca->spi_dev, msg); qcaspi_write_register()
106 msg = &qca->spi_msg2; qcaspi_write_register()
116 ret = spi_sync(qca->spi_dev, msg); qcaspi_write_register()
119 ret = msg->status; qcaspi_write_register()
131 struct spi_message *msg = &qca->spi_msg1; qcaspi_tx_cmd() local
140 ret = spi_sync(qca->spi_dev, msg); qcaspi_tx_cmd()
143 ret = msg->status; qcaspi_tx_cmd()
/linux-4.4.14/include/net/
H A Dscm.h37 void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm);
38 void scm_detach_fds_compat(struct msghdr *msg, struct scm_cookie *scm);
39 int __scm_send(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm);
75 static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, scm_send() argument
84 if (msg->msg_controllen <= 0) scm_send()
86 return __scm_send(sock, msg, scm); scm_send()
90 static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm) scm_passec() argument
100 put_cmsg(msg, SOL_SOCKET, SCM_SECURITY, seclen, secdata); scm_passec()
106 static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm) scm_passec() argument
110 static __inline__ void scm_recv(struct socket *sock, struct msghdr *msg, scm_recv() argument
113 if (!msg->msg_control) { scm_recv()
115 msg->msg_flags |= MSG_CTRUNC; scm_recv()
127 put_cmsg(msg, SOL_SOCKET, SCM_CREDENTIALS, sizeof(ucreds), &ucreds); scm_recv()
132 scm_passec(sock, msg, scm); scm_recv()
137 scm_detach_fds(msg, scm); scm_recv()
H A Dtransp_v6.h36 void ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg,
38 void ip6_datagram_recv_common_ctl(struct sock *sk, struct msghdr *msg,
40 void ip6_datagram_recv_specific_ctl(struct sock *sk, struct msghdr *msg,
43 int ip6_datagram_send_ctl(struct net *net, struct sock *sk, struct msghdr *msg,
H A Dping.h34 int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len,
37 struct msghdr *msg,
40 struct msghdr *msg,
62 struct msghdr *msg; member in struct:pingfakehdr
78 int ping_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock,
80 int ping_common_sendmsg(int family, struct msghdr *msg, size_t len,
82 int ping_v6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len);
/linux-4.4.14/drivers/mfd/
H A Dipaq-micro.c37 struct ipaq_micro_msg *msg = micro->msg; ipaq_micro_trigger_tx() local
45 checksum = ((msg->id & 0x0f) << 4) | (msg->tx_len & 0x0f); ipaq_micro_trigger_tx()
48 for (i = 0; i < msg->tx_len; i++) { ipaq_micro_trigger_tx()
49 tx->buf[bp++] = msg->tx_data[i]; ipaq_micro_trigger_tx()
50 checksum += msg->tx_data[i]; ipaq_micro_trigger_tx()
65 int ipaq_micro_tx_msg(struct ipaq_micro *micro, struct ipaq_micro_msg *msg) ipaq_micro_tx_msg() argument
69 dev_dbg(micro->dev, "TX msg: %02x, %d bytes\n", msg->id, msg->tx_len); ipaq_micro_tx_msg()
72 if (micro->msg) { ipaq_micro_tx_msg()
73 list_add_tail(&msg->node, &micro->queue); ipaq_micro_tx_msg()
77 micro->msg = msg; ipaq_micro_tx_msg()
88 dev_dbg(micro->dev, "RX msg: %02x, %d bytes\n", id, len); micro_rx_msg()
100 if (micro->msg && micro->msg->id == id) { micro_rx_msg()
101 struct ipaq_micro_msg *msg = micro->msg; micro_rx_msg() local
103 memcpy(msg->rx_data, data, len); micro_rx_msg()
104 msg->rx_len = len; micro_rx_msg()
105 complete(&micro->msg->ack); micro_rx_msg()
107 micro->msg = list_entry(micro->queue.next, micro_rx_msg()
110 list_del_init(&micro->msg->node); micro_rx_msg()
113 micro->msg = NULL; micro_rx_msg()
118 if (!micro->msg) micro_rx_msg()
122 micro->msg->id); micro_rx_msg()
139 "unknown msg %d [%d] ", id, len); micro_rx_msg()
195 struct ipaq_micro_msg msg = { ipaq_micro_get_version() local
199 ipaq_micro_tx_msg_sync(micro, &msg); ipaq_micro_get_version()
200 if (msg.rx_len == 4) { ipaq_micro_get_version()
201 memcpy(micro->version, msg.rx_data, 4); ipaq_micro_get_version()
203 } else if (msg.rx_len == 9) { ipaq_micro_get_version()
204 memcpy(micro->version, msg.rx_data, 4); ipaq_micro_get_version()
209 "illegal version message %d bytes\n", msg.rx_len); ipaq_micro_get_version()
216 struct ipaq_micro_msg msg = { ipaq_micro_eeprom_read() local
222 msg.tx_data[0] = address + i; ipaq_micro_eeprom_read()
223 msg.tx_data[1] = 1; ipaq_micro_eeprom_read()
224 msg.tx_len = 2; ipaq_micro_eeprom_read()
225 ipaq_micro_tx_msg_sync(micro, &msg); ipaq_micro_eeprom_read()
226 memcpy(data + (i * 2), msg.rx_data, 2); ipaq_micro_eeprom_read()
311 if (micro->msg) micro_reset_comm()
312 complete(&micro->msg->ack); micro_reset_comm()
H A Dcros_ec_i2c.c60 struct cros_ec_command *msg) cros_ec_pkt_xfer_i2c()
81 packet_len = msg->insize + response_header_size; cros_ec_pkt_xfer_i2c()
87 packet_len = msg->outsize + request_header_size; cros_ec_pkt_xfer_i2c()
98 ret = cros_ec_prepare_tx(ec_dev, msg); cros_ec_pkt_xfer_i2c()
113 msg->result = ec_response_i2c->result; cros_ec_pkt_xfer_i2c()
116 switch (msg->result) { cros_ec_pkt_xfer_i2c()
122 msg->command); cros_ec_pkt_xfer_i2c()
127 msg->command, msg->result); cros_ec_pkt_xfer_i2c()
151 if (msg->insize < ec_response->data_len) { cros_ec_pkt_xfer_i2c()
154 msg->insize, cros_ec_pkt_xfer_i2c()
165 memcpy(msg->data, cros_ec_pkt_xfer_i2c()
169 sum += msg->data[i]; cros_ec_pkt_xfer_i2c()
181 if (msg->command == EC_CMD_REBOOT_EC) cros_ec_pkt_xfer_i2c()
188 struct cros_ec_command *msg) cros_ec_cmd_xfer_i2c()
209 packet_len = msg->insize + 3; cros_ec_cmd_xfer_i2c()
220 packet_len = msg->outsize + 4; cros_ec_cmd_xfer_i2c()
227 out_buf[0] = EC_CMD_VERSION0 + msg->version; cros_ec_cmd_xfer_i2c()
228 out_buf[1] = msg->command; cros_ec_cmd_xfer_i2c()
229 out_buf[2] = msg->outsize; cros_ec_cmd_xfer_i2c()
233 for (i = 0; i < msg->outsize; i++) { cros_ec_cmd_xfer_i2c()
234 out_buf[3 + i] = msg->data[i]; cros_ec_cmd_xfer_i2c()
237 out_buf[3 + msg->outsize] = sum; cros_ec_cmd_xfer_i2c()
251 msg->result = i2c_msg[1].buf[0]; cros_ec_cmd_xfer_i2c()
252 ret = cros_ec_check_result(ec_dev, msg); cros_ec_cmd_xfer_i2c()
257 if (len > msg->insize) { cros_ec_cmd_xfer_i2c()
259 len, msg->insize); cros_ec_cmd_xfer_i2c()
267 msg->data[i] = in_buf[2 + i]; cros_ec_cmd_xfer_i2c()
282 if (msg->command == EC_CMD_REBOOT_EC) cros_ec_cmd_xfer_i2c()
59 cros_ec_pkt_xfer_i2c(struct cros_ec_device *ec_dev, struct cros_ec_command *msg) cros_ec_pkt_xfer_i2c() argument
187 cros_ec_cmd_xfer_i2c(struct cros_ec_device *ec_dev, struct cros_ec_command *msg) cros_ec_cmd_xfer_i2c() argument
H A Dtps65912-spi.c34 struct spi_message msg; tps65912_spi_write() local
44 spi_message_init(&msg); tps65912_spi_write()
45 spi_message_add_tail(&xfer, &msg); tps65912_spi_write()
47 ret = spi_sync(spi, &msg); tps65912_spi_write()
58 struct spi_message msg; tps65912_spi_read() local
71 spi_message_init(&msg); tps65912_spi_read()
72 spi_message_add_tail(&xfer, &msg); tps65912_spi_read()
77 ret = spi_sync(spi, &msg); tps65912_spi_read()
/linux-4.4.14/drivers/w1/
H A Dw1_netlink.c46 struct w1_netlink_msg *msg; /* advances as w1_netlink_msg is appened */ member in struct:w1_cb_block
61 struct w1_netlink_msg *msg; member in struct:w1_cb_node
108 block->msg = NULL; w1_reply_make_space()
121 * w1_netlink_setup_msg() - prepare to write block->msg
126 * block->cn->len does not include space for block->msg
127 * block->msg advances but remains uninitialized
132 block->msg = (struct w1_netlink_msg *)(block->cn->data + block->cn->len); w1_netlink_setup_msg()
144 block->msg = (struct w1_netlink_msg *)block->cn->data; w1_netlink_setup_msg()
148 /* Append cmd to msg, include cmd->data as well. This is because
164 memcpy(block->msg, block->cur_msg, sizeof(*block->msg)); w1_netlink_queue_cmd()
165 block->cn->len += sizeof(*block->msg); w1_netlink_queue_cmd()
166 block->msg->len = 0; w1_netlink_queue_cmd()
167 block->cmd = (struct w1_netlink_cmd *)(block->msg->data); w1_netlink_queue_cmd()
173 block->msg->len += space; w1_netlink_queue_cmd()
187 memcpy(block->msg, req_msg, sizeof(*req_msg)); w1_netlink_queue_status()
189 block->msg->len = 0; w1_netlink_queue_status()
190 block->msg->status = (u8)-error; w1_netlink_queue_status()
192 struct w1_netlink_cmd *cmd = (struct w1_netlink_cmd *)block->msg->data; w1_netlink_queue_status()
195 block->msg->len += sizeof(*cmd); w1_netlink_queue_status()
204 * @msg: original w1_netlink_msg
208 * Use when a block isn't available to queue the message to and cn, msg
211 static void w1_netlink_send_error(struct cn_msg *cn, struct w1_netlink_msg *msg, w1_netlink_send_error() argument
216 struct w1_netlink_msg msg; w1_netlink_send_error() member in struct:__anon11256
219 memcpy(&packet.msg, msg, sizeof(packet.msg)); w1_netlink_send_error()
220 packet.cn.len = sizeof(packet.msg); w1_netlink_send_error()
221 packet.msg.len = 0; w1_netlink_send_error()
222 packet.msg.status = (u8)-error; w1_netlink_send_error()
229 * @msg: w1_netlink_msg message to be sent
233 void w1_netlink_send(struct w1_master *dev, struct w1_netlink_msg *msg) w1_netlink_send() argument
237 struct w1_netlink_msg msg; w1_netlink_send() member in struct:__anon11257
245 packet.cn.len = sizeof(*msg); w1_netlink_send()
247 memcpy(&packet.msg, msg, sizeof(*msg)); w1_netlink_send()
248 packet.msg.len = 0; w1_netlink_send()
271 block->msg->len += sizeof(*data); w1_send_slave()
420 struct w1_netlink_msg *msg; w1_process_command_root() local
433 msg = (struct w1_netlink_msg *)cn->data; w1_process_command_root()
435 msg->type = W1_LIST_MASTERS; w1_process_command_root()
436 msg->status = 0; w1_process_command_root()
437 msg->len = 0; w1_process_command_root()
438 id = (u32 *)msg->data; w1_process_command_root()
445 msg->len = 0; w1_process_command_root()
446 id = (u32 *)msg->data; w1_process_command_root()
450 msg->len += sizeof(*id); w1_process_command_root()
465 u16 mlen = node->msg->len; w1_process_cb()
469 struct w1_netlink_cmd *cmd = (struct w1_netlink_cmd *)node->msg->data; w1_process_cb()
475 node->block->cur_msg = node->msg; w1_process_cb()
489 w1_netlink_queue_status(node->block, node->msg, cmd, err); w1_process_cb()
498 w1_netlink_queue_status(node->block, node->msg, cmd, err); w1_process_cb()
517 static void w1_list_count_cmds(struct w1_netlink_msg *msg, int *cmd_count, w1_list_count_cmds() argument
520 struct w1_netlink_cmd *cmd = (struct w1_netlink_cmd *)msg->data; w1_list_count_cmds()
521 u16 mlen = msg->len; w1_list_count_cmds()
541 struct w1_master *dev = w1_search_master_id(msg->id.mst.id); w1_list_count_cmds()
556 struct w1_netlink_msg *msg = (struct w1_netlink_msg *)(cn + 1); w1_cn_callback() local
572 w1_netlink_send_error(cn, msg, nsp->portid, -EINVAL); w1_cn_callback()
581 if (msg->len + sizeof(struct w1_netlink_msg) > msg_len) { w1_cn_callback()
589 if (msg->type == W1_MASTER_CMD || msg->type == W1_SLAVE_CMD) { w1_cn_callback()
591 w1_list_count_cmds(msg, &cmd_count, &slave_len); w1_cn_callback()
594 msg_len -= sizeof(struct w1_netlink_msg) + msg->len; w1_cn_callback()
595 msg = (struct w1_netlink_msg *)(((u8 *)msg) + w1_cn_callback()
596 sizeof(struct w1_netlink_msg) + msg->len); w1_cn_callback()
598 msg = (struct w1_netlink_msg *)(cn + 1); w1_cn_callback()
628 w1_netlink_send_error(cn, msg, nsp->portid, -ENOMEM); w1_cn_callback()
656 if (msg->len + sizeof(struct w1_netlink_msg) > msg_len) { w1_cn_callback()
662 if (msg->type == W1_LIST_MASTERS) { w1_cn_callback()
670 if (!msg->len) { w1_cn_callback()
676 if (msg->type == W1_MASTER_CMD) { w1_cn_callback()
677 dev = w1_search_master_id(msg->id.mst.id); w1_cn_callback()
678 } else if (msg->type == W1_SLAVE_CMD) { w1_cn_callback()
679 sl = w1_search_slave((struct w1_reg_num *)msg->id.id); w1_cn_callback()
685 msg->type, msg->len); w1_cn_callback()
700 node->msg = (struct w1_netlink_msg *)((u8 *)&block->request_cn + w1_cn_callback()
701 (size_t)((u8 *)msg - (u8 *)cn)); w1_cn_callback()
717 w1_netlink_send_error(cn, msg, nsp->portid, err); w1_cn_callback()
718 msg_len -= sizeof(struct w1_netlink_msg) + msg->len; w1_cn_callback()
719 msg = (struct w1_netlink_msg *)(((u8 *)msg) + w1_cn_callback()
720 sizeof(struct w1_netlink_msg) + msg->len); w1_cn_callback()
/linux-4.4.14/drivers/media/firewire/
H A Dfiredtv-ci.c81 return avc_ca_app_info(fdtv, reply->msg, &reply->length); fdtv_ca_app_info()
88 return avc_ca_info(fdtv, reply->msg, &reply->length); fdtv_ca_info()
95 return avc_ca_get_mmi(fdtv, reply->msg, &reply->length); fdtv_ca_get_mmi()
128 struct ca_msg *msg = arg; fdtv_ca_pmt() local
134 if (msg->msg[3] & 0x80) { fdtv_ca_pmt()
136 for (i = 0; i < (msg->msg[3] & 0x7f); i++) fdtv_ca_pmt()
137 data_length = (data_length << 8) + msg->msg[data_pos++]; fdtv_ca_pmt()
139 data_length = msg->msg[3]; fdtv_ca_pmt()
142 return avc_ca_pmt(fdtv, &msg->msg[data_pos], data_length); fdtv_ca_pmt()
147 struct ca_msg *msg = arg; fdtv_ca_send_msg() local
152 (msg->msg[0] << 16) + (msg->msg[1] << 8) + msg->msg[2]; fdtv_ca_send_msg()
/linux-4.4.14/drivers/nfc/st-nci/
H A Dvendor_cmds.c106 struct sk_buff *msg, *skb; st_nci_hci_dm_get_info() local
114 msg = nfc_vendor_cmd_alloc_reply_skb(dev, ST_NCI_VENDOR_OUI, st_nci_hci_dm_get_info()
116 if (!msg) { st_nci_hci_dm_get_info()
121 if (nla_put(msg, NFC_ATTR_VENDOR_DATA, skb->len, skb->data)) { st_nci_hci_dm_get_info()
122 kfree_skb(msg); st_nci_hci_dm_get_info()
127 r = nfc_vendor_cmd_reply(msg); st_nci_hci_dm_get_info()
139 struct sk_buff *msg, *skb; st_nci_hci_dm_get_data() local
147 msg = nfc_vendor_cmd_alloc_reply_skb(dev, ST_NCI_VENDOR_OUI, st_nci_hci_dm_get_data()
149 if (!msg) { st_nci_hci_dm_get_data()
154 if (nla_put(msg, NFC_ATTR_VENDOR_DATA, skb->len, skb->data)) { st_nci_hci_dm_get_data()
155 kfree_skb(msg); st_nci_hci_dm_get_data()
160 r = nfc_vendor_cmd_reply(msg); st_nci_hci_dm_get_data()
221 struct sk_buff *msg, *skb; st_nci_hci_get_param() local
232 msg = nfc_vendor_cmd_alloc_reply_skb(dev, ST_NCI_VENDOR_OUI, st_nci_hci_get_param()
234 if (!msg) { st_nci_hci_get_param()
239 if (nla_put(msg, NFC_ATTR_VENDOR_DATA, skb->len, skb->data)) { st_nci_hci_get_param()
240 kfree_skb(msg); st_nci_hci_get_param()
245 r = nfc_vendor_cmd_reply(msg); st_nci_hci_get_param()
266 struct sk_buff *msg, *skb; st_nci_hci_dm_vdc_measurement_value() local
278 msg = nfc_vendor_cmd_alloc_reply_skb(dev, ST_NCI_VENDOR_OUI, st_nci_hci_dm_vdc_measurement_value()
280 if (!msg) { st_nci_hci_dm_vdc_measurement_value()
285 if (nla_put(msg, NFC_ATTR_VENDOR_DATA, skb->len, skb->data)) { st_nci_hci_dm_vdc_measurement_value()
286 kfree_skb(msg); st_nci_hci_dm_vdc_measurement_value()
291 r = nfc_vendor_cmd_reply(msg); st_nci_hci_dm_vdc_measurement_value()
303 struct sk_buff *msg, *skb; st_nci_hci_dm_vdc_value_comparison() local
315 msg = nfc_vendor_cmd_alloc_reply_skb(dev, ST_NCI_VENDOR_OUI, st_nci_hci_dm_vdc_value_comparison()
317 if (!msg) { st_nci_hci_dm_vdc_value_comparison()
322 if (nla_put(msg, NFC_ATTR_VENDOR_DATA, skb->len, skb->data)) { st_nci_hci_dm_vdc_value_comparison()
323 kfree_skb(msg); st_nci_hci_dm_vdc_value_comparison()
328 r = nfc_vendor_cmd_reply(msg); st_nci_hci_dm_vdc_value_comparison()
356 struct sk_buff *msg; st_nci_hci_loopback() local
381 msg = nfc_vendor_cmd_alloc_reply_skb(ndev->nfc_dev, st_nci_hci_loopback()
385 if (!msg) { st_nci_hci_loopback()
390 if (nla_put(msg, NFC_ATTR_VENDOR_DATA, info->vendor_info.rx_skb->len, st_nci_hci_loopback()
392 kfree_skb(msg); st_nci_hci_loopback()
397 r = nfc_vendor_cmd_reply(msg); st_nci_hci_loopback()
407 struct sk_buff *msg; st_nci_manufacturer_specific() local
410 msg = nfc_vendor_cmd_alloc_reply_skb(dev, ST_NCI_VENDOR_OUI, st_nci_manufacturer_specific()
413 if (!msg) st_nci_manufacturer_specific()
416 if (nla_put(msg, NFC_ATTR_VENDOR_DATA, sizeof(ndev->manufact_specific_info), st_nci_manufacturer_specific()
418 kfree_skb(msg); st_nci_manufacturer_specific()
422 return nfc_vendor_cmd_reply(msg); st_nci_manufacturer_specific()
/linux-4.4.14/drivers/media/usb/cx231xx/
H A Dcx231xx-i2c.c65 const struct i2c_msg *msg, int tuner_type) is_tuner()
72 if (msg->addr != dev->board.tuner_addr) is_tuner()
85 const struct i2c_msg *msg) cx231xx_i2c_send_bytes()
98 if (is_tuner(dev, bus, msg, TUNER_XC5000)) { cx231xx_i2c_send_bytes()
99 size = msg->len; cx231xx_i2c_send_bytes()
106 if (msg->len >= 2) cx231xx_i2c_send_bytes()
107 saddr = msg->buf[0] << 8 | msg->buf[1]; cx231xx_i2c_send_bytes()
108 else if (msg->len == 1) cx231xx_i2c_send_bytes()
109 saddr = msg->buf[0]; cx231xx_i2c_send_bytes()
132 msg->addr, msg->len, saddr); cx231xx_i2c_send_bytes()
135 msg->addr, cx231xx_i2c_send_bytes()
136 msg->buf, cx231xx_i2c_send_bytes()
137 msg->len); cx231xx_i2c_send_bytes()
146 buf_ptr = (u8 *) (msg->buf + 1); cx231xx_i2c_send_bytes()
150 req_data.dev_addr = msg->addr; cx231xx_i2c_send_bytes()
151 req_data.direction = msg->flags; cx231xx_i2c_send_bytes()
153 req_data.saddr_dat = msg->buf[0]; cx231xx_i2c_send_bytes()
177 req_data.dev_addr = msg->addr; cx231xx_i2c_send_bytes()
178 req_data.direction = msg->flags; cx231xx_i2c_send_bytes()
181 req_data.buf_size = msg->len; cx231xx_i2c_send_bytes()
182 req_data.p_buffer = msg->buf; cx231xx_i2c_send_bytes()
196 const struct i2c_msg *msg) cx231xx_i2c_recv_bytes()
205 if (is_tuner(dev, bus, msg, TUNER_XC5000)) { cx231xx_i2c_recv_bytes()
206 if (msg->len == 2) cx231xx_i2c_recv_bytes()
207 saddr = msg->buf[0] << 8 | msg->buf[1]; cx231xx_i2c_recv_bytes()
208 else if (msg->len == 1) cx231xx_i2c_recv_bytes()
209 saddr = msg->buf[0]; cx231xx_i2c_recv_bytes()
218 msg->buf[0] = 0; cx231xx_i2c_recv_bytes()
219 if (msg->len == 2) cx231xx_i2c_recv_bytes()
220 msg->buf[1] = 0; cx231xx_i2c_recv_bytes()
234 msg->addr, msg->len, cx231xx_i2c_recv_bytes()
235 msg->buf[0] << 8 | msg->buf[1]); cx231xx_i2c_recv_bytes()
238 dev->cx231xx_gpio_i2c_write(dev, msg->addr, cx231xx_i2c_recv_bytes()
239 msg->buf, cx231xx_i2c_recv_bytes()
240 msg->len); cx231xx_i2c_recv_bytes()
242 dev->cx231xx_gpio_i2c_read(dev, msg->addr, cx231xx_i2c_recv_bytes()
243 msg->buf, cx231xx_i2c_recv_bytes()
244 msg->len); cx231xx_i2c_recv_bytes()
250 req_data.dev_addr = msg->addr; cx231xx_i2c_recv_bytes()
251 req_data.direction = msg->flags; cx231xx_i2c_recv_bytes()
252 req_data.saddr_len = msg->len; cx231xx_i2c_recv_bytes()
253 req_data.saddr_dat = msg->buf[0] << 8 | msg->buf[1]; cx231xx_i2c_recv_bytes()
254 req_data.buf_size = msg->len; cx231xx_i2c_recv_bytes()
255 req_data.p_buffer = msg->buf; cx231xx_i2c_recv_bytes()
263 req_data.dev_addr = msg->addr; cx231xx_i2c_recv_bytes()
264 req_data.direction = msg->flags; cx231xx_i2c_recv_bytes()
267 req_data.buf_size = msg->len; cx231xx_i2c_recv_bytes()
268 req_data.p_buffer = msg->buf; cx231xx_i2c_recv_bytes()
346 const struct i2c_msg *msg) cx231xx_i2c_check_for_device()
355 req_data.dev_addr = msg->addr; cx231xx_i2c_check_for_device()
64 is_tuner(struct cx231xx *dev, struct cx231xx_i2c *bus, const struct i2c_msg *msg, int tuner_type) is_tuner() argument
84 cx231xx_i2c_send_bytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg) cx231xx_i2c_send_bytes() argument
195 cx231xx_i2c_recv_bytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg) cx231xx_i2c_recv_bytes() argument
345 cx231xx_i2c_check_for_device(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg) cx231xx_i2c_check_for_device() argument
/linux-4.4.14/Documentation/connector/
H A Dcn_test.c38 static void cn_test_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp) cn_test_callback() argument
41 __func__, jiffies, msg->id.idx, msg->id.val, cn_test_callback()
42 msg->seq, msg->ack, msg->len, cn_test_callback()
43 msg->len ? (char *)msg->data : ""); cn_test_callback()
56 struct cn_msg *msg = NULL;
62 size0 = sizeof(*msg) + sizeof(*ctl) + 3 * sizeof(*req);
78 msg = nlmsg_data(nlh);
80 memset(msg, 0, size0);
82 msg->id.idx = -1;
83 msg->id.val = -1;
84 msg->seq = 0x123;
85 msg->ack = 0x345;
86 msg->len = size0 - sizeof(*msg);
88 ctl = (struct cn_ctl_msg *)(msg + 1);
93 ctl->len = msg->len - sizeof(*ctl);
/linux-4.4.14/drivers/net/wan/
H A Dixp4xx_hss.c273 struct msg { struct
360 static void hss_npe_send(struct port *port, struct msg *msg, const char* what) hss_npe_send() argument
362 u32 *val = (u32*)msg; hss_npe_send()
363 if (npe_send_message(port->npe, msg, what)) { hss_npe_send()
372 struct msg msg; hss_config_set_lut() local
375 memset(&msg, 0, sizeof(msg)); hss_config_set_lut()
376 msg.cmd = PORT_CONFIG_WRITE; hss_config_set_lut()
377 msg.hss_port = port->id; hss_config_set_lut()
380 msg.data32 >>= 2; hss_config_set_lut()
381 msg.data32 |= TDMMAP_HDLC << 30; hss_config_set_lut()
384 msg.index = HSS_CONFIG_TX_LUT + ((ch / 4) & ~3); hss_config_set_lut()
385 hss_npe_send(port, &msg, "HSS_SET_TX_LUT"); hss_config_set_lut()
387 msg.index += HSS_CONFIG_RX_LUT - HSS_CONFIG_TX_LUT; hss_config_set_lut()
388 hss_npe_send(port, &msg, "HSS_SET_RX_LUT"); hss_config_set_lut()
395 struct msg msg; hss_config() local
397 memset(&msg, 0, sizeof(msg)); hss_config()
398 msg.cmd = PORT_CONFIG_WRITE; hss_config()
399 msg.hss_port = port->id; hss_config()
400 msg.index = HSS_CONFIG_TX_PCR; hss_config()
401 msg.data32 = PCR_FRM_PULSE_DISABLED | PCR_MSB_ENDIAN | hss_config()
404 msg.data32 |= PCR_SYNC_CLK_DIR_OUTPUT; hss_config()
405 hss_npe_send(port, &msg, "HSS_SET_TX_PCR"); hss_config()
407 msg.index = HSS_CONFIG_RX_PCR; hss_config()
408 msg.data32 ^= PCR_TX_DATA_ENABLE | PCR_DCLK_EDGE_RISING; hss_config()
409 hss_npe_send(port, &msg, "HSS_SET_RX_PCR"); hss_config()
411 memset(&msg, 0, sizeof(msg)); hss_config()
412 msg.cmd = PORT_CONFIG_WRITE; hss_config()
413 msg.hss_port = port->id; hss_config()
414 msg.index = HSS_CONFIG_CORE_CR; hss_config()
415 msg.data32 = (port->loopback ? CCR_LOOPBACK : 0) | hss_config()
417 hss_npe_send(port, &msg, "HSS_SET_CORE_CR"); hss_config()
419 memset(&msg, 0, sizeof(msg)); hss_config()
420 msg.cmd = PORT_CONFIG_WRITE; hss_config()
421 msg.hss_port = port->id; hss_config()
422 msg.index = HSS_CONFIG_CLOCK_CR; hss_config()
423 msg.data32 = port->clock_reg; hss_config()
424 hss_npe_send(port, &msg, "HSS_SET_CLOCK_CR"); hss_config()
426 memset(&msg, 0, sizeof(msg)); hss_config()
427 msg.cmd = PORT_CONFIG_WRITE; hss_config()
428 msg.hss_port = port->id; hss_config()
429 msg.index = HSS_CONFIG_TX_FCR; hss_config()
430 msg.data16a = FRAME_OFFSET; hss_config()
431 msg.data16b = FRAME_SIZE - 1; hss_config()
432 hss_npe_send(port, &msg, "HSS_SET_TX_FCR"); hss_config()
434 memset(&msg, 0, sizeof(msg)); hss_config()
435 msg.cmd = PORT_CONFIG_WRITE; hss_config()
436 msg.hss_port = port->id; hss_config()
437 msg.index = HSS_CONFIG_RX_FCR; hss_config()
438 msg.data16a = FRAME_OFFSET; hss_config()
439 msg.data16b = FRAME_SIZE - 1; hss_config()
440 hss_npe_send(port, &msg, "HSS_SET_RX_FCR"); hss_config()
444 memset(&msg, 0, sizeof(msg)); hss_config()
445 msg.cmd = PORT_CONFIG_LOAD; hss_config()
446 msg.hss_port = port->id; hss_config()
447 hss_npe_send(port, &msg, "HSS_LOAD_CONFIG"); hss_config()
449 if (npe_recv_message(port->npe, &msg, "HSS_LOAD_CONFIG") || hss_config()
451 msg.cmd != PORT_CONFIG_LOAD || msg.data32) { hss_config()
457 npe_recv_message(port->npe, &msg, "FLUSH_IT"); hss_config()
462 struct msg msg; hss_set_hdlc_cfg() local
464 memset(&msg, 0, sizeof(msg)); hss_set_hdlc_cfg()
465 msg.cmd = PKT_PIPE_HDLC_CFG_WRITE; hss_set_hdlc_cfg()
466 msg.hss_port = port->id; hss_set_hdlc_cfg()
467 msg.data8a = port->hdlc_cfg; /* rx_cfg */ hss_set_hdlc_cfg()
468 msg.data8b = port->hdlc_cfg | (PKT_EXTRA_FLAGS << 3); /* tx_cfg */ hss_set_hdlc_cfg()
469 hss_npe_send(port, &msg, "HSS_SET_HDLC_CFG"); hss_set_hdlc_cfg()
474 struct msg msg; hss_get_status() local
476 memset(&msg, 0, sizeof(msg)); hss_get_status()
477 msg.cmd = PORT_ERROR_READ; hss_get_status()
478 msg.hss_port = port->id; hss_get_status()
479 hss_npe_send(port, &msg, "PORT_ERROR_READ"); hss_get_status()
480 if (npe_recv_message(port->npe, &msg, "PORT_ERROR_READ")) { hss_get_status()
485 return msg.data32; hss_get_status()
490 struct msg msg; hss_start_hdlc() local
492 memset(&msg, 0, sizeof(msg)); hss_start_hdlc()
493 msg.cmd = PKT_PIPE_FLOW_ENABLE; hss_start_hdlc()
494 msg.hss_port = port->id; hss_start_hdlc()
495 msg.data32 = 0; hss_start_hdlc()
496 hss_npe_send(port, &msg, "HSS_ENABLE_PKT_PIPE"); hss_start_hdlc()
501 struct msg msg; hss_stop_hdlc() local
503 memset(&msg, 0, sizeof(msg)); hss_stop_hdlc()
504 msg.cmd = PKT_PIPE_FLOW_DISABLE; hss_stop_hdlc()
505 msg.hss_port = port->id; hss_stop_hdlc()
506 hss_npe_send(port, &msg, "HSS_DISABLE_PKT_PIPE"); hss_stop_hdlc()
512 struct msg msg; hss_load_firmware() local
524 memset(&msg, 0, sizeof(msg)); hss_load_firmware()
525 msg.cmd = PKT_NUM_PIPES_WRITE; hss_load_firmware()
526 msg.hss_port = port->id; hss_load_firmware()
527 msg.data8a = PKT_NUM_PIPES; hss_load_firmware()
528 hss_npe_send(port, &msg, "HSS_SET_PKT_PIPES"); hss_load_firmware()
530 msg.cmd = PKT_PIPE_FIFO_SIZEW_WRITE; hss_load_firmware()
531 msg.data8a = PKT_PIPE_FIFO_SIZEW; hss_load_firmware()
532 hss_npe_send(port, &msg, "HSS_SET_PKT_FIFO"); hss_load_firmware()
534 msg.cmd = PKT_PIPE_MODE_WRITE; hss_load_firmware()
535 msg.data8a = NPE_PKT_MODE_HDLC; hss_load_firmware()
536 /* msg.data8b = inv_mask */ hss_load_firmware()
537 /* msg.data8c = or_mask */ hss_load_firmware()
538 hss_npe_send(port, &msg, "HSS_SET_PKT_MODE"); hss_load_firmware()
540 msg.cmd = PKT_PIPE_RX_SIZE_WRITE; hss_load_firmware()
541 msg.data16a = HDLC_MAX_MRU; /* including CRC */ hss_load_firmware()
542 hss_npe_send(port, &msg, "HSS_SET_PKT_RX_SIZE"); hss_load_firmware()
544 msg.cmd = PKT_PIPE_IDLE_PATTERN_WRITE; hss_load_firmware()
545 msg.data32 = 0x7F7F7F7F; /* ??? FIXME */ hss_load_firmware()
546 hss_npe_send(port, &msg, "HSS_SET_PKT_IDLE"); hss_load_firmware()
/linux-4.4.14/arch/s390/mm/
H A Dcmm.c363 static void cmm_smsg_target(const char *from, char *msg) cmm_smsg_target() argument
369 if (!cmm_skip_blanks(msg + strlen(SMSG_PREFIX), &msg)) cmm_smsg_target()
371 if (strncmp(msg, "SHRINK", 6) == 0) { cmm_smsg_target()
372 if (!cmm_skip_blanks(msg + 6, &msg)) cmm_smsg_target()
374 nr = simple_strtoul(msg, &msg, 0); cmm_smsg_target()
375 cmm_skip_blanks(msg, &msg); cmm_smsg_target()
376 if (*msg == '\0') cmm_smsg_target()
378 } else if (strncmp(msg, "RELEASE", 7) == 0) { cmm_smsg_target()
379 if (!cmm_skip_blanks(msg + 7, &msg)) cmm_smsg_target()
381 nr = simple_strtoul(msg, &msg, 0); cmm_smsg_target()
382 cmm_skip_blanks(msg, &msg); cmm_smsg_target()
383 if (*msg == '\0') cmm_smsg_target()
385 } else if (strncmp(msg, "REUSE", 5) == 0) { cmm_smsg_target()
386 if (!cmm_skip_blanks(msg + 5, &msg)) cmm_smsg_target()
388 nr = simple_strtoul(msg, &msg, 0); cmm_smsg_target()
389 if (!cmm_skip_blanks(msg, &msg)) cmm_smsg_target()
391 seconds = simple_strtoul(msg, &msg, 0); cmm_smsg_target()
392 cmm_skip_blanks(msg, &msg); cmm_smsg_target()
393 if (*msg == '\0') cmm_smsg_target()
/linux-4.4.14/drivers/misc/mic/scif/
H A Dscif_epd.c116 * @msg: Interrupt message
128 void scif_cnctreq(struct scif_dev *scifdev, struct scifmsg *msg) scif_cnctreq() argument
138 ep = scif_find_listen_ep(msg->dst.port); scif_cnctreq()
151 conreq->msg = *msg; scif_cnctreq()
161 msg->uop = SCIF_CNCT_REJ; scif_cnctreq()
162 scif_nodeqp_send(&scif_dev[msg->src.node], msg); scif_cnctreq()
167 * @msg: Interrupt message
174 void scif_cnctgnt(struct scif_dev *scifdev, struct scifmsg *msg) scif_cnctgnt() argument
176 struct scif_endpt *ep = (struct scif_endpt *)msg->payload[0]; scif_cnctgnt()
180 ep->peer.node = msg->src.node; scif_cnctgnt()
181 ep->peer.port = msg->src.port; scif_cnctgnt()
182 ep->qp_info.gnt_pld = msg->payload[1]; scif_cnctgnt()
183 ep->remote_ep = msg->payload[2]; scif_cnctgnt()
193 * @msg: Interrupt message
199 void scif_cnctgnt_ack(struct scif_dev *scifdev, struct scifmsg *msg) scif_cnctgnt_ack() argument
201 struct scif_endpt *ep = (struct scif_endpt *)msg->payload[0]; scif_cnctgnt_ack()
215 * @msg: Interrupt message
221 void scif_cnctgnt_nack(struct scif_dev *scifdev, struct scifmsg *msg) scif_cnctgnt_nack() argument
223 struct scif_endpt *ep = (struct scif_endpt *)msg->payload[0]; scif_cnctgnt_nack()
233 * @msg: Interrupt message
238 void scif_cnctrej(struct scif_dev *scifdev, struct scifmsg *msg) scif_cnctrej() argument
240 struct scif_endpt *ep = (struct scif_endpt *)msg->payload[0]; scif_cnctrej()
252 * @msg: Interrupt message
263 void scif_discnct(struct scif_dev *scifdev, struct scifmsg *msg) scif_discnct() argument
278 if (((u64)tmpep == msg->payload[1]) && scif_discnct()
279 ((u64)tmpep->remote_ep == msg->payload[0])) { scif_discnct()
307 msg->uop = SCIF_DISCNT_ACK; scif_discnct()
308 scif_nodeqp_send(&scif_dev[msg->src.node], msg); scif_discnct()
313 * @msg: Interrupt message
317 void scif_discnt_ack(struct scif_dev *scifdev, struct scifmsg *msg) scif_discnt_ack() argument
319 struct scif_endpt *ep = (struct scif_endpt *)msg->payload[0]; scif_discnt_ack()
329 * @msg: Interrupt message
333 void scif_clientsend(struct scif_dev *scifdev, struct scifmsg *msg) scif_clientsend() argument
335 struct scif_endpt *ep = (struct scif_endpt *)msg->payload[0]; scif_clientsend()
345 * @msg: Interrupt message
349 void scif_clientrcvd(struct scif_dev *scifdev, struct scifmsg *msg) scif_clientrcvd() argument
351 struct scif_endpt *ep = (struct scif_endpt *)msg->payload[0]; scif_clientrcvd()
H A Dscif_fence.c23 * @msg: Interrupt message
27 void scif_recv_mark(struct scif_dev *scifdev, struct scifmsg *msg) scif_recv_mark() argument
29 struct scif_endpt *ep = (struct scif_endpt *)msg->payload[0]; scif_recv_mark()
34 msg->uop = SCIF_MARK_NACK; scif_recv_mark()
36 msg->uop = SCIF_MARK_ACK; scif_recv_mark()
37 msg->payload[0] = ep->remote_ep; scif_recv_mark()
38 msg->payload[2] = mark; scif_recv_mark()
39 scif_nodeqp_send(ep->remote_dev, msg); scif_recv_mark()
44 * @msg: Interrupt message
48 void scif_recv_mark_resp(struct scif_dev *scifdev, struct scifmsg *msg) scif_recv_mark_resp() argument
50 struct scif_endpt *ep = (struct scif_endpt *)msg->payload[0]; scif_recv_mark_resp()
52 (struct scif_fence_info *)msg->payload[1]; scif_recv_mark_resp()
55 if (msg->uop == SCIF_MARK_ACK) { scif_recv_mark_resp()
57 fence_req->dma_mark = (int)msg->payload[2]; scif_recv_mark_resp()
67 * @msg: Interrupt message
71 void scif_recv_wait(struct scif_dev *scifdev, struct scifmsg *msg) scif_recv_wait() argument
73 struct scif_endpt *ep = (struct scif_endpt *)msg->payload[0]; scif_recv_wait()
83 msg->payload[0] = ep->remote_ep; scif_recv_wait()
84 msg->uop = SCIF_WAIT_NACK; scif_recv_wait()
85 scif_nodeqp_send(ep->remote_dev, msg); scif_recv_wait()
90 memcpy(&fence->msg, msg, sizeof(struct scifmsg)); scif_recv_wait()
104 * @msg: Interrupt message
108 void scif_recv_wait_resp(struct scif_dev *scifdev, struct scifmsg *msg) scif_recv_wait_resp() argument
110 struct scif_endpt *ep = (struct scif_endpt *)msg->payload[0]; scif_recv_wait_resp()
112 (struct scif_fence_info *)msg->payload[1]; scif_recv_wait_resp()
115 if (msg->uop == SCIF_WAIT_ACK) scif_recv_wait_resp()
125 * @msg: Interrupt message
129 void scif_recv_sig_local(struct scif_dev *scifdev, struct scifmsg *msg) scif_recv_sig_local() argument
131 struct scif_endpt *ep = (struct scif_endpt *)msg->payload[0]; scif_recv_sig_local()
134 err = scif_prog_signal(ep, msg->payload[1], msg->payload[2], scif_recv_sig_local()
137 msg->uop = SCIF_SIG_NACK; scif_recv_sig_local()
139 msg->uop = SCIF_SIG_ACK; scif_recv_sig_local()
140 msg->payload[0] = ep->remote_ep; scif_recv_sig_local()
141 scif_nodeqp_send(ep->remote_dev, msg); scif_recv_sig_local()
146 * @msg: Interrupt message
150 void scif_recv_sig_remote(struct scif_dev *scifdev, struct scifmsg *msg) scif_recv_sig_remote() argument
152 struct scif_endpt *ep = (struct scif_endpt *)msg->payload[0]; scif_recv_sig_remote()
155 err = scif_prog_signal(ep, msg->payload[1], msg->payload[2], scif_recv_sig_remote()
158 msg->uop = SCIF_SIG_NACK; scif_recv_sig_remote()
160 msg->uop = SCIF_SIG_ACK; scif_recv_sig_remote()
161 msg->payload[0] = ep->remote_ep; scif_recv_sig_remote()
162 scif_nodeqp_send(ep->remote_dev, msg); scif_recv_sig_remote()
167 * @msg: Interrupt message
171 void scif_recv_sig_resp(struct scif_dev *scifdev, struct scifmsg *msg) scif_recv_sig_resp() argument
173 struct scif_endpt *ep = (struct scif_endpt *)msg->payload[0]; scif_recv_sig_resp()
175 (struct scif_fence_info *)msg->payload[3]; scif_recv_sig_resp()
178 if (msg->uop == SCIF_SIG_ACK) scif_recv_sig_resp()
376 ep = (struct scif_endpt *)fence->msg.payload[0]; scif_rma_handle_remote_fences()
377 mark = fence->msg.payload[2]; scif_rma_handle_remote_fences()
380 fence->msg.uop = SCIF_WAIT_NACK; scif_rma_handle_remote_fences()
382 fence->msg.uop = SCIF_WAIT_ACK; scif_rma_handle_remote_fences()
383 fence->msg.payload[0] = ep->remote_ep; scif_rma_handle_remote_fences()
384 scif_nodeqp_send(ep->remote_dev, &fence->msg); scif_rma_handle_remote_fences()
395 struct scifmsg msg; _scif_send_fence() local
408 msg.src = ep->port; _scif_send_fence()
409 msg.uop = uop; _scif_send_fence()
410 msg.payload[0] = ep->remote_ep; _scif_send_fence()
411 msg.payload[1] = (u64)fence_req; _scif_send_fence()
413 msg.payload[2] = mark; _scif_send_fence()
416 err = scif_nodeqp_send(ep->remote_dev, &msg); _scif_send_fence()
513 struct scifmsg msg; scif_send_fence_signal() local
525 msg.src = ep->port; scif_send_fence_signal()
527 msg.uop = SCIF_SIG_LOCAL; scif_send_fence_signal()
528 msg.payload[0] = ep->remote_ep; scif_send_fence_signal()
529 msg.payload[1] = roff; scif_send_fence_signal()
530 msg.payload[2] = rval; scif_send_fence_signal()
531 msg.payload[3] = (u64)fence_req; scif_send_fence_signal()
534 err = scif_nodeqp_send(ep->remote_dev, &msg); scif_send_fence_signal()
547 msg.uop = SCIF_SIG_REMOTE; scif_send_fence_signal()
548 msg.payload[0] = ep->remote_ep; scif_send_fence_signal()
549 msg.payload[1] = loff; scif_send_fence_signal()
550 msg.payload[2] = lval; scif_send_fence_signal()
551 msg.payload[3] = (u64)fence_req; scif_send_fence_signal()
554 err = scif_nodeqp_send(ep->remote_dev, &msg); scif_send_fence_signal()
H A Dscif_nodeqp.c298 struct scifmsg msg; scif_qp_response() local
306 msg.uop = SCIF_INIT; scif_qp_response()
307 msg.dst.node = scifdev->node; scif_qp_response()
308 err = scif_nodeqp_send(scifdev, &msg); scif_qp_response()
315 struct scifmsg msg; scif_send_exit() local
319 msg.uop = SCIF_EXIT; scif_send_exit()
320 msg.src.node = scif_info.nodeid; scif_send_exit()
321 msg.dst.node = scifdev->node; scif_send_exit()
322 ret = scif_nodeqp_send(scifdev, &msg); scif_send_exit()
468 struct scifmsg msg; scif_node_connect() local
506 msg.uop = SCIF_NODE_ADD; scif_node_connect()
507 msg.src.node = dev_j->node; scif_node_connect()
508 msg.dst.node = dev_i->node; scif_node_connect()
510 msg.payload[0] = p2p_ji->ppi_da[SCIF_PPI_APER]; scif_node_connect()
511 msg.payload[1] = p2p_ij->ppi_da[SCIF_PPI_MMIO]; scif_node_connect()
512 msg.payload[2] = p2p_ij->ppi_da[SCIF_PPI_APER]; scif_node_connect()
513 msg.payload[3] = p2p_ij->ppi_len[SCIF_PPI_APER] << PAGE_SHIFT; scif_node_connect()
515 err = scif_nodeqp_send(dev_i, &msg); scif_node_connect()
523 msg.uop = SCIF_NODE_ADD; scif_node_connect()
524 msg.src.node = dev_i->node; scif_node_connect()
525 msg.dst.node = dev_j->node; scif_node_connect()
527 tmppayload = msg.payload[0]; scif_node_connect()
528 msg.payload[0] = msg.payload[2]; scif_node_connect()
529 msg.payload[2] = tmppayload; scif_node_connect()
530 msg.payload[1] = p2p_ji->ppi_da[SCIF_PPI_MMIO]; scif_node_connect()
531 msg.payload[3] = p2p_ji->ppi_len[SCIF_PPI_APER] << PAGE_SHIFT; scif_node_connect()
533 scif_nodeqp_send(dev_j, &msg); scif_node_connect()
601 scif_display_message(struct scif_dev *scifdev, struct scifmsg *msg, scif_display_message() argument
606 if (msg->uop > SCIF_MAX_MSG) { scif_display_message()
608 "%s: unknown msg type %d\n", label, msg->uop); scif_display_message()
612 "%s: msg type %s, src %d:%d, dest %d:%d payload 0x%llx:0x%llx:0x%llx:0x%llx\n", scif_display_message()
613 label, message_types[msg->uop], msg->src.node, msg->src.port, scif_display_message()
614 msg->dst.node, msg->dst.port, msg->payload[0], msg->payload[1], scif_display_message()
615 msg->payload[2], msg->payload[3]); scif_display_message()
618 int _scif_nodeqp_send(struct scif_dev *scifdev, struct scifmsg *msg) _scif_nodeqp_send() argument
623 scif_display_message(scifdev, msg, "Sent"); _scif_nodeqp_send()
631 msg, sizeof(struct scifmsg)))) { _scif_nodeqp_send()
657 __func__, __LINE__, err, msg->uop); _scif_nodeqp_send()
664 * @msg: The message to be sent.
666 int scif_nodeqp_send(struct scif_dev *scifdev, struct scifmsg *msg) scif_nodeqp_send() argument
671 if (msg->uop > SCIF_EXIT_ACK) { scif_nodeqp_send()
681 err = _scif_nodeqp_send(scifdev, msg); scif_nodeqp_send()
682 if (msg->uop > SCIF_EXIT_ACK) scif_nodeqp_send()
708 * @msg: Interrupt message
711 scif_init(struct scif_dev *scifdev, struct scifmsg *msg) scif_init() argument
731 * @msg: Interrupt message
752 * @msg: Interrupt message
765 * @msg: Interrupt message
777 scif_node_add(struct scif_dev *scifdev, struct scifmsg *msg) scif_node_add() argument
785 "Scifdev %d:%d received NODE_ADD msg for node %d\n", scif_node_add()
786 scifdev->node, msg->dst.node, msg->src.node); scif_node_add()
789 msg->payload[0]); scif_node_add()
790 newdev = &scif_dev[msg->src.node]; scif_node_add()
791 newdev->node = msg->src.node; scif_node_add()
797 "failed to setup interrupts for %d\n", msg->src.node); scif_node_add()
800 newdev->mmio.va = ioremap_nocache(msg->payload[1], sdev->mmio->len); scif_node_add()
803 "failed to map mmio for %d\n", msg->src.node); scif_node_add()
813 newdev->base_addr = msg->payload[0]; scif_node_add()
832 msg->uop = SCIF_NODE_ADD_ACK; scif_node_add()
833 msg->dst.node = msg->src.node; scif_node_add()
834 msg->src.node = scif_info.nodeid; scif_node_add()
835 msg->payload[0] = qp_offset; scif_node_add()
836 msg->payload[2] = newdev->db; scif_node_add()
837 scif_nodeqp_send(&scif_dev[SCIF_MGMT_NODE], msg); scif_node_add()
848 "node add failed for node %d\n", msg->src.node); scif_node_add()
849 msg->uop = SCIF_NODE_ADD_NACK; scif_node_add()
850 msg->dst.node = msg->src.node; scif_node_add()
851 msg->src.node = scif_info.nodeid; scif_node_add()
852 scif_nodeqp_send(&scif_dev[SCIF_MGMT_NODE], msg); scif_node_add()
888 * @msg: Interrupt message
895 scif_node_add_ack(struct scif_dev *scifdev, struct scifmsg *msg) scif_node_add_ack() argument
899 struct scif_dev *dst_dev = &scif_dev[msg->dst.node]; scif_node_add_ack()
902 "Scifdev %d received SCIF_NODE_ADD_ACK msg src %d dst %d\n", scif_node_add_ack()
903 scifdev->node, msg->src.node, msg->dst.node); scif_node_add_ack()
905 "payload %llx %llx %llx %llx\n", msg->payload[0], scif_node_add_ack()
906 msg->payload[1], msg->payload[2], msg->payload[3]); scif_node_add_ack()
915 msg->payload[1] = scif_info.maxid; scif_node_add_ack()
916 scif_nodeqp_send(dst_dev, msg); scif_node_add_ack()
920 peerdev = &scif_dev[msg->src.node]; scif_node_add_ack()
922 peerdev->node = msg->src.node; scif_node_add_ack()
927 msg->payload[0]))) scif_node_add_ack()
929 peerdev->rdb = msg->payload[2]; scif_node_add_ack()
942 * @msg: Interrupt message
947 scif_node_add_nack(struct scif_dev *scifdev, struct scifmsg *msg) scif_node_add_nack() argument
950 struct scif_dev *dst_dev = &scif_dev[msg->dst.node]; scif_node_add_nack()
954 scif_nodeqp_send(dst_dev, msg); scif_node_add_nack()
960 * @msg: Interrupt message
965 scif_node_remove(struct scif_dev *scifdev, struct scifmsg *msg) scif_node_remove() argument
967 int node = msg->payload[0]; scif_node_remove()
976 * @msg: Interrupt message
981 scif_node_remove_ack(struct scif_dev *scifdev, struct scifmsg *msg) scif_node_remove_ack() argument
983 struct scif_dev *sdev = &scif_dev[msg->payload[0]]; scif_node_remove_ack()
991 * @msg: Interrupt message
996 scif_get_node_info_resp(struct scif_dev *scifdev, struct scifmsg *msg) scif_get_node_info_resp() argument
999 swap(msg->dst.node, msg->src.node); scif_get_node_info_resp()
1001 msg->payload[1] = scif_info.maxid; scif_get_node_info_resp()
1002 msg->payload[2] = scif_info.total; scif_get_node_info_resp()
1004 scif_nodeqp_send(scifdev, msg); scif_get_node_info_resp()
1007 (struct completion *)msg->payload[3]; scif_get_node_info_resp()
1010 scif_info.maxid = msg->payload[1]; scif_get_node_info_resp()
1011 scif_info.total = msg->payload[2]; scif_get_node_info_resp()
1018 scif_msg_unknown(struct scif_dev *scifdev, struct scifmsg *msg) scif_msg_unknown() argument
1023 msg->uop, scifdev->node); scif_msg_unknown()
1027 (struct scif_dev *, struct scifmsg *msg) = {
1074 * @msg: The message to be handled.
1083 struct scif_qp *qp, struct scifmsg *msg) scif_nodeqp_msg_handler()
1085 scif_display_message(scifdev, msg, "Rcvd"); scif_nodeqp_msg_handler()
1087 if (msg->uop > (u32)scif_max_msg_id) { scif_nodeqp_msg_handler()
1091 msg->uop, scifdev->node); scif_nodeqp_msg_handler()
1095 scif_intr_func[msg->uop](scifdev, msg); scif_nodeqp_msg_handler()
1109 struct scifmsg msg; scif_nodeqp_intrhandler() local
1113 read_size = scif_rb_get_next(&qp->inbound_q, &msg, sizeof(msg)); scif_nodeqp_intrhandler()
1116 scif_nodeqp_msg_handler(scifdev, qp, &msg); scif_nodeqp_intrhandler()
1121 if (SCIF_EXIT_ACK == msg.uop) scif_nodeqp_intrhandler()
1141 struct scif_loopb_msg *msg; scif_loopb_wq_handler() local
1144 msg = NULL; scif_loopb_wq_handler()
1147 msg = list_first_entry(&scif_info.loopb_recv_q, scif_loopb_wq_handler()
1150 list_del(&msg->list); scif_loopb_wq_handler()
1154 if (msg) { scif_loopb_wq_handler()
1155 scif_nodeqp_msg_handler(scifdev, qp, &msg->msg); scif_loopb_wq_handler()
1156 kfree(msg); scif_loopb_wq_handler()
1158 } while (msg); scif_loopb_wq_handler()
1197 struct scif_loopb_msg *msg; scif_loopb_msg_handler() local
1200 msg = kmalloc(sizeof(*msg), GFP_KERNEL); scif_loopb_msg_handler()
1201 if (!msg) scif_loopb_msg_handler()
1203 read_size = scif_rb_get_next(&qp->inbound_q, &msg->msg, scif_loopb_msg_handler()
1206 kfree(msg); scif_loopb_msg_handler()
1211 list_add_tail(&msg->list, &scif_info.loopb_recv_q); scif_loopb_msg_handler()
1082 scif_nodeqp_msg_handler(struct scif_dev *scifdev, struct scif_qp *qp, struct scifmsg *msg) scif_nodeqp_msg_handler() argument
H A Dscif_nm.c92 struct scifmsg msg; scif_send_acks() local
95 msg.uop = SCIF_NODE_REMOVE_ACK; scif_send_acks()
96 msg.src.node = scif_info.nodeid; scif_send_acks()
97 msg.dst.node = SCIF_MGMT_NODE; scif_send_acks()
98 msg.payload[0] = dev->node; scif_send_acks()
99 scif_nodeqp_send(&scif_dev[SCIF_MGMT_NODE], &msg); scif_send_acks()
103 msg.uop = SCIF_EXIT_ACK; scif_send_acks()
104 msg.src.node = scif_info.nodeid; scif_send_acks()
105 msg.dst.node = dev->node; scif_send_acks()
106 scif_nodeqp_send(dev, &msg); scif_send_acks()
224 struct scifmsg msg; scif_get_node_info() local
227 msg.uop = SCIF_GET_NODE_INFO; scif_get_node_info()
228 msg.src.node = scif_info.nodeid; scif_get_node_info()
229 msg.dst.node = SCIF_MGMT_NODE; scif_get_node_info()
230 msg.payload[3] = (u64)&node_info; scif_get_node_info()
232 if ((scif_nodeqp_send(&scif_dev[SCIF_MGMT_NODE], &msg))) scif_get_node_info()
H A Dscif_rma.c197 struct scifmsg msg; scif_destroy_incomplete_window() local
209 msg.uop = SCIF_FREE_VIRT; scif_destroy_incomplete_window()
210 msg.src = ep->port; scif_destroy_incomplete_window()
211 msg.payload[0] = ep->remote_ep; scif_destroy_incomplete_window()
212 msg.payload[1] = window->alloc_handle.vaddr; scif_destroy_incomplete_window()
213 msg.payload[2] = (u64)window; scif_destroy_incomplete_window()
214 msg.payload[3] = SCIF_REGISTER; scif_destroy_incomplete_window()
215 _scif_nodeqp_send(ep->remote_dev, &msg); scif_destroy_incomplete_window()
646 struct scifmsg msg; scif_send_scif_unregister() local
648 msg.uop = SCIF_UNREGISTER; scif_send_scif_unregister()
649 msg.src = ep->port; scif_send_scif_unregister()
650 msg.payload[0] = window->alloc_handle.vaddr; scif_send_scif_unregister()
651 msg.payload[1] = (u64)window; scif_send_scif_unregister()
652 return scif_nodeqp_send(ep->remote_dev, &msg); scif_send_scif_unregister()
759 struct scifmsg msg; scif_send_alloc_request() local
767 msg.uop = SCIF_ALLOC_REQ; scif_send_alloc_request()
768 msg.payload[1] = window->nr_pages; scif_send_alloc_request()
769 msg.payload[2] = (u64)&window->alloc_handle; scif_send_alloc_request()
770 return _scif_nodeqp_send(ep->remote_dev, &msg); scif_send_alloc_request()
784 struct scifmsg msg; scif_prep_remote_window() local
825 msg.uop = SCIF_FREE_VIRT; scif_prep_remote_window()
826 msg.src = ep->port; scif_prep_remote_window()
827 msg.payload[0] = ep->remote_ep; scif_prep_remote_window()
828 msg.payload[1] = window->alloc_handle.vaddr; scif_prep_remote_window()
829 msg.payload[2] = (u64)window; scif_prep_remote_window()
830 msg.payload[3] = SCIF_REGISTER; scif_prep_remote_window()
833 err = _scif_nodeqp_send(ep->remote_dev, &msg); scif_prep_remote_window()
962 struct scifmsg msg; scif_send_scif_register() local
964 msg.src = ep->port; scif_send_scif_register()
965 msg.payload[0] = ep->remote_ep; scif_send_scif_register()
966 msg.payload[1] = window->alloc_handle.vaddr; scif_send_scif_register()
967 msg.payload[2] = (u64)window; scif_send_scif_register()
970 msg.uop = SCIF_REGISTER; scif_send_scif_register()
972 err = _scif_nodeqp_send(ep->remote_dev, &msg); scif_send_scif_register()
988 msg.uop = SCIF_FREE_VIRT; scif_send_scif_register()
989 msg.payload[3] = SCIF_REGISTER; scif_send_scif_register()
990 err = _scif_nodeqp_send(ep->remote_dev, &msg); scif_send_scif_register()
1053 * @msg: Interrupt message
1057 void scif_alloc_req(struct scif_dev *scifdev, struct scifmsg *msg) scif_alloc_req() argument
1061 int nr_pages = msg->payload[1]; scif_alloc_req()
1070 msg->uop = SCIF_ALLOC_GNT; scif_alloc_req()
1071 msg->payload[0] = (u64)window; scif_alloc_req()
1072 msg->payload[1] = window->mapped_offset; scif_alloc_req()
1073 err = scif_nodeqp_send(scifdev, msg); scif_alloc_req()
1082 msg->uop = SCIF_ALLOC_REJ; scif_alloc_req()
1083 scif_nodeqp_send(scifdev, msg); scif_alloc_req()
1088 * @msg: Interrupt message
1092 void scif_alloc_gnt_rej(struct scif_dev *scifdev, struct scifmsg *msg) scif_alloc_gnt_rej() argument
1094 struct scif_allocmsg *handle = (struct scif_allocmsg *)msg->payload[2]; scif_alloc_gnt_rej()
1100 handle->vaddr = msg->payload[0]; scif_alloc_gnt_rej()
1101 handle->phys_addr = msg->payload[1]; scif_alloc_gnt_rej()
1102 if (msg->uop == SCIF_ALLOC_GNT) scif_alloc_gnt_rej()
1112 * @msg: Interrupt message
1116 void scif_free_virt(struct scif_dev *scifdev, struct scifmsg *msg) scif_free_virt() argument
1118 struct scif_window *window = (struct scif_window *)msg->payload[1]; scif_free_virt()
1150 * @msg: Interrupt message
1154 void scif_recv_reg(struct scif_dev *scifdev, struct scifmsg *msg) scif_recv_reg() argument
1156 struct scif_endpt *ep = (struct scif_endpt *)msg->payload[0]; scif_recv_reg()
1158 (struct scif_window *)msg->payload[1]; scif_recv_reg()
1163 msg->uop = SCIF_REGISTER_ACK; scif_recv_reg()
1164 scif_nodeqp_send(ep->remote_dev, msg); scif_recv_reg()
1169 msg->uop = SCIF_REGISTER_NACK; scif_recv_reg()
1170 scif_nodeqp_send(ep->remote_dev, msg); scif_recv_reg()
1180 if (msg->uop == SCIF_REGISTER_NACK) scif_recv_reg()
1186 * @msg: Interrupt message
1190 void scif_recv_unreg(struct scif_dev *scifdev, struct scifmsg *msg) scif_recv_unreg() argument
1195 (struct scif_window *)msg->payload[0]; scif_recv_unreg()
1206 msg->payload[0] = ep->remote_ep; scif_recv_unreg()
1213 msg->uop = SCIF_UNREGISTER_ACK; scif_recv_unreg()
1225 msg->uop = SCIF_UNREGISTER_ACK; scif_recv_unreg()
1232 msg->uop = SCIF_UNREGISTER_NACK; scif_recv_unreg()
1236 msg->uop = SCIF_UNREGISTER_ACK; scif_recv_unreg()
1244 scif_nodeqp_send(ep->remote_dev, msg); scif_recv_unreg()
1251 * @msg: Interrupt message
1255 void scif_recv_reg_ack(struct scif_dev *scifdev, struct scifmsg *msg) scif_recv_reg_ack() argument
1258 (struct scif_window *)msg->payload[2]; scif_recv_reg_ack()
1269 * @msg: Interrupt message
1274 void scif_recv_reg_nack(struct scif_dev *scifdev, struct scifmsg *msg) scif_recv_reg_nack() argument
1277 (struct scif_window *)msg->payload[2]; scif_recv_reg_nack()
1288 * @msg: Interrupt message
1292 void scif_recv_unreg_ack(struct scif_dev *scifdev, struct scifmsg *msg) scif_recv_unreg_ack() argument
1295 (struct scif_window *)msg->payload[1]; scif_recv_unreg_ack()
1306 * @msg: Interrupt message
1311 void scif_recv_unreg_nack(struct scif_dev *scifdev, struct scifmsg *msg) scif_recv_unreg_nack() argument
1314 (struct scif_window *)msg->payload[1]; scif_recv_unreg_nack()
/linux-4.4.14/drivers/media/pci/pt1/
H A Dva1j5jf8007s.c179 struct i2c_msg msg; va1j5jf8007s_set_frequency_1() local
194 msg.addr = state->config->demod_address; va1j5jf8007s_set_frequency_1()
195 msg.flags = 0; va1j5jf8007s_set_frequency_1()
196 msg.len = sizeof(buf); va1j5jf8007s_set_frequency_1()
197 msg.buf = buf; va1j5jf8007s_set_frequency_1()
199 if (i2c_transfer(state->adap, &msg, 1) != 1) va1j5jf8007s_set_frequency_1()
208 struct i2c_msg msg; va1j5jf8007s_set_frequency_2() local
214 msg.addr = state->config->demod_address; va1j5jf8007s_set_frequency_2()
215 msg.flags = 0; va1j5jf8007s_set_frequency_2()
216 msg.len = sizeof(buf); va1j5jf8007s_set_frequency_2()
217 msg.buf = buf; va1j5jf8007s_set_frequency_2()
219 if (i2c_transfer(state->adap, &msg, 1) != 1) va1j5jf8007s_set_frequency_2()
229 struct i2c_msg msg; va1j5jf8007s_set_frequency_3() local
238 msg.addr = state->config->demod_address; va1j5jf8007s_set_frequency_3()
239 msg.flags = 0; va1j5jf8007s_set_frequency_3()
240 msg.len = sizeof(buf); va1j5jf8007s_set_frequency_3()
241 msg.buf = buf; va1j5jf8007s_set_frequency_3()
243 if (i2c_transfer(state->adap, &msg, 1) != 1) va1j5jf8007s_set_frequency_3()
281 struct i2c_msg msg; va1j5jf8007s_set_modulation() local
286 msg.addr = state->config->demod_address; va1j5jf8007s_set_modulation()
287 msg.flags = 0; va1j5jf8007s_set_modulation()
288 msg.len = sizeof(buf); va1j5jf8007s_set_modulation()
289 msg.buf = buf; va1j5jf8007s_set_modulation()
291 if (i2c_transfer(state->adap, &msg, 1) != 1) va1j5jf8007s_set_modulation()
330 struct i2c_msg msg; va1j5jf8007s_set_ts_id() local
340 msg.addr = state->config->demod_address; va1j5jf8007s_set_ts_id()
341 msg.flags = 0; va1j5jf8007s_set_ts_id()
342 msg.len = sizeof(buf); va1j5jf8007s_set_ts_id()
343 msg.buf = buf; va1j5jf8007s_set_ts_id()
345 if (i2c_transfer(state->adap, &msg, 1) != 1) va1j5jf8007s_set_ts_id()
513 struct i2c_msg msg; va1j5jf8007s_init_frequency() local
520 msg.addr = state->config->demod_address; va1j5jf8007s_init_frequency()
521 msg.flags = 0; va1j5jf8007s_init_frequency()
522 msg.len = sizeof(buf); va1j5jf8007s_init_frequency()
523 msg.buf = buf; va1j5jf8007s_init_frequency()
525 if (i2c_transfer(state->adap, &msg, 1) != 1) va1j5jf8007s_init_frequency()
534 struct i2c_msg msg; va1j5jf8007s_set_sleep() local
539 msg.addr = state->config->demod_address; va1j5jf8007s_set_sleep()
540 msg.flags = 0; va1j5jf8007s_set_sleep()
541 msg.len = sizeof(buf); va1j5jf8007s_set_sleep()
542 msg.buf = buf; va1j5jf8007s_set_sleep()
544 if (i2c_transfer(state->adap, &msg, 1) != 1) va1j5jf8007s_set_sleep()
652 struct i2c_msg msg; va1j5jf8007s_prepare_2() local
670 msg.addr = addr; va1j5jf8007s_prepare_2()
671 msg.flags = 0; va1j5jf8007s_prepare_2()
672 msg.len = 2; va1j5jf8007s_prepare_2()
673 msg.buf = buf; va1j5jf8007s_prepare_2()
676 if (i2c_transfer(state->adap, &msg, 1) != 1) va1j5jf8007s_prepare_2()
709 struct i2c_msg msg; va1j5jf8007s_attach() local
725 msg.addr = state->config->demod_address; va1j5jf8007s_attach()
726 msg.flags = 0; va1j5jf8007s_attach()
727 msg.len = sizeof(buf); va1j5jf8007s_attach()
728 msg.buf = buf; va1j5jf8007s_attach()
730 if (i2c_transfer(state->adap, &msg, 1) != 1) { va1j5jf8007s_attach()
H A Dva1j5jf8007t.c165 struct i2c_msg msg; va1j5jf8007t_set_frequency() local
177 msg.addr = state->config->demod_address; va1j5jf8007t_set_frequency()
178 msg.flags = 0; va1j5jf8007t_set_frequency()
179 msg.len = sizeof(buf); va1j5jf8007t_set_frequency()
180 msg.buf = buf; va1j5jf8007t_set_frequency()
182 if (i2c_transfer(state->adap, &msg, 1) != 1) va1j5jf8007t_set_frequency()
220 struct i2c_msg msg; va1j5jf8007t_set_modulation() local
225 msg.addr = state->config->demod_address; va1j5jf8007t_set_modulation()
226 msg.flags = 0; va1j5jf8007t_set_modulation()
227 msg.len = sizeof(buf); va1j5jf8007t_set_modulation()
228 msg.buf = buf; va1j5jf8007t_set_modulation()
230 if (i2c_transfer(state->adap, &msg, 1) != 1) va1j5jf8007t_set_modulation()
359 struct i2c_msg msg; va1j5jf8007t_init_frequency() local
369 msg.addr = state->config->demod_address; va1j5jf8007t_init_frequency()
370 msg.flags = 0; va1j5jf8007t_init_frequency()
371 msg.len = sizeof(buf); va1j5jf8007t_init_frequency()
372 msg.buf = buf; va1j5jf8007t_init_frequency()
374 if (i2c_transfer(state->adap, &msg, 1) != 1) va1j5jf8007t_init_frequency()
383 struct i2c_msg msg; va1j5jf8007t_set_sleep() local
388 msg.addr = state->config->demod_address; va1j5jf8007t_set_sleep()
389 msg.flags = 0; va1j5jf8007t_set_sleep()
390 msg.len = sizeof(buf); va1j5jf8007t_set_sleep()
391 msg.buf = buf; va1j5jf8007t_set_sleep()
393 if (i2c_transfer(state->adap, &msg, 1) != 1) va1j5jf8007t_set_sleep()
470 struct i2c_msg msg; va1j5jf8007t_prepare() local
488 msg.addr = state->config->demod_address; va1j5jf8007t_prepare()
489 msg.flags = 0; va1j5jf8007t_prepare()
490 msg.len = sizeof(buf); va1j5jf8007t_prepare()
491 msg.buf = buf; va1j5jf8007t_prepare()
495 if (i2c_transfer(state->adap, &msg, 1) != 1) va1j5jf8007t_prepare()
509 struct i2c_msg msg; va1j5jf8007t_attach() local
525 msg.addr = state->config->demod_address; va1j5jf8007t_attach()
526 msg.flags = 0; va1j5jf8007t_attach()
527 msg.len = sizeof(buf); va1j5jf8007t_attach()
528 msg.buf = buf; va1j5jf8007t_attach()
530 if (i2c_transfer(state->adap, &msg, 1) != 1) { va1j5jf8007t_attach()
/linux-4.4.14/drivers/gpu/drm/msm/edp/
H A Dedp_aux.c41 static int edp_msg_fifo_tx(struct edp_aux *aux, struct drm_dp_aux_msg *msg) edp_msg_fifo_tx() argument
45 bool native = msg->request & (DP_AUX_NATIVE_WRITE & DP_AUX_NATIVE_READ); edp_msg_fifo_tx()
46 bool read = msg->request & (DP_AUX_I2C_READ & DP_AUX_NATIVE_READ); edp_msg_fifo_tx()
47 u8 *msgdata = msg->buffer; edp_msg_fifo_tx()
53 len = msg->size + 4; edp_msg_fifo_tx()
62 data[0] = (msg->address >> 16) & 0xf; /* addr[19:16] */ edp_msg_fifo_tx()
66 data[1] = (msg->address >> 8) & 0xff; /* addr[15:8] */ edp_msg_fifo_tx()
67 data[2] = msg->address & 0xff; /* addr[7:0] */ edp_msg_fifo_tx()
68 data[3] = (msg->size - 1) & 0xff; /* len[7:0] */ edp_msg_fifo_tx()
88 static int edp_msg_fifo_rx(struct edp_aux *aux, struct drm_dp_aux_msg *msg) edp_msg_fifo_rx() argument
93 u32 len = msg->size; edp_msg_fifo_rx()
98 dp = msg->buffer; edp_msg_fifo_rx()
119 struct drm_dp_aux_msg *msg) edp_aux_transfer()
124 bool native = msg->request & (DP_AUX_NATIVE_WRITE & DP_AUX_NATIVE_READ); edp_aux_transfer()
125 bool read = msg->request & (DP_AUX_I2C_READ & DP_AUX_NATIVE_READ); edp_aux_transfer()
128 if ((msg->size == 0) || (msg->buffer == NULL)) { edp_aux_transfer()
129 msg->reply = native ? edp_aux_transfer()
131 return msg->size; edp_aux_transfer()
134 /* msg sanity check */ edp_aux_transfer()
135 if ((native && (msg->size > AUX_CMD_NATIVE_MAX)) || edp_aux_transfer()
136 (msg->size > AUX_CMD_I2C_MAX)) { edp_aux_transfer()
137 pr_err("%s: invalid msg: size(%zu), request(%x)\n", edp_aux_transfer()
138 __func__, msg->size, msg->request); edp_aux_transfer()
147 ret = edp_msg_fifo_tx(aux, msg); edp_aux_transfer()
169 ret = edp_msg_fifo_rx(aux, msg); edp_aux_transfer()
174 msg->reply = native ? edp_aux_transfer()
178 msg->reply = native ? edp_aux_transfer()
188 ret = msg->size; edp_aux_transfer()
118 edp_aux_transfer(struct drm_dp_aux *drm_aux, struct drm_dp_aux_msg *msg) edp_aux_transfer() argument
/linux-4.4.14/drivers/video/fbdev/
H A Dhyperv_fb.c241 struct synthvid_msg *msg) synthvid_send()
246 msg->pipe_hdr.type = PIPE_MSG_DATA; synthvid_send()
247 msg->pipe_hdr.size = msg->vid_hdr.size; synthvid_send()
249 ret = vmbus_sendpacket(hdev->channel, msg, synthvid_send()
250 msg->vid_hdr.size + sizeof(struct pipe_msg_hdr), synthvid_send()
265 struct synthvid_msg msg; synthvid_send_situ() local
270 memset(&msg, 0, sizeof(struct synthvid_msg)); synthvid_send_situ()
272 msg.vid_hdr.type = SYNTHVID_SITUATION_UPDATE; synthvid_send_situ()
273 msg.vid_hdr.size = sizeof(struct synthvid_msg_hdr) + synthvid_send_situ()
275 msg.situ.user_ctx = 0; synthvid_send_situ()
276 msg.situ.video_output_count = 1; synthvid_send_situ()
277 msg.situ.video_output[0].active = 1; synthvid_send_situ()
278 msg.situ.video_output[0].vram_offset = 0; synthvid_send_situ()
279 msg.situ.video_output[0].depth_bits = info->var.bits_per_pixel; synthvid_send_situ()
280 msg.situ.video_output[0].width_pixels = info->var.xres; synthvid_send_situ()
281 msg.situ.video_output[0].height_pixels = info->var.yres; synthvid_send_situ()
282 msg.situ.video_output[0].pitch_bytes = info->fix.line_length; synthvid_send_situ()
284 synthvid_send(hdev, &msg); synthvid_send_situ()
292 struct synthvid_msg msg; synthvid_send_ptr() local
294 memset(&msg, 0, sizeof(struct synthvid_msg)); synthvid_send_ptr()
295 msg.vid_hdr.type = SYNTHVID_POINTER_POSITION; synthvid_send_ptr()
296 msg.vid_hdr.size = sizeof(struct synthvid_msg_hdr) + synthvid_send_ptr()
298 msg.ptr_pos.is_visible = 1; synthvid_send_ptr()
299 msg.ptr_pos.video_output = 0; synthvid_send_ptr()
300 msg.ptr_pos.image_x = 0; synthvid_send_ptr()
301 msg.ptr_pos.image_y = 0; synthvid_send_ptr()
302 synthvid_send(hdev, &msg); synthvid_send_ptr()
304 memset(&msg, 0, sizeof(struct synthvid_msg)); synthvid_send_ptr()
305 msg.vid_hdr.type = SYNTHVID_POINTER_SHAPE; synthvid_send_ptr()
306 msg.vid_hdr.size = sizeof(struct synthvid_msg_hdr) + synthvid_send_ptr()
308 msg.ptr_shape.part_idx = CURSOR_COMPLETE; synthvid_send_ptr()
309 msg.ptr_shape.is_argb = 1; synthvid_send_ptr()
310 msg.ptr_shape.width = 1; synthvid_send_ptr()
311 msg.ptr_shape.height = 1; synthvid_send_ptr()
312 msg.ptr_shape.hot_x = 0; synthvid_send_ptr()
313 msg.ptr_shape.hot_y = 0; synthvid_send_ptr()
314 msg.ptr_shape.data[0] = 0; synthvid_send_ptr()
315 msg.ptr_shape.data[1] = 1; synthvid_send_ptr()
316 msg.ptr_shape.data[2] = 1; synthvid_send_ptr()
317 msg.ptr_shape.data[3] = 1; synthvid_send_ptr()
318 synthvid_send(hdev, &msg); synthvid_send_ptr()
327 struct synthvid_msg msg; synthvid_update() local
329 memset(&msg, 0, sizeof(struct synthvid_msg)); synthvid_update()
331 msg.vid_hdr.type = SYNTHVID_DIRT; synthvid_update()
332 msg.vid_hdr.size = sizeof(struct synthvid_msg_hdr) + synthvid_update()
334 msg.dirt.video_output = 0; synthvid_update()
335 msg.dirt.dirt_count = 1; synthvid_update()
336 msg.dirt.rect[0].x1 = 0; synthvid_update()
337 msg.dirt.rect[0].y1 = 0; synthvid_update()
338 msg.dirt.rect[0].x2 = info->var.xres; synthvid_update()
339 msg.dirt.rect[0].y2 = info->var.yres; synthvid_update()
341 synthvid_send(hdev, &msg); synthvid_update()
356 struct synthvid_msg *msg; synthvid_recv_sub() local
362 msg = (struct synthvid_msg *)par->recv_buf; synthvid_recv_sub()
365 if (msg->vid_hdr.type == SYNTHVID_VERSION_RESPONSE || synthvid_recv_sub()
366 msg->vid_hdr.type == SYNTHVID_VRAM_LOCATION_ACK) { synthvid_recv_sub()
367 memcpy(par->init_buf, msg, MAX_VMBUS_PKT_SIZE); synthvid_recv_sub()
373 if (msg->vid_hdr.type == SYNTHVID_FEATURE_CHANGE) { synthvid_recv_sub()
379 par->update = msg->feature_chg.is_dirt_needed; synthvid_recv_sub()
417 struct synthvid_msg *msg = (struct synthvid_msg *)par->init_buf; synthvid_negotiate_ver() local
421 memset(msg, 0, sizeof(struct synthvid_msg)); synthvid_negotiate_ver()
422 msg->vid_hdr.type = SYNTHVID_VERSION_REQUEST; synthvid_negotiate_ver()
423 msg->vid_hdr.size = sizeof(struct synthvid_msg_hdr) + synthvid_negotiate_ver()
425 msg->ver_req.version = ver; synthvid_negotiate_ver()
426 synthvid_send(hdev, msg); synthvid_negotiate_ver()
434 if (!msg->ver_resp.is_accepted) { synthvid_negotiate_ver()
491 struct synthvid_msg *msg = (struct synthvid_msg *)par->init_buf; synthvid_send_config() local
496 memset(msg, 0, sizeof(struct synthvid_msg)); synthvid_send_config()
497 msg->vid_hdr.type = SYNTHVID_VRAM_LOCATION; synthvid_send_config()
498 msg->vid_hdr.size = sizeof(struct synthvid_msg_hdr) + synthvid_send_config()
500 msg->vram.user_ctx = msg->vram.vram_gpa = info->fix.smem_start; synthvid_send_config()
501 msg->vram.is_vram_gpa_specified = 1; synthvid_send_config()
502 synthvid_send(hdev, msg); synthvid_send_config()
510 if (msg->vram_ack.user_ctx != info->fix.smem_start) { synthvid_send_config()
240 synthvid_send(struct hv_device *hdev, struct synthvid_msg *msg) synthvid_send() argument
/linux-4.4.14/drivers/hsi/controllers/
H A Domap_ssi_port.c33 static inline int hsi_dummy_msg(struct hsi_msg *msg __maybe_unused) hsi_dummy_msg()
194 static int ssi_claim_lch(struct hsi_msg *msg) ssi_claim_lch() argument
197 struct hsi_port *port = hsi_get_port(msg->cl); ssi_claim_lch()
203 if (!omap_ssi->gdd_trn[lch].msg) { ssi_claim_lch()
204 omap_ssi->gdd_trn[lch].msg = msg; ssi_claim_lch()
205 omap_ssi->gdd_trn[lch].sg = msg->sgt.sgl; ssi_claim_lch()
212 static int ssi_start_dma(struct hsi_msg *msg, int lch) ssi_start_dma() argument
214 struct hsi_port *port = hsi_get_port(msg->cl); ssi_start_dma()
226 if (msg->ttype == HSI_MSG_READ) { ssi_start_dma()
227 err = dma_map_sg(&ssi->device, msg->sgt.sgl, msg->sgt.nents, ssi_start_dma()
236 ccr = msg->channel + 0x10 + (port->num * 8); /* Sync */ ssi_start_dma()
240 SSI_SSR_BUFFER_CH_REG(msg->channel); ssi_start_dma()
241 d_addr = sg_dma_address(msg->sgt.sgl); ssi_start_dma()
243 err = dma_map_sg(&ssi->device, msg->sgt.sgl, msg->sgt.nents, ssi_start_dma()
252 ccr = (msg->channel + 1 + (port->num * 8)) & 0xf; /* Sync */ ssi_start_dma()
255 s_addr = sg_dma_address(msg->sgt.sgl); ssi_start_dma()
257 SSI_SST_BUFFER_CH_REG(msg->channel); ssi_start_dma()
269 writew_relaxed(SSI_BYTES_TO_FRAMES(msg->sgt.sgl->length), ssi_start_dma()
278 msg->status = HSI_STATUS_PROCEEDING; ssi_start_dma()
283 static int ssi_start_pio(struct hsi_msg *msg) ssi_start_pio() argument
285 struct hsi_port *port = hsi_get_port(msg->cl); ssi_start_pio()
292 if (msg->ttype == HSI_MSG_WRITE) { ssi_start_pio()
293 val = SSI_DATAACCEPT(msg->channel); ssi_start_pio()
297 val = SSI_DATAAVAILABLE(msg->channel) | SSI_ERROROCCURED; ssi_start_pio()
300 msg->ttype ? "write" : "read"); ssi_start_pio()
304 msg->actual_len = 0; ssi_start_pio()
305 msg->status = HSI_STATUS_PROCEEDING; ssi_start_pio()
312 struct hsi_msg *msg; ssi_start_transfer() local
317 msg = list_first_entry(queue, struct hsi_msg, link); ssi_start_transfer()
318 if (msg->status != HSI_STATUS_QUEUED) ssi_start_transfer()
320 if ((msg->sgt.nents) && (msg->sgt.sgl->length > sizeof(u32))) ssi_start_transfer()
321 lch = ssi_claim_lch(msg); ssi_start_transfer()
323 return ssi_start_dma(msg, lch); ssi_start_transfer()
325 return ssi_start_pio(msg); ssi_start_transfer()
328 static int ssi_async_break(struct hsi_msg *msg) ssi_async_break() argument
330 struct hsi_port *port = hsi_get_port(msg->cl); ssi_async_break()
338 if (msg->ttype == HSI_MSG_WRITE) { ssi_async_break()
344 msg->status = HSI_STATUS_COMPLETED; ssi_async_break()
345 msg->complete(msg); ssi_async_break()
356 msg->status = HSI_STATUS_PROCEEDING; ssi_async_break()
357 list_add_tail(&msg->link, &omap_port->brkqueue); ssi_async_break()
366 static int ssi_async(struct hsi_msg *msg) ssi_async() argument
368 struct hsi_port *port = hsi_get_port(msg->cl); ssi_async()
373 BUG_ON(!msg); ssi_async()
375 if (msg->sgt.nents > 1) ssi_async()
378 if (msg->break_frame) ssi_async()
379 return ssi_async_break(msg); ssi_async()
381 if (msg->ttype) { ssi_async()
382 BUG_ON(msg->channel >= omap_port->sst.channels); ssi_async()
383 queue = &omap_port->txqueue[msg->channel]; ssi_async()
385 BUG_ON(msg->channel >= omap_port->ssr.channels); ssi_async()
386 queue = &omap_port->rxqueue[msg->channel]; ssi_async()
388 msg->status = HSI_STATUS_QUEUED; ssi_async()
390 list_add_tail(&msg->link, queue); ssi_async()
393 list_del(&msg->link); ssi_async()
394 msg->status = HSI_STATUS_ERROR; ssi_async()
397 dev_dbg(&port->device, "msg status %d ttype %d ch %d\n", ssi_async()
398 msg->status, msg->ttype, msg->channel); ssi_async()
422 struct hsi_msg *msg; ssi_flush_queue() local
425 msg = list_entry(node, struct hsi_msg, link); list_for_each_safe()
426 if ((cl) && (cl != msg->cl)) list_for_each_safe()
429 pr_debug("flush queue: ch %d, msg %p len %d type %d ctxt %p\n", list_for_each_safe()
430 msg->channel, msg, msg->sgt.sgl->length, list_for_each_safe()
431 msg->ttype, msg->context); list_for_each_safe()
432 if (msg->destructor) list_for_each_safe()
433 msg->destructor(msg); list_for_each_safe()
435 hsi_free_msg(msg); list_for_each_safe()
509 struct hsi_msg *msg; ssi_flush() local
519 msg = omap_ssi->gdd_trn[i].msg; ssi_flush()
520 if (!msg || (port != hsi_get_port(msg->cl))) ssi_flush()
523 if (msg->ttype == HSI_MSG_READ) ssi_flush()
525 omap_ssi->gdd_trn[i].msg = NULL; ssi_flush()
605 struct hsi_msg *msg; ssi_transfer() local
612 msg = list_first_entry(queue, struct hsi_msg, link); ssi_transfer()
613 msg->status = HSI_STATUS_ERROR; ssi_transfer()
614 msg->actual_len = 0; ssi_transfer()
615 list_del(&msg->link); ssi_transfer()
617 msg->complete(msg); ssi_transfer()
630 struct hsi_msg *msg; ssi_cleanup_queues() local
644 msg = list_first_entry(&omap_port->txqueue[i], struct hsi_msg, ssi_cleanup_queues()
646 if ((msg->cl == cl) && (msg->status == HSI_STATUS_PROCEEDING)) { ssi_cleanup_queues()
657 msg = list_first_entry(&omap_port->rxqueue[i], struct hsi_msg, ssi_cleanup_queues()
659 if ((msg->cl == cl) && (msg->status == HSI_STATUS_PROCEEDING)) { ssi_cleanup_queues()
689 struct hsi_msg *msg; ssi_cleanup_gdd() local
695 msg = omap_ssi->gdd_trn[i].msg; ssi_cleanup_gdd()
696 if ((!msg) || (msg->cl != cl)) ssi_cleanup_gdd()
704 if (msg->ttype == HSI_MSG_READ) ssi_cleanup_gdd()
706 omap_ssi->gdd_trn[i].msg = NULL; ssi_cleanup_gdd()
767 struct hsi_msg *msg; ssi_error() local
783 msg = omap_ssi->gdd_trn[i].msg; ssi_error()
784 if ((msg) && (msg->ttype == HSI_MSG_READ)) { ssi_error()
787 omap_ssi->gdd_trn[i].msg = NULL; ssi_error()
807 msg = list_first_entry(&omap_port->rxqueue[i], struct hsi_msg, ssi_error()
809 list_del(&msg->link); ssi_error()
810 msg->status = HSI_STATUS_ERROR; ssi_error()
812 msg->complete(msg); ssi_error()
825 struct hsi_msg *msg; ssi_break_complete() local
840 list_for_each_entry_safe(msg, tmp, &omap_port->brkqueue, link) { ssi_break_complete()
841 msg->status = HSI_STATUS_COMPLETED; ssi_break_complete()
843 list_del(&msg->link); ssi_break_complete()
845 msg->complete(msg); ssi_break_complete()
855 struct hsi_msg *msg; ssi_pio_complete() local
861 msg = list_first_entry(queue, struct hsi_msg, link); ssi_pio_complete()
862 if ((!msg->sgt.nents) || (!msg->sgt.sgl->length)) { ssi_pio_complete()
863 msg->actual_len = 0; ssi_pio_complete()
864 msg->status = HSI_STATUS_PENDING; ssi_pio_complete()
866 if (msg->ttype == HSI_MSG_WRITE) ssi_pio_complete()
867 val = SSI_DATAACCEPT(msg->channel); ssi_pio_complete()
869 val = SSI_DATAAVAILABLE(msg->channel); ssi_pio_complete()
870 if (msg->status == HSI_STATUS_PROCEEDING) { ssi_pio_complete()
871 buf = sg_virt(msg->sgt.sgl) + msg->actual_len; ssi_pio_complete()
872 if (msg->ttype == HSI_MSG_WRITE) ssi_pio_complete()
874 SSI_SST_BUFFER_CH_REG(msg->channel)); ssi_pio_complete()
877 SSI_SSR_BUFFER_CH_REG(msg->channel)); ssi_pio_complete()
878 dev_dbg(&port->device, "ch %d ttype %d 0x%08x\n", msg->channel, ssi_pio_complete()
879 msg->ttype, *buf); ssi_pio_complete()
880 msg->actual_len += sizeof(*buf); ssi_pio_complete()
881 if (msg->actual_len >= msg->sgt.sgl->length) ssi_pio_complete()
882 msg->status = HSI_STATUS_COMPLETED; ssi_pio_complete()
887 if ((msg->status == HSI_STATUS_PROCEEDING) || ssi_pio_complete()
888 ((msg->status == HSI_STATUS_COMPLETED) && ssi_pio_complete()
889 (msg->ttype == HSI_MSG_WRITE))) { ssi_pio_complete()
900 if (msg->ttype == HSI_MSG_WRITE) { ssi_pio_complete()
907 list_del(&msg->link); ssi_pio_complete()
909 msg->complete(msg); ssi_pio_complete()
/linux-4.4.14/arch/x86/kernel/apic/
H A Dhtirq.c37 struct ht_irq_msg msg; ht_set_affinity() local
40 fetch_ht_irq_msg(data->irq, &msg); ht_set_affinity()
41 msg.address_lo &= ~(HT_IRQ_LOW_VECTOR_MASK | ht_set_affinity()
43 msg.address_lo |= HT_IRQ_LOW_VECTOR(cfg->vector) | ht_set_affinity()
45 msg.address_hi &= ~(HT_IRQ_HIGH_DEST_ID_MASK); ht_set_affinity()
46 msg.address_hi |= HT_IRQ_HIGH_DEST_ID(cfg->dest_apicid); ht_set_affinity()
47 write_ht_irq_msg(data->irq, &msg); ht_set_affinity()
92 /* Initialize msg to a value that will never match the first write. */ htirq_domain_alloc()
93 ht_cfg->msg.address_lo = 0xffffffff; htirq_domain_alloc()
94 ht_cfg->msg.address_hi = 0xffffffff; htirq_domain_alloc()
118 struct ht_irq_msg msg; htirq_domain_activate() local
121 msg.address_hi = HT_IRQ_HIGH_DEST_ID(cfg->dest_apicid); htirq_domain_activate()
122 msg.address_lo = htirq_domain_activate()
134 write_ht_irq_msg(irq_data->irq, &msg); htirq_domain_activate()
140 struct ht_irq_msg msg; htirq_domain_deactivate() local
142 memset(&msg, 0, sizeof(msg)); htirq_domain_deactivate()
143 write_ht_irq_msg(irq_data->irq, &msg); htirq_domain_deactivate()
/linux-4.4.14/drivers/xen/xenbus/
H A Dxenbus_xs.c168 struct xs_stored_msg *msg; read_reply() local
192 msg = list_entry(xs_state.reply_list.next, read_reply()
194 list_del(&msg->list); read_reply()
198 *type = msg->hdr.type; read_reply()
200 *len = msg->hdr.len; read_reply()
201 body = msg->u.reply.body; read_reply()
203 kfree(msg); read_reply()
233 void *xenbus_dev_request_and_reply(struct xsd_sockmsg *msg) xenbus_dev_request_and_reply() argument
236 struct xsd_sockmsg req_msg = *msg; xenbus_dev_request_and_reply()
244 err = xb_write(msg, sizeof(*msg) + msg->len); xenbus_dev_request_and_reply()
246 msg->type = XS_ERROR; xenbus_dev_request_and_reply()
249 ret = read_reply(&msg->type, &msg->len); xenbus_dev_request_and_reply()
256 if ((msg->type == XS_TRANSACTION_END) || xenbus_dev_request_and_reply()
258 (msg->type == XS_ERROR))) xenbus_dev_request_and_reply()
272 struct xsd_sockmsg msg; xs_talkv() local
277 msg.tx_id = t.id; xs_talkv()
278 msg.req_id = 0; xs_talkv()
279 msg.type = type; xs_talkv()
280 msg.len = 0; xs_talkv()
282 msg.len += iovec[i].iov_len; xs_talkv()
286 err = xb_write(&msg, sizeof(msg)); xs_talkv()
300 ret = read_reply(&msg.type, len); xs_talkv()
307 if (msg.type == XS_ERROR) { xs_talkv()
313 if (msg.type != type) { xs_talkv()
315 msg.type, type); xs_talkv()
730 struct xs_stored_msg *msg, *tmp; unregister_xenbus_watch() local
756 list_for_each_entry_safe(msg, tmp, &watch_events, list) { unregister_xenbus_watch()
757 if (msg->u.watch.handle != watch) unregister_xenbus_watch()
759 list_del(&msg->list); unregister_xenbus_watch()
760 kfree(msg->u.watch.vec); unregister_xenbus_watch()
761 kfree(msg); unregister_xenbus_watch()
809 struct xs_stored_msg *msg; xenwatch_thread() local
827 msg = list_entry(ent, struct xs_stored_msg, list); xenwatch_thread()
828 msg->u.watch.handle->callback( xenwatch_thread()
829 msg->u.watch.handle, xenwatch_thread()
830 (const char **)msg->u.watch.vec, xenwatch_thread()
831 msg->u.watch.vec_size); xenwatch_thread()
832 kfree(msg->u.watch.vec); xenwatch_thread()
833 kfree(msg); xenwatch_thread()
844 struct xs_stored_msg *msg; process_msg() local
864 msg = kmalloc(sizeof(*msg), GFP_NOIO | __GFP_HIGH); process_msg()
865 if (msg == NULL) { process_msg()
870 err = xb_read(&msg->hdr, sizeof(msg->hdr)); process_msg()
872 kfree(msg); process_msg()
876 if (msg->hdr.len > XENSTORE_PAYLOAD_MAX) { process_msg()
877 kfree(msg); process_msg()
882 body = kmalloc(msg->hdr.len + 1, GFP_NOIO | __GFP_HIGH); process_msg()
884 kfree(msg); process_msg()
889 err = xb_read(body, msg->hdr.len); process_msg()
892 kfree(msg); process_msg()
895 body[msg->hdr.len] = '\0'; process_msg()
897 if (msg->hdr.type == XS_WATCH_EVENT) { process_msg()
898 msg->u.watch.vec = split(body, msg->hdr.len, process_msg()
899 &msg->u.watch.vec_size); process_msg()
900 if (IS_ERR(msg->u.watch.vec)) { process_msg()
901 err = PTR_ERR(msg->u.watch.vec); process_msg()
902 kfree(msg); process_msg()
907 msg->u.watch.handle = find_watch( process_msg()
908 msg->u.watch.vec[XS_WATCH_TOKEN]); process_msg()
909 if (msg->u.watch.handle != NULL) { process_msg()
911 list_add_tail(&msg->list, &watch_events); process_msg()
915 kfree(msg->u.watch.vec); process_msg()
916 kfree(msg); process_msg()
920 msg->u.reply.body = body; process_msg()
922 list_add_tail(&msg->list, &xs_state.reply_list); process_msg()
/linux-4.4.14/drivers/char/ipmi/
H A Dipmi_powernv.c50 struct ipmi_smi_msg *msg, u8 completion_code) send_error_reply()
52 msg->rsp[0] = msg->data[0] | 0x4; send_error_reply()
53 msg->rsp[1] = msg->data[1]; send_error_reply()
54 msg->rsp[2] = completion_code; send_error_reply()
55 msg->rsp_size = 3; send_error_reply()
56 ipmi_smi_msg_received(smi->intf, msg); send_error_reply()
59 static void ipmi_powernv_send(void *send_info, struct ipmi_smi_msg *msg) ipmi_powernv_send() argument
68 if (msg->data_size > IPMI_MAX_MSG_LENGTH) { ipmi_powernv_send()
74 if (msg->data_size < 2) { ipmi_powernv_send()
89 opal_msg->netfn = msg->data[0]; ipmi_powernv_send()
90 opal_msg->cmd = msg->data[1]; ipmi_powernv_send()
91 if (msg->data_size > 2) ipmi_powernv_send()
92 memcpy(opal_msg->data, msg->data + 2, msg->data_size - 2); ipmi_powernv_send()
95 size = sizeof(*opal_msg) + msg->data_size - 2; ipmi_powernv_send()
103 smi->cur_msg = msg; ipmi_powernv_send()
112 send_error_reply(smi, msg, comp); ipmi_powernv_send()
118 struct ipmi_smi_msg *msg; ipmi_powernv_recv() local
123 pr_devel("%s: opal_ipmi_recv(%llx, msg, sz)\n", __func__, ipmi_powernv_recv()
134 msg = smi->cur_msg; ipmi_powernv_recv()
154 send_error_reply(smi, msg, IPMI_ERR_UNSPECIFIED); ipmi_powernv_recv()
171 msg->rsp[0] = opal_msg->netfn; ipmi_powernv_recv()
172 msg->rsp[1] = opal_msg->cmd; ipmi_powernv_recv()
174 memcpy(&msg->rsp[2], opal_msg->data, size - sizeof(*opal_msg)); ipmi_powernv_recv()
175 msg->rsp_size = 2 + size - sizeof(*opal_msg); ipmi_powernv_recv()
179 ipmi_smi_msg_received(smi->intf, msg); ipmi_powernv_recv()
49 send_error_reply(struct ipmi_smi_powernv *smi, struct ipmi_smi_msg *msg, u8 completion_code) send_error_reply() argument
H A Dipmi_msghandler.c60 struct ipmi_smi_msg *msg);
424 void (*null_user_handler)(ipmi_smi_t intf, struct ipmi_recv_msg *msg);
504 struct ipmi_recv_msg *msg, *msg2; free_recv_msg_list() local
506 list_for_each_entry_safe(msg, msg2, q, link) { list_for_each_entry_safe()
507 list_del(&msg->link); list_for_each_entry_safe()
508 ipmi_free_recv_msg(msg); list_for_each_entry_safe()
514 struct ipmi_smi_msg *msg, *msg2; free_smi_msg_list() local
516 list_for_each_entry_safe(msg, msg2, q, link) { list_for_each_entry_safe()
517 list_del(&msg->link); list_for_each_entry_safe()
518 ipmi_free_smi_msg(msg); list_for_each_entry_safe()
733 static void deliver_response(struct ipmi_recv_msg *msg) deliver_response() argument
735 if (!msg->user) { deliver_response()
736 ipmi_smi_t intf = msg->user_msg_data; deliver_response()
740 intf->null_user_handler(intf, msg); deliver_response()
746 ipmi_free_recv_msg(msg); deliver_response()
754 ipmi_user_t user = msg->user; deliver_response()
755 user->handler->ipmi_recv_hndl(msg, user->handler_data); deliver_response()
760 deliver_err_response(struct ipmi_recv_msg *msg, int err) deliver_err_response() argument
762 msg->recv_type = IPMI_RESPONSE_RECV_TYPE; deliver_err_response()
763 msg->msg_data[0] = err; deliver_err_response()
764 msg->msg.netfn |= 1; /* Convert to a response. */ deliver_err_response()
765 msg->msg.data_len = 1; deliver_err_response()
766 msg->msg.data = msg->msg_data; deliver_err_response()
767 deliver_response(msg); deliver_err_response()
839 struct ipmi_recv_msg *msg = intf->seq_table[seq].recv_msg; intf_find_seq() local
841 if ((msg->addr.channel == channel) && (msg->msg.cmd == cmd) intf_find_seq()
842 && (msg->msg.netfn == netfn) intf_find_seq()
843 && (ipmi_addr_equal(addr, &(msg->addr)))) { intf_find_seq()
844 *recv_msg = msg; intf_find_seq()
892 struct ipmi_recv_msg *msg = NULL; intf_err_seq() local
907 msg = ent->recv_msg; intf_err_seq()
912 if (msg) intf_err_seq()
913 deliver_err_response(msg, err); intf_err_seq()
1234 struct ipmi_recv_msg *msg, *msg2; ipmi_set_gets_events() local
1261 list_for_each_entry_safe(msg, msg2, &intf->waiting_events, link) ipmi_set_gets_events()
1262 list_move_tail(&msg->link, &msgs); ipmi_set_gets_events()
1273 list_for_each_entry_safe(msg, msg2, &msgs, link) { ipmi_set_gets_events()
1274 msg->user = user; ipmi_set_gets_events()
1276 deliver_response(msg); ipmi_set_gets_events()
1410 struct kernel_ipmi_msg *msg, format_ipmb_msg()
1427 smi_msg->data[i+4] = (msg->netfn << 2) | (ipmb_addr->lun & 0x3); format_ipmb_msg()
1431 smi_msg->data[i+8] = msg->cmd; format_ipmb_msg()
1434 if (msg->data_len > 0) format_ipmb_msg()
1435 memcpy(&(smi_msg->data[i+9]), msg->data, format_ipmb_msg()
1436 msg->data_len); format_ipmb_msg()
1437 smi_msg->data_size = msg->data_len + 9; format_ipmb_msg()
1454 struct kernel_ipmi_msg *msg, format_lan_msg()
1466 smi_msg->data[5] = (msg->netfn << 2) | (lan_addr->lun & 0x3); format_lan_msg()
1470 smi_msg->data[9] = msg->cmd; format_lan_msg()
1473 if (msg->data_len > 0) format_lan_msg()
1474 memcpy(&(smi_msg->data[10]), msg->data, format_lan_msg()
1475 msg->data_len); format_lan_msg()
1476 smi_msg->data_size = msg->data_len + 10; format_lan_msg()
1539 struct kernel_ipmi_msg *msg, i_ipmi_request()
1588 recv_msg->msg = *msg; i_ipmi_request()
1593 if (msg->netfn & 1) { i_ipmi_request()
1608 if ((msg->netfn == IPMI_NETFN_APP_REQUEST) i_ipmi_request()
1609 && ((msg->cmd == IPMI_SEND_MSG_CMD) i_ipmi_request()
1610 || (msg->cmd == IPMI_GET_MSG_CMD) i_ipmi_request()
1611 || (msg->cmd == IPMI_READ_EVENT_MSG_BUFFER_CMD))) { i_ipmi_request()
1621 if (((msg->netfn == IPMI_NETFN_APP_REQUEST) i_ipmi_request()
1622 && ((msg->cmd == IPMI_COLD_RESET_CMD) i_ipmi_request()
1623 || (msg->cmd == IPMI_WARM_RESET_CMD))) i_ipmi_request()
1624 || (msg->netfn == IPMI_NETFN_FIRMWARE_REQUEST)) { i_ipmi_request()
1637 if ((msg->data_len + 2) > IPMI_MAX_MSG_LENGTH) { i_ipmi_request()
1643 smi_msg->data[0] = (msg->netfn << 2) | (smi_addr->lun & 0x3); i_ipmi_request()
1644 smi_msg->data[1] = msg->cmd; i_ipmi_request()
1647 if (msg->data_len > 0) i_ipmi_request()
1648 memcpy(&(smi_msg->data[2]), msg->data, msg->data_len); i_ipmi_request()
1649 smi_msg->data_size = msg->data_len + 2; i_ipmi_request()
1695 if ((msg->data_len + 10 + broadcast) > IPMI_MAX_MSG_LENGTH) { i_ipmi_request()
1710 if (recv_msg->msg.netfn & 0x1) { i_ipmi_request()
1716 format_ipmb_msg(smi_msg, msg, ipmb_addr, msgid, i_ipmi_request()
1758 format_ipmb_msg(smi_msg, msg, ipmb_addr, i_ipmi_request()
1769 recv_msg->msg.data = recv_msg->msg_data; i_ipmi_request()
1770 recv_msg->msg.data_len = smi_msg->data_size; i_ipmi_request()
1809 if ((msg->data_len + 12) > IPMI_MAX_MSG_LENGTH) { i_ipmi_request()
1824 if (recv_msg->msg.netfn & 0x1) { i_ipmi_request()
1830 format_lan_msg(smi_msg, msg, lan_addr, msgid, i_ipmi_request()
1871 format_lan_msg(smi_msg, msg, lan_addr, i_ipmi_request()
1881 recv_msg->msg.data = recv_msg->msg_data; i_ipmi_request()
1882 recv_msg->msg.data_len = smi_msg->data_size; i_ipmi_request()
1937 struct kernel_ipmi_msg *msg, ipmi_request_settime()
1955 msg, ipmi_request_settime()
1969 struct kernel_ipmi_msg *msg, ipmi_request_supply_msgs()
1987 msg, ipmi_request_supply_msgs()
2581 struct kernel_ipmi_msg msg; send_guid_cmd() local
2588 msg.netfn = IPMI_NETFN_APP_REQUEST; send_guid_cmd()
2589 msg.cmd = IPMI_GET_DEVICE_GUID_CMD; send_guid_cmd()
2590 msg.data = NULL; send_guid_cmd()
2591 msg.data_len = 0; send_guid_cmd()
2596 &msg, send_guid_cmd()
2607 guid_handler(ipmi_smi_t intf, struct ipmi_recv_msg *msg) guid_handler() argument
2609 if ((msg->addr.addr_type != IPMI_SYSTEM_INTERFACE_ADDR_TYPE) guid_handler()
2610 || (msg->msg.netfn != IPMI_NETFN_APP_RESPONSE) guid_handler()
2611 || (msg->msg.cmd != IPMI_GET_DEVICE_GUID_CMD)) guid_handler()
2615 if (msg->msg.data[0] != 0) { guid_handler()
2621 if (msg->msg.data_len < 17) { guid_handler()
2627 msg->msg.data_len); guid_handler()
2631 memcpy(intf->bmc->guid, msg->msg.data, 16); guid_handler()
2655 struct kernel_ipmi_msg msg; send_channel_info_cmd() local
2663 msg.netfn = IPMI_NETFN_APP_REQUEST; send_channel_info_cmd()
2664 msg.cmd = IPMI_GET_CHANNEL_INFO_CMD; send_channel_info_cmd()
2665 msg.data = data; send_channel_info_cmd()
2666 msg.data_len = 1; send_channel_info_cmd()
2672 &msg, send_channel_info_cmd()
2683 channel_handler(ipmi_smi_t intf, struct ipmi_recv_msg *msg) channel_handler() argument
2688 if ((msg->addr.addr_type == IPMI_SYSTEM_INTERFACE_ADDR_TYPE) channel_handler()
2689 && (msg->msg.netfn == IPMI_NETFN_APP_RESPONSE) channel_handler()
2690 && (msg->msg.cmd == IPMI_GET_CHANNEL_INFO_CMD)) { channel_handler()
2692 if (msg->msg.data[0] != 0) { channel_handler()
2695 if (msg->msg.data[0] == IPMI_INVALID_COMMAND_ERR) { channel_handler()
2713 if (msg->msg.data_len < 4) { channel_handler()
2718 intf->channels[chan].medium = msg->msg.data[2] & 0x7f; channel_handler()
2719 intf->channels[chan].protocol = msg->msg.data[3] & 0x1f; channel_handler()
2927 struct ipmi_smi_msg *msg, deliver_smi_err_response()
2930 msg->rsp[0] = msg->data[0] | 4; deliver_smi_err_response()
2931 msg->rsp[1] = msg->data[1]; deliver_smi_err_response()
2932 msg->rsp[2] = err; deliver_smi_err_response()
2933 msg->rsp_size = 3; deliver_smi_err_response()
2935 handle_one_recv_msg(intf, msg); deliver_smi_err_response()
2942 struct ipmi_smi_msg *msg; cleanup_smi_msgs() local
2966 msg = list_entry(entry, struct ipmi_smi_msg, link); cleanup_smi_msgs()
2967 deliver_smi_err_response(intf, msg, IPMI_ERR_UNSPECIFIED); cleanup_smi_msgs()
3024 struct ipmi_smi_msg *msg) handle_ipmb_get_msg_rsp()
3033 if (msg->rsp_size < 11) { handle_ipmb_get_msg_rsp()
3039 if (msg->rsp[2] != 0) { handle_ipmb_get_msg_rsp()
3045 ipmb_addr.slave_addr = msg->rsp[6]; handle_ipmb_get_msg_rsp()
3046 ipmb_addr.channel = msg->rsp[3] & 0x0f; handle_ipmb_get_msg_rsp()
3047 ipmb_addr.lun = msg->rsp[7] & 3; handle_ipmb_get_msg_rsp()
3054 msg->rsp[7] >> 2, handle_ipmb_get_msg_rsp()
3055 msg->rsp[3] & 0x0f, handle_ipmb_get_msg_rsp()
3056 msg->rsp[8], handle_ipmb_get_msg_rsp()
3057 (msg->rsp[4] >> 2) & (~1), handle_ipmb_get_msg_rsp()
3069 &(msg->rsp[9]), handle_ipmb_get_msg_rsp()
3070 msg->rsp_size - 9); handle_ipmb_get_msg_rsp()
3076 recv_msg->msg.netfn = msg->rsp[4] >> 2; handle_ipmb_get_msg_rsp()
3077 recv_msg->msg.data = recv_msg->msg_data; handle_ipmb_get_msg_rsp()
3078 recv_msg->msg.data_len = msg->rsp_size - 10; handle_ipmb_get_msg_rsp()
3087 struct ipmi_smi_msg *msg) handle_ipmb_get_msg_cmd()
3098 if (msg->rsp_size < 10) { handle_ipmb_get_msg_cmd()
3104 if (msg->rsp[2] != 0) { handle_ipmb_get_msg_cmd()
3109 netfn = msg->rsp[4] >> 2; handle_ipmb_get_msg_cmd()
3110 cmd = msg->rsp[8]; handle_ipmb_get_msg_cmd()
3111 chan = msg->rsp[3] & 0xf; handle_ipmb_get_msg_cmd()
3126 msg->data[0] = (IPMI_NETFN_APP_REQUEST << 2); handle_ipmb_get_msg_cmd()
3127 msg->data[1] = IPMI_SEND_MSG_CMD; handle_ipmb_get_msg_cmd()
3128 msg->data[2] = msg->rsp[3]; handle_ipmb_get_msg_cmd()
3129 msg->data[3] = msg->rsp[6]; handle_ipmb_get_msg_cmd()
3130 msg->data[4] = ((netfn + 1) << 2) | (msg->rsp[7] & 0x3); handle_ipmb_get_msg_cmd()
3131 msg->data[5] = ipmb_checksum(&(msg->data[3]), 2); handle_ipmb_get_msg_cmd()
3132 msg->data[6] = intf->channels[msg->rsp[3] & 0xf].address; handle_ipmb_get_msg_cmd()
3134 msg->data[7] = (msg->rsp[7] & 0xfc) | (msg->rsp[4] & 0x3); handle_ipmb_get_msg_cmd()
3135 msg->data[8] = msg->rsp[8]; /* cmd */ handle_ipmb_get_msg_cmd()
3136 msg->data[9] = IPMI_INVALID_CMD_COMPLETION_CODE; handle_ipmb_get_msg_cmd()
3137 msg->data[10] = ipmb_checksum(&(msg->data[6]), 4); handle_ipmb_get_msg_cmd()
3138 msg->data_size = 11; handle_ipmb_get_msg_cmd()
3144 for (m = 0; m < msg->data_size; m++) handle_ipmb_get_msg_cmd()
3145 printk(" %2.2x", msg->data[m]); handle_ipmb_get_msg_cmd()
3151 smi_send(intf, intf->handlers, msg, 0); handle_ipmb_get_msg_cmd()
3177 ipmb_addr->slave_addr = msg->rsp[6]; handle_ipmb_get_msg_cmd()
3178 ipmb_addr->lun = msg->rsp[7] & 3; handle_ipmb_get_msg_cmd()
3179 ipmb_addr->channel = msg->rsp[3] & 0xf; handle_ipmb_get_msg_cmd()
3187 recv_msg->msgid = msg->rsp[7] >> 2; handle_ipmb_get_msg_cmd()
3188 recv_msg->msg.netfn = msg->rsp[4] >> 2; handle_ipmb_get_msg_cmd()
3189 recv_msg->msg.cmd = msg->rsp[8]; handle_ipmb_get_msg_cmd()
3190 recv_msg->msg.data = recv_msg->msg_data; handle_ipmb_get_msg_cmd()
3196 recv_msg->msg.data_len = msg->rsp_size - 10; handle_ipmb_get_msg_cmd()
3198 &(msg->rsp[9]), handle_ipmb_get_msg_cmd()
3199 msg->rsp_size - 10); handle_ipmb_get_msg_cmd()
3208 struct ipmi_smi_msg *msg) handle_lan_get_msg_rsp()
3218 if (msg->rsp_size < 13) { handle_lan_get_msg_rsp()
3224 if (msg->rsp[2] != 0) { handle_lan_get_msg_rsp()
3230 lan_addr.session_handle = msg->rsp[4]; handle_lan_get_msg_rsp()
3231 lan_addr.remote_SWID = msg->rsp[8]; handle_lan_get_msg_rsp()
3232 lan_addr.local_SWID = msg->rsp[5]; handle_lan_get_msg_rsp()
3233 lan_addr.channel = msg->rsp[3] & 0x0f; handle_lan_get_msg_rsp()
3234 lan_addr.privilege = msg->rsp[3] >> 4; handle_lan_get_msg_rsp()
3235 lan_addr.lun = msg->rsp[9] & 3; handle_lan_get_msg_rsp()
3242 msg->rsp[9] >> 2, handle_lan_get_msg_rsp()
3243 msg->rsp[3] & 0x0f, handle_lan_get_msg_rsp()
3244 msg->rsp[10], handle_lan_get_msg_rsp()
3245 (msg->rsp[6] >> 2) & (~1), handle_lan_get_msg_rsp()
3257 &(msg->rsp[11]), handle_lan_get_msg_rsp()
3258 msg->rsp_size - 11); handle_lan_get_msg_rsp()
3264 recv_msg->msg.netfn = msg->rsp[6] >> 2; handle_lan_get_msg_rsp()
3265 recv_msg->msg.data = recv_msg->msg_data; handle_lan_get_msg_rsp()
3266 recv_msg->msg.data_len = msg->rsp_size - 12; handle_lan_get_msg_rsp()
3275 struct ipmi_smi_msg *msg) handle_lan_get_msg_cmd()
3286 if (msg->rsp_size < 12) { handle_lan_get_msg_cmd()
3292 if (msg->rsp[2] != 0) { handle_lan_get_msg_cmd()
3297 netfn = msg->rsp[6] >> 2; handle_lan_get_msg_cmd()
3298 cmd = msg->rsp[10]; handle_lan_get_msg_cmd()
3299 chan = msg->rsp[3] & 0xf; handle_lan_get_msg_cmd()
3335 lan_addr->session_handle = msg->rsp[4]; handle_lan_get_msg_cmd()
3336 lan_addr->remote_SWID = msg->rsp[8]; handle_lan_get_msg_cmd()
3337 lan_addr->local_SWID = msg->rsp[5]; handle_lan_get_msg_cmd()
3338 lan_addr->lun = msg->rsp[9] & 3; handle_lan_get_msg_cmd()
3339 lan_addr->channel = msg->rsp[3] & 0xf; handle_lan_get_msg_cmd()
3340 lan_addr->privilege = msg->rsp[3] >> 4; handle_lan_get_msg_cmd()
3348 recv_msg->msgid = msg->rsp[9] >> 2; handle_lan_get_msg_cmd()
3349 recv_msg->msg.netfn = msg->rsp[6] >> 2; handle_lan_get_msg_cmd()
3350 recv_msg->msg.cmd = msg->rsp[10]; handle_lan_get_msg_cmd()
3351 recv_msg->msg.data = recv_msg->msg_data; handle_lan_get_msg_cmd()
3357 recv_msg->msg.data_len = msg->rsp_size - 12; handle_lan_get_msg_cmd()
3359 &(msg->rsp[11]), handle_lan_get_msg_cmd()
3360 msg->rsp_size - 12); handle_lan_get_msg_cmd()
3375 struct ipmi_smi_msg *msg) handle_oem_get_msg_cmd()
3390 if (msg->rsp_size < 4) { handle_oem_get_msg_cmd()
3396 if (msg->rsp[2] != 0) { handle_oem_get_msg_cmd()
3405 netfn = msg->rsp[0] >> 2; handle_oem_get_msg_cmd()
3406 cmd = msg->rsp[1]; handle_oem_get_msg_cmd()
3407 chan = msg->rsp[3] & 0xf; handle_oem_get_msg_cmd()
3452 smi_addr->lun = msg->rsp[0] & 3; handle_oem_get_msg_cmd()
3457 recv_msg->msg.netfn = msg->rsp[0] >> 2; handle_oem_get_msg_cmd()
3458 recv_msg->msg.cmd = msg->rsp[1]; handle_oem_get_msg_cmd()
3459 recv_msg->msg.data = recv_msg->msg_data; handle_oem_get_msg_cmd()
3465 recv_msg->msg.data_len = msg->rsp_size - 4; handle_oem_get_msg_cmd()
3467 &(msg->rsp[4]), handle_oem_get_msg_cmd()
3468 msg->rsp_size - 4); handle_oem_get_msg_cmd()
3477 struct ipmi_smi_msg *msg) copy_event_into_recv_msg()
3485 smi_addr->lun = msg->rsp[0] & 3; copy_event_into_recv_msg()
3487 recv_msg->msg.netfn = msg->rsp[0] >> 2; copy_event_into_recv_msg()
3488 recv_msg->msg.cmd = msg->rsp[1]; copy_event_into_recv_msg()
3489 memcpy(recv_msg->msg_data, &(msg->rsp[3]), msg->rsp_size - 3); copy_event_into_recv_msg()
3490 recv_msg->msg.data = recv_msg->msg_data; copy_event_into_recv_msg()
3491 recv_msg->msg.data_len = msg->rsp_size - 3; copy_event_into_recv_msg()
3495 struct ipmi_smi_msg *msg) handle_read_event_rsp()
3504 if (msg->rsp_size < 19) { handle_read_event_rsp()
3510 if (msg->rsp[2] != 0) { handle_read_event_rsp()
3549 copy_event_into_recv_msg(recv_msg, msg); handle_read_event_rsp()
3578 copy_event_into_recv_msg(recv_msg, msg); handle_read_event_rsp()
3598 struct ipmi_smi_msg *msg) handle_bmc_rsp()
3603 recv_msg = (struct ipmi_recv_msg *) msg->user_data; handle_bmc_rsp()
3624 recv_msg->msgid = msg->msgid; handle_bmc_rsp()
3629 smi_addr->lun = msg->rsp[0] & 3; handle_bmc_rsp()
3630 recv_msg->msg.netfn = msg->rsp[0] >> 2; handle_bmc_rsp()
3631 recv_msg->msg.cmd = msg->rsp[1]; handle_bmc_rsp()
3633 &(msg->rsp[2]), handle_bmc_rsp()
3634 msg->rsp_size - 2); handle_bmc_rsp()
3635 recv_msg->msg.data = recv_msg->msg_data; handle_bmc_rsp()
3636 recv_msg->msg.data_len = msg->rsp_size - 2; handle_bmc_rsp()
3649 struct ipmi_smi_msg *msg) handle_one_recv_msg()
3657 for (m = 0; m < msg->rsp_size; m++) handle_one_recv_msg()
3658 printk(" %2.2x", msg->rsp[m]); handle_one_recv_msg()
3661 if (msg->rsp_size < 2) { handle_one_recv_msg()
3665 (msg->data[0] >> 2) | 1, msg->data[1], msg->rsp_size); handle_one_recv_msg()
3668 msg->rsp[0] = msg->data[0] | (1 << 2); handle_one_recv_msg()
3669 msg->rsp[1] = msg->data[1]; handle_one_recv_msg()
3670 msg->rsp[2] = IPMI_ERR_UNSPECIFIED; handle_one_recv_msg()
3671 msg->rsp_size = 3; handle_one_recv_msg()
3672 } else if (((msg->rsp[0] >> 2) != ((msg->data[0] >> 2) | 1)) handle_one_recv_msg()
3673 || (msg->rsp[1] != msg->data[1])) { handle_one_recv_msg()
3680 (msg->data[0] >> 2) | 1, msg->data[1], handle_one_recv_msg()
3681 msg->rsp[0] >> 2, msg->rsp[1]); handle_one_recv_msg()
3684 msg->rsp[0] = msg->data[0] | (1 << 2); handle_one_recv_msg()
3685 msg->rsp[1] = msg->data[1]; handle_one_recv_msg()
3686 msg->rsp[2] = IPMI_ERR_UNSPECIFIED; handle_one_recv_msg()
3687 msg->rsp_size = 3; handle_one_recv_msg()
3690 if ((msg->rsp[0] == ((IPMI_NETFN_APP_REQUEST|1) << 2)) handle_one_recv_msg()
3691 && (msg->rsp[1] == IPMI_SEND_MSG_CMD) handle_one_recv_msg()
3692 && (msg->user_data != NULL)) { handle_one_recv_msg()
3697 struct ipmi_recv_msg *recv_msg = msg->user_data; handle_one_recv_msg()
3700 if (msg->rsp_size < 2) handle_one_recv_msg()
3704 chan = msg->data[2] & 0x0f; handle_one_recv_msg()
3717 recv_msg->msg.data = recv_msg->msg_data; handle_one_recv_msg()
3718 recv_msg->msg.data_len = 1; handle_one_recv_msg()
3719 recv_msg->msg_data[0] = msg->rsp[2]; handle_one_recv_msg()
3721 } else if ((msg->rsp[0] == ((IPMI_NETFN_APP_REQUEST|1) << 2)) handle_one_recv_msg()
3722 && (msg->rsp[1] == IPMI_GET_MSG_CMD)) { handle_one_recv_msg()
3724 chan = msg->rsp[3] & 0xf; handle_one_recv_msg()
3744 if (msg->rsp[4] & 0x04) { handle_one_recv_msg()
3749 requeue = handle_ipmb_get_msg_rsp(intf, msg); handle_one_recv_msg()
3755 requeue = handle_ipmb_get_msg_cmd(intf, msg); handle_one_recv_msg()
3761 if (msg->rsp[6] & 0x04) { handle_one_recv_msg()
3766 requeue = handle_lan_get_msg_rsp(intf, msg); handle_one_recv_msg()
3772 requeue = handle_lan_get_msg_cmd(intf, msg); handle_one_recv_msg()
3783 requeue = handle_oem_get_msg_cmd(intf, msg); handle_one_recv_msg()
3793 } else if ((msg->rsp[0] == ((IPMI_NETFN_APP_REQUEST|1) << 2)) handle_one_recv_msg()
3794 && (msg->rsp[1] == IPMI_READ_EVENT_MSG_BUFFER_CMD)) { handle_one_recv_msg()
3796 requeue = handle_read_event_rsp(intf, msg); handle_one_recv_msg()
3799 requeue = handle_bmc_rsp(intf, msg); handle_one_recv_msg()
3903 struct ipmi_smi_msg *msg) ipmi_smi_msg_received()
3908 if ((msg->data_size >= 2) ipmi_smi_msg_received()
3909 && (msg->data[0] == (IPMI_NETFN_APP_REQUEST << 2)) ipmi_smi_msg_received()
3910 && (msg->data[1] == IPMI_SEND_MSG_CMD) ipmi_smi_msg_received()
3911 && (msg->user_data == NULL)) { ipmi_smi_msg_received()
3929 if ((msg->rsp_size >= 3) && (msg->rsp[2] != 0) ipmi_smi_msg_received()
3930 && (msg->rsp[2] != IPMI_NODE_BUSY_ERR) ipmi_smi_msg_received()
3931 && (msg->rsp[2] != IPMI_LOST_ARBITRATION_ERR) ipmi_smi_msg_received()
3932 && (msg->rsp[2] != IPMI_BUS_ERR) ipmi_smi_msg_received()
3933 && (msg->rsp[2] != IPMI_NAK_ON_WRITE_ERR)) { ipmi_smi_msg_received()
3934 int chan = msg->rsp[3] & 0xf; ipmi_smi_msg_received()
3946 intf_err_seq(intf, msg->msgid, msg->rsp[2]); ipmi_smi_msg_received()
3949 intf_start_seq_timer(intf, msg->msgid); ipmi_smi_msg_received()
3952 ipmi_free_smi_msg(msg); ipmi_smi_msg_received()
3960 list_add_tail(&msg->link, &intf->waiting_rcv_msgs); ipmi_smi_msg_received()
3972 if (msg == intf->curr_msg) ipmi_smi_msg_received()
4006 memcpy(smi_msg->data, recv_msg->msg.data, recv_msg->msg.data_len); smi_from_recv_msg()
4007 smi_msg->data_size = recv_msg->msg.data_len; smi_from_recv_msg()
4027 struct ipmi_recv_msg *msg; check_msg_timeout() local
4045 msg = ent->recv_msg; check_msg_timeout()
4046 list_add_tail(&msg->link, timeouts); check_msg_timeout()
4106 struct ipmi_recv_msg *msg, *msg2; ipmi_timeout_handler() local
4124 list_for_each_entry_safe(msg, msg2, &timeouts, link) ipmi_timeout_handler()
4125 deliver_err_response(msg, IPMI_TIMEOUT_COMPLETION_CODE); ipmi_timeout_handler()
4216 static void free_smi_msg(struct ipmi_smi_msg *msg) free_smi_msg() argument
4219 kfree(msg); free_smi_msg()
4235 static void free_recv_msg(struct ipmi_recv_msg *msg) free_recv_msg() argument
4238 kfree(msg); free_recv_msg()
4254 void ipmi_free_recv_msg(struct ipmi_recv_msg *msg) ipmi_free_recv_msg() argument
4256 if (msg->user) ipmi_free_recv_msg()
4257 kref_put(&msg->user->refcount, free_user); ipmi_free_recv_msg()
4258 msg->done(msg); ipmi_free_recv_msg()
4266 static void dummy_smi_done_handler(struct ipmi_smi_msg *msg) dummy_smi_done_handler() argument
4271 static void dummy_recv_done_handler(struct ipmi_recv_msg *msg) dummy_recv_done_handler() argument
4281 struct kernel_ipmi_msg *msg) ipmi_panic_request_and_wait()
4294 msg, ipmi_panic_request_and_wait()
4312 static void event_receiver_fetcher(ipmi_smi_t intf, struct ipmi_recv_msg *msg) event_receiver_fetcher() argument
4314 if ((msg->addr.addr_type == IPMI_SYSTEM_INTERFACE_ADDR_TYPE) event_receiver_fetcher()
4315 && (msg->msg.netfn == IPMI_NETFN_SENSOR_EVENT_RESPONSE) event_receiver_fetcher()
4316 && (msg->msg.cmd == IPMI_GET_EVENT_RECEIVER_CMD) event_receiver_fetcher()
4317 && (msg->msg.data[0] == IPMI_CC_NO_ERROR)) { event_receiver_fetcher()
4319 intf->event_receiver = msg->msg.data[1]; event_receiver_fetcher()
4320 intf->event_receiver_lun = msg->msg.data[2] & 0x3; event_receiver_fetcher()
4324 static void device_id_fetcher(ipmi_smi_t intf, struct ipmi_recv_msg *msg) device_id_fetcher() argument
4326 if ((msg->addr.addr_type == IPMI_SYSTEM_INTERFACE_ADDR_TYPE) device_id_fetcher()
4327 && (msg->msg.netfn == IPMI_NETFN_APP_RESPONSE) device_id_fetcher()
4328 && (msg->msg.cmd == IPMI_GET_DEVICE_ID_CMD) device_id_fetcher()
4329 && (msg->msg.data[0] == IPMI_CC_NO_ERROR)) { device_id_fetcher()
4334 intf->local_sel_device = (msg->msg.data[6] >> 2) & 1; device_id_fetcher()
4335 intf->local_event_generator = (msg->msg.data[6] >> 5) & 1; device_id_fetcher()
4342 struct kernel_ipmi_msg msg; send_panic_events() local
4354 msg.netfn = 0x04; /* Sensor or Event. */ send_panic_events()
4355 msg.cmd = 2; /* Platform event command. */ send_panic_events()
4356 msg.data = data; send_panic_events()
4357 msg.data_len = 8; send_panic_events()
4381 ipmi_panic_request_and_wait(intf, &addr, &msg); send_panic_events()
4424 msg.netfn = IPMI_NETFN_APP_REQUEST; send_panic_events()
4425 msg.cmd = IPMI_GET_DEVICE_ID_CMD; send_panic_events()
4426 msg.data = NULL; send_panic_events()
4427 msg.data_len = 0; send_panic_events()
4429 ipmi_panic_request_and_wait(intf, &addr, &msg); send_panic_events()
4433 msg.netfn = IPMI_NETFN_SENSOR_EVENT_REQUEST; send_panic_events()
4434 msg.cmd = IPMI_GET_EVENT_RECEIVER_CMD; send_panic_events()
4435 msg.data = NULL; send_panic_events()
4436 msg.data_len = 0; send_panic_events()
4438 ipmi_panic_request_and_wait(intf, &addr, &msg); send_panic_events()
4472 msg.netfn = IPMI_NETFN_STORAGE_REQUEST; /* Storage. */ send_panic_events()
4473 msg.cmd = IPMI_ADD_SEL_ENTRY_CMD; send_panic_events()
4474 msg.data = data; send_panic_events()
4475 msg.data_len = 16; send_panic_events()
4495 ipmi_panic_request_and_wait(intf, &addr, &msg); send_panic_events()
1409 format_ipmb_msg(struct ipmi_smi_msg *smi_msg, struct kernel_ipmi_msg *msg, struct ipmi_ipmb_addr *ipmb_addr, long msgid, unsigned char ipmb_seq, int broadcast, unsigned char source_address, unsigned char source_lun) format_ipmb_msg() argument
1453 format_lan_msg(struct ipmi_smi_msg *smi_msg, struct kernel_ipmi_msg *msg, struct ipmi_lan_addr *lan_addr, long msgid, unsigned char ipmb_seq, unsigned char source_lun) format_lan_msg() argument
1535 i_ipmi_request(ipmi_user_t user, ipmi_smi_t intf, struct ipmi_addr *addr, long msgid, struct kernel_ipmi_msg *msg, void *user_msg_data, void *supplied_smi, struct ipmi_recv_msg *supplied_recv, int priority, unsigned char source_address, unsigned char source_lun, int retries, unsigned int retry_time_ms) i_ipmi_request() argument
1934 ipmi_request_settime(ipmi_user_t user, struct ipmi_addr *addr, long msgid, struct kernel_ipmi_msg *msg, void *user_msg_data, int priority, int retries, unsigned int retry_time_ms) ipmi_request_settime() argument
1966 ipmi_request_supply_msgs(ipmi_user_t user, struct ipmi_addr *addr, long msgid, struct kernel_ipmi_msg *msg, void *user_msg_data, void *supplied_smi, struct ipmi_recv_msg *supplied_recv, int priority) ipmi_request_supply_msgs() argument
2926 deliver_smi_err_response(ipmi_smi_t intf, struct ipmi_smi_msg *msg, unsigned char err) deliver_smi_err_response() argument
3023 handle_ipmb_get_msg_rsp(ipmi_smi_t intf, struct ipmi_smi_msg *msg) handle_ipmb_get_msg_rsp() argument
3086 handle_ipmb_get_msg_cmd(ipmi_smi_t intf, struct ipmi_smi_msg *msg) handle_ipmb_get_msg_cmd() argument
3207 handle_lan_get_msg_rsp(ipmi_smi_t intf, struct ipmi_smi_msg *msg) handle_lan_get_msg_rsp() argument
3274 handle_lan_get_msg_cmd(ipmi_smi_t intf, struct ipmi_smi_msg *msg) handle_lan_get_msg_cmd() argument
3374 handle_oem_get_msg_cmd(ipmi_smi_t intf, struct ipmi_smi_msg *msg) handle_oem_get_msg_cmd() argument
3476 copy_event_into_recv_msg(struct ipmi_recv_msg *recv_msg, struct ipmi_smi_msg *msg) copy_event_into_recv_msg() argument
3494 handle_read_event_rsp(ipmi_smi_t intf, struct ipmi_smi_msg *msg) handle_read_event_rsp() argument
3597 handle_bmc_rsp(ipmi_smi_t intf, struct ipmi_smi_msg *msg) handle_bmc_rsp() argument
3648 handle_one_recv_msg(ipmi_smi_t intf, struct ipmi_smi_msg *msg) handle_one_recv_msg() argument
3902 ipmi_smi_msg_received(ipmi_smi_t intf, struct ipmi_smi_msg *msg) ipmi_smi_msg_received() argument
4279 ipmi_panic_request_and_wait(ipmi_smi_t intf, struct ipmi_addr *addr, struct kernel_ipmi_msg *msg) ipmi_panic_request_and_wait() argument
H A Dipmi_devintf.c61 static void file_receive_handler(struct ipmi_recv_msg *msg, file_receive_handler() argument
71 list_add_tail(&(msg->link), &(priv->recv_msgs)); file_receive_handler()
160 struct ipmi_recv_msg *msg, *next; ipmi_release() local
166 list_for_each_entry_safe(msg, next, &priv->recv_msgs, link) ipmi_release()
167 ipmi_free_recv_msg(msg); ipmi_release()
182 struct kernel_ipmi_msg msg; handle_send_req() local
190 msg.netfn = req->msg.netfn; handle_send_req()
191 msg.cmd = req->msg.cmd; handle_send_req()
192 msg.data_len = req->msg.data_len; handle_send_req()
193 msg.data = kmalloc(IPMI_MAX_MSG_LENGTH, GFP_KERNEL); handle_send_req()
194 if (!msg.data) handle_send_req()
204 if (req->msg.data != NULL) { handle_send_req()
205 if (req->msg.data_len > IPMI_MAX_MSG_LENGTH) { handle_send_req()
210 if (copy_from_user(msg.data, handle_send_req()
211 req->msg.data, handle_send_req()
212 req->msg.data_len)) handle_send_req()
218 msg.data_len = 0; handle_send_req()
224 &msg, handle_send_req()
230 kfree(msg.data); handle_send_req()
282 struct ipmi_recv_msg *msg; ipmi_ioctl() local
310 msg = list_entry(entry, struct ipmi_recv_msg, link); ipmi_ioctl()
314 addr_len = ipmi_addr_length(msg->addr.addr_type); ipmi_ioctl()
321 if (copy_to_user(rsp.addr, &(msg->addr), addr_len)) { ipmi_ioctl()
327 rsp.recv_type = msg->recv_type; ipmi_ioctl()
328 rsp.msgid = msg->msgid; ipmi_ioctl()
329 rsp.msg.netfn = msg->msg.netfn; ipmi_ioctl()
330 rsp.msg.cmd = msg->msg.cmd; ipmi_ioctl()
332 if (msg->msg.data_len > 0) { ipmi_ioctl()
333 if (rsp.msg.data_len < msg->msg.data_len) { ipmi_ioctl()
336 msg->msg.data_len = rsp.msg.data_len; ipmi_ioctl()
342 if (copy_to_user(rsp.msg.data, ipmi_ioctl()
343 msg->msg.data, ipmi_ioctl()
344 msg->msg.data_len)) ipmi_ioctl()
349 rsp.msg.data_len = msg->msg.data_len; ipmi_ioctl()
351 rsp.msg.data_len = 0; ipmi_ioctl()
360 ipmi_free_recv_msg(msg); ipmi_ioctl()
679 struct compat_ipmi_msg msg; member in struct:compat_ipmi_req
687 struct compat_ipmi_msg msg; member in struct:compat_ipmi_recv
735 get_compat_ipmi_msg(&p64->msg, &p32->msg)) get_compat_ipmi_req()
762 get_compat_ipmi_msg(&p64->msg, &p32->msg)) get_compat_ipmi_recv()
775 put_compat_ipmi_msg(&p64->msg, &p32->msg)) put_compat_ipmi_recv()
H A Dipmi_ssif.c300 struct ipmi_smi_msg *msg);
320 struct ipmi_smi_msg *msg) deliver_recv_msg()
325 ipmi_free_smi_msg(msg); deliver_recv_msg()
326 } else if (msg->rsp_size < 0) { deliver_recv_msg()
327 return_hosed_msg(ssif_info, msg); deliver_recv_msg()
330 msg->rsp_size); deliver_recv_msg()
332 ipmi_smi_msg_received(intf, msg); deliver_recv_msg()
337 struct ipmi_smi_msg *msg) return_hosed_msg()
342 msg->rsp[0] = msg->data[0] | 4; return_hosed_msg()
343 msg->rsp[1] = msg->data[1]; return_hosed_msg()
344 msg->rsp[2] = 0xFF; /* Unknown error. */ return_hosed_msg()
345 msg->rsp_size = 3; return_hosed_msg()
347 deliver_recv_msg(ssif_info, msg); return_hosed_msg()
358 unsigned char msg[3]; start_clear_flags() local
365 msg[0] = (IPMI_NETFN_APP_REQUEST << 2); start_clear_flags()
366 msg[1] = IPMI_CLEAR_MSG_FLAGS_CMD; start_clear_flags()
367 msg[2] = WDT_PRE_TIMEOUT_INT; start_clear_flags()
369 if (start_send(ssif_info, msg, 3) != 0) { start_clear_flags()
390 struct ipmi_smi_msg *msg) check_start_send()
392 if (start_send(ssif_info, msg->data, msg->data_size) != 0) { check_start_send()
399 ipmi_free_smi_msg(msg); check_start_send()
405 struct ipmi_smi_msg *msg; start_event_fetch() local
409 msg = ipmi_alloc_smi_msg(); start_event_fetch()
410 if (!msg) { start_event_fetch()
415 ssif_info->curr_msg = msg; start_event_fetch()
419 msg->data[0] = (IPMI_NETFN_APP_REQUEST << 2); start_event_fetch()
420 msg->data[1] = IPMI_READ_EVENT_MSG_BUFFER_CMD; start_event_fetch()
421 msg->data_size = 2; start_event_fetch()
423 check_start_send(ssif_info, flags, msg); start_event_fetch()
429 struct ipmi_smi_msg *msg; start_recv_msg_fetch() local
431 msg = ipmi_alloc_smi_msg(); start_recv_msg_fetch()
432 if (!msg) { start_recv_msg_fetch()
437 ssif_info->curr_msg = msg; start_recv_msg_fetch()
441 msg->data[0] = (IPMI_NETFN_APP_REQUEST << 2); start_recv_msg_fetch()
442 msg->data[1] = IPMI_GET_MSG_CMD; start_recv_msg_fetch()
443 msg->data_size = 2; start_recv_msg_fetch()
445 check_start_send(ssif_info, flags, msg); start_recv_msg_fetch()
597 struct ipmi_smi_msg *msg; msg_done_handler() local
727 msg = ssif_info->curr_msg; msg_done_handler()
728 if (msg) { msg_done_handler()
729 msg->rsp_size = len; msg_done_handler()
730 if (msg->rsp_size > IPMI_MAX_MSG_LENGTH) msg_done_handler()
731 msg->rsp_size = IPMI_MAX_MSG_LENGTH; msg_done_handler()
732 memcpy(msg->rsp, data, msg->rsp_size); msg_done_handler()
739 if (!msg) msg_done_handler()
743 return_hosed_msg(ssif_info, msg); msg_done_handler()
745 deliver_recv_msg(ssif_info, msg); msg_done_handler()
786 if ((result < 0) || (len < 3) || (msg->rsp[2] != 0)) { msg_done_handler()
788 msg->done(msg); msg_done_handler()
793 } else if (msg->rsp[0] != (IPMI_NETFN_APP_REQUEST | 1) << 2 msg_done_handler()
794 || msg->rsp[1] != IPMI_READ_EVENT_MSG_BUFFER_CMD) { msg_done_handler()
796 msg->rsp[0], msg->rsp[1]); msg_done_handler()
797 msg->done(msg); msg_done_handler()
804 deliver_recv_msg(ssif_info, msg); msg_done_handler()
809 if ((result < 0) || (len < 3) || (msg->rsp[2] != 0)) { msg_done_handler()
811 msg->done(msg); msg_done_handler()
813 /* Take off the msg flag. */ msg_done_handler()
816 } else if (msg->rsp[0] != (IPMI_NETFN_APP_REQUEST | 1) << 2 msg_done_handler()
817 || msg->rsp[1] != IPMI_GET_MSG_CMD) { msg_done_handler()
819 msg->rsp[0], msg->rsp[1]); msg_done_handler()
820 msg->done(msg); msg_done_handler()
822 /* Take off the msg flag. */ msg_done_handler()
828 deliver_recv_msg(ssif_info, msg); msg_done_handler()
1001 struct ipmi_smi_msg *msg; start_next_msg() local
1023 msg = ssif_info->curr_msg; start_next_msg()
1025 return_hosed_msg(ssif_info, msg); start_next_msg()
1033 struct ipmi_smi_msg *msg) sender()
1039 ssif_info->waiting_msg = msg; sender()
1049 msg->data[0], msg->data[1], sender()
1211 static int do_cmd(struct i2c_client *client, int len, unsigned char *msg, do_cmd() argument
1219 ret = i2c_smbus_write_block_data(client, SSIF_IPMI_REQUEST, len, msg); do_cmd()
1243 (resp[0] != (msg[0] | (1 << 2))) || do_cmd()
1244 (resp[1] != msg[1])) do_cmd()
1258 unsigned char msg[3]; ssif_detect() local
1267 msg[0] = IPMI_NETFN_APP_REQUEST << 2; ssif_detect()
1268 msg[1] = IPMI_GET_DEVICE_ID_CMD; ssif_detect()
1269 rv = do_cmd(client, 2, msg, &len, resp); ssif_detect()
1417 unsigned char msg[3]; ssif_probe() local
1459 msg[0] = IPMI_NETFN_APP_REQUEST << 2; ssif_probe()
1460 msg[1] = IPMI_GET_DEVICE_ID_CMD; ssif_probe()
1461 rv = do_cmd(client, 2, msg, &len, resp); ssif_probe()
1473 msg[0] = IPMI_NETFN_APP_REQUEST << 2; ssif_probe()
1474 msg[1] = IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_CMD; ssif_probe()
1475 msg[2] = 0; /* SSIF */ ssif_probe()
1476 rv = do_cmd(client, 3, msg, &len, resp); ssif_probe()
1546 msg[0] = IPMI_NETFN_APP_REQUEST << 2; ssif_probe()
1547 msg[1] = IPMI_CLEAR_MSG_FLAGS_CMD; ssif_probe()
1548 msg[2] = WDT_PRE_TIMEOUT_INT; ssif_probe()
1549 rv = do_cmd(client, 3, msg, &len, resp); ssif_probe()
1555 msg[0] = IPMI_NETFN_APP_REQUEST << 2; ssif_probe()
1556 msg[1] = IPMI_GET_BMC_GLOBAL_ENABLES_CMD; ssif_probe()
1557 rv = do_cmd(client, 2, msg, &len, resp); ssif_probe()
1573 msg[0] = IPMI_NETFN_APP_REQUEST << 2; ssif_probe()
1574 msg[1] = IPMI_SET_BMC_GLOBAL_ENABLES_CMD; ssif_probe()
1575 msg[2] = ssif_info->global_enables | IPMI_BMC_EVT_MSG_BUFF; ssif_probe()
1576 rv = do_cmd(client, 3, msg, &len, resp); ssif_probe()
1594 msg[0] = IPMI_NETFN_APP_REQUEST << 2; ssif_probe()
1595 msg[1] = IPMI_SET_BMC_GLOBAL_ENABLES_CMD; ssif_probe()
1596 msg[2] = ssif_info->global_enables | IPMI_BMC_RCV_MSG_INTR; ssif_probe()
1597 rv = do_cmd(client, 3, msg, &len, resp); ssif_probe()
319 deliver_recv_msg(struct ssif_info *ssif_info, struct ipmi_smi_msg *msg) deliver_recv_msg() argument
336 return_hosed_msg(struct ssif_info *ssif_info, struct ipmi_smi_msg *msg) return_hosed_msg() argument
389 check_start_send(struct ssif_info *ssif_info, unsigned long *flags, struct ipmi_smi_msg *msg) check_start_send() argument
1032 sender(void *send_info, struct ipmi_smi_msg *msg) sender() argument
/linux-4.4.14/net/core/
H A Dscm.c133 int __scm_send(struct socket *sock, struct msghdr *msg, struct scm_cookie *p) __scm_send() argument
138 for_each_cmsghdr(cmsg, msg) { for_each_cmsghdr()
149 if (!CMSG_OK(msg, cmsg)) for_each_cmsghdr()
215 int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data) put_cmsg() argument
218 = (__force struct cmsghdr __user *)msg->msg_control; put_cmsg()
223 if (MSG_CMSG_COMPAT & msg->msg_flags) put_cmsg()
224 return put_cmsg_compat(msg, level, type, len, data); put_cmsg()
226 if (cm==NULL || msg->msg_controllen < sizeof(*cm)) { put_cmsg()
227 msg->msg_flags |= MSG_CTRUNC; put_cmsg()
230 if (msg->msg_controllen < cmlen) { put_cmsg()
231 msg->msg_flags |= MSG_CTRUNC; put_cmsg()
232 cmlen = msg->msg_controllen; put_cmsg()
244 if (msg->msg_controllen < cmlen) put_cmsg()
245 cmlen = msg->msg_controllen; put_cmsg()
246 msg->msg_control += cmlen; put_cmsg()
247 msg->msg_controllen -= cmlen; put_cmsg()
254 void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm) scm_detach_fds() argument
257 = (__force struct cmsghdr __user*)msg->msg_control; scm_detach_fds()
265 if (MSG_CMSG_COMPAT & msg->msg_flags) { scm_detach_fds()
266 scm_detach_fds_compat(msg, scm); scm_detach_fds()
270 if (msg->msg_controllen > sizeof(struct cmsghdr)) scm_detach_fds()
271 fdmax = ((msg->msg_controllen - sizeof(struct cmsghdr)) scm_detach_fds()
285 err = get_unused_fd_flags(MSG_CMSG_CLOEXEC & msg->msg_flags scm_detach_fds()
314 if (msg->msg_controllen < cmlen) scm_detach_fds()
315 cmlen = msg->msg_controllen; scm_detach_fds()
316 msg->msg_control += cmlen; scm_detach_fds()
317 msg->msg_controllen -= cmlen; scm_detach_fds()
321 msg->msg_flags |= MSG_CTRUNC; scm_detach_fds()
/linux-4.4.14/arch/powerpc/include/asm/
H A Ddbell.h40 static inline void _ppc_msgsnd(u32 msg) _ppc_msgsnd() argument
43 __asm__ __volatile__ (PPC_MSGSND(%0) : : "r" (msg)); _ppc_msgsnd()
45 __asm__ __volatile__ (PPC_MSGSNDP(%0) : : "r" (msg)); _ppc_msgsnd()
54 static inline void _ppc_msgsnd(u32 msg) _ppc_msgsnd() argument
56 __asm__ __volatile__ (PPC_MSGSND(%0) : : "r" (msg)); _ppc_msgsnd()
67 u32 msg = PPC_DBELL_TYPE(type) | (flags & PPC_DBELL_MSG_BRDCAST) | ppc_msgsnd() local
70 _ppc_msgsnd(msg); ppc_msgsnd()
/linux-4.4.14/net/mac80211/
H A Dtrace_msg.h21 __dynamic_array(char, msg, MAX_MSG_LEN)
25 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
30 TP_printk("%s", __get_str(msg))
/linux-4.4.14/tools/perf/ui/tui/
H A Dhelpline.c18 static void tui_helpline__push(const char *msg) tui_helpline__push() argument
24 SLsmg_write_nstring((char *)msg, SLtt_Screen_Cols); tui_helpline__push()
26 strncpy(ui_helpline__current, msg, sz)[sz - 1] = '\0'; tui_helpline__push()
/linux-4.4.14/drivers/gpu/drm/
H A Ddrm_dp_helper.c179 struct drm_dp_aux_msg msg; drm_dp_dpcd_access() local
183 memset(&msg, 0, sizeof(msg)); drm_dp_dpcd_access()
184 msg.address = offset; drm_dp_dpcd_access()
185 msg.request = request; drm_dp_dpcd_access()
186 msg.buffer = buffer; drm_dp_dpcd_access()
187 msg.size = size; drm_dp_dpcd_access()
199 err = aux->transfer(aux, &msg); drm_dp_dpcd_access()
208 switch (msg.reply & DP_AUX_NATIVE_REPLY_MASK) { drm_dp_dpcd_access()
432 static void drm_dp_i2c_msg_write_status_update(struct drm_dp_aux_msg *msg) drm_dp_i2c_msg_write_status_update() argument
439 if ((msg->request & ~DP_AUX_I2C_MOT) == DP_AUX_I2C_WRITE) { drm_dp_i2c_msg_write_status_update()
440 msg->request &= DP_AUX_I2C_MOT; drm_dp_i2c_msg_write_status_update()
441 msg->request |= DP_AUX_I2C_WRITE_STATUS_UPDATE; drm_dp_i2c_msg_write_status_update()
457 static int drm_dp_aux_req_duration(const struct drm_dp_aux_msg *msg) drm_dp_aux_req_duration() argument
462 if ((msg->request & DP_AUX_I2C_READ) == 0) drm_dp_aux_req_duration()
463 len += msg->size * 8; drm_dp_aux_req_duration()
468 static int drm_dp_aux_reply_duration(const struct drm_dp_aux_msg *msg) drm_dp_aux_reply_duration() argument
477 if (msg->request & DP_AUX_I2C_READ) drm_dp_aux_reply_duration()
478 len += msg->size * 8; drm_dp_aux_reply_duration()
496 static int drm_dp_i2c_msg_duration(const struct drm_dp_aux_msg *msg, drm_dp_i2c_msg_duration() argument
501 msg->size * I2C_DATA_LEN + drm_dp_i2c_msg_duration()
510 static int drm_dp_i2c_retry_count(const struct drm_dp_aux_msg *msg, drm_dp_i2c_retry_count() argument
513 int aux_time_us = drm_dp_aux_req_duration(msg) + drm_dp_i2c_retry_count()
514 drm_dp_aux_reply_duration(msg); drm_dp_i2c_retry_count()
515 int i2c_time_us = drm_dp_i2c_msg_duration(msg, i2c_speed_khz); drm_dp_i2c_retry_count()
532 * aux->transfer function does not modify anything in the msg other than the
537 static int drm_dp_i2c_do_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg) drm_dp_i2c_do_msg() argument
548 int max_retries = max(7, drm_dp_i2c_retry_count(msg, dp_aux_i2c_speed_khz)); drm_dp_i2c_do_msg()
551 ret = aux->transfer(aux, msg); drm_dp_i2c_do_msg()
561 switch (msg->reply & DP_AUX_NATIVE_REPLY_MASK) { drm_dp_i2c_do_msg()
570 DRM_DEBUG_KMS("native nack (result=%d, size=%zu)\n", ret, msg->size); drm_dp_i2c_do_msg()
588 DRM_ERROR("invalid native reply %#04x\n", msg->reply); drm_dp_i2c_do_msg()
592 switch (msg->reply & DP_AUX_I2C_REPLY_MASK) { drm_dp_i2c_do_msg()
598 if (ret != msg->size) drm_dp_i2c_do_msg()
599 drm_dp_i2c_msg_write_status_update(msg); drm_dp_i2c_do_msg()
603 DRM_DEBUG_KMS("I2C nack (result=%d, size=%zu\n", ret, msg->size); drm_dp_i2c_do_msg()
617 drm_dp_i2c_msg_write_status_update(msg); drm_dp_i2c_do_msg()
622 DRM_ERROR("invalid I2C reply %#04x\n", msg->reply); drm_dp_i2c_do_msg()
631 static void drm_dp_i2c_msg_set_request(struct drm_dp_aux_msg *msg, drm_dp_i2c_msg_set_request() argument
634 msg->request = (i2c_msg->flags & I2C_M_RD) ? drm_dp_i2c_msg_set_request()
636 msg->request |= DP_AUX_I2C_MOT; drm_dp_i2c_msg_set_request()
647 struct drm_dp_aux_msg msg = *orig_msg; drm_dp_i2c_drain_msg() local
649 while (msg.size > 0) { drm_dp_i2c_drain_msg()
650 err = drm_dp_i2c_do_msg(aux, &msg); drm_dp_i2c_drain_msg()
654 if (err < msg.size && err < ret) { drm_dp_i2c_drain_msg()
656 msg.size, err); drm_dp_i2c_drain_msg()
660 msg.size -= err; drm_dp_i2c_drain_msg()
661 msg.buffer += err; drm_dp_i2c_drain_msg()
683 struct drm_dp_aux_msg msg; drm_dp_i2c_xfer() local
688 memset(&msg, 0, sizeof(msg)); drm_dp_i2c_xfer()
693 msg.address = msgs[i].addr; drm_dp_i2c_xfer()
694 drm_dp_i2c_msg_set_request(&msg, &msgs[i]); drm_dp_i2c_xfer()
699 msg.buffer = NULL; drm_dp_i2c_xfer()
700 msg.size = 0; drm_dp_i2c_xfer()
701 err = drm_dp_i2c_do_msg(aux, &msg); drm_dp_i2c_xfer()
704 * Reset msg.request in case in case it got drm_dp_i2c_xfer()
707 drm_dp_i2c_msg_set_request(&msg, &msgs[i]); drm_dp_i2c_xfer()
716 for (j = 0; j < msgs[i].len; j += msg.size) { drm_dp_i2c_xfer()
717 msg.buffer = msgs[i].buf + j; drm_dp_i2c_xfer()
718 msg.size = min(transfer_size, msgs[i].len - j); drm_dp_i2c_xfer()
720 err = drm_dp_i2c_drain_msg(aux, &msg); drm_dp_i2c_xfer()
723 * Reset msg.request in case in case it got drm_dp_i2c_xfer()
726 drm_dp_i2c_msg_set_request(&msg, &msgs[i]); drm_dp_i2c_xfer()
741 msg.request &= ~DP_AUX_I2C_MOT; drm_dp_i2c_xfer()
742 msg.buffer = NULL; drm_dp_i2c_xfer()
743 msg.size = 0; drm_dp_i2c_xfer()
744 (void)drm_dp_i2c_do_msg(aux, &msg); drm_dp_i2c_xfer()
H A Ddrm_dp_mst_topology.c67 /* sideband msg handling */ drm_dp_msg_header_crc4()
203 u8 *buf = raw->msg; drm_dp_encode_sideband_req()
299 static void drm_dp_crc_sideband_chunk_req(u8 *msg, u8 len) drm_dp_crc_sideband_chunk_req() argument
302 crc4 = drm_dp_msg_data_crc4(msg, len); drm_dp_crc_sideband_chunk_req()
303 msg[len] = crc4; drm_dp_crc_sideband_chunk_req()
310 u8 *buf = raw->msg; drm_dp_encode_sideband_reply()
317 /* this adds a chunk of msg to the builder to get the final msg */ drm_dp_sideband_msg_build()
318 static bool drm_dp_sideband_msg_build(struct drm_dp_sideband_msg_rx *msg, drm_dp_sideband_msg_build() argument
334 msg->curchunk_len = recv_hdr.msg_len; drm_dp_sideband_msg_build()
335 msg->curchunk_hdrlen = hdrlen; drm_dp_sideband_msg_build()
338 if (recv_hdr.somt && msg->have_somt) drm_dp_sideband_msg_build()
342 memcpy(&msg->initial_hdr, &recv_hdr, sizeof(struct drm_dp_sideband_msg_hdr)); drm_dp_sideband_msg_build()
343 msg->have_somt = true; drm_dp_sideband_msg_build()
346 msg->have_eomt = true; drm_dp_sideband_msg_build()
349 msg->curchunk_idx = min(msg->curchunk_len, (u8)(replybuflen - hdrlen)); drm_dp_sideband_msg_build()
350 memcpy(&msg->chunk[0], replybuf + hdrlen, msg->curchunk_idx); drm_dp_sideband_msg_build()
352 memcpy(&msg->chunk[msg->curchunk_idx], replybuf, replybuflen); drm_dp_sideband_msg_build()
353 msg->curchunk_idx += replybuflen; drm_dp_sideband_msg_build()
356 if (msg->curchunk_idx >= msg->curchunk_len) { drm_dp_sideband_msg_build()
358 crc4 = drm_dp_msg_data_crc4(msg->chunk, msg->curchunk_len - 1); drm_dp_sideband_msg_build()
359 /* copy chunk into bigger msg */ drm_dp_sideband_msg_build()
360 memcpy(&msg->msg[msg->curlen], msg->chunk, msg->curchunk_len - 1); drm_dp_sideband_msg_build()
361 msg->curlen += msg->curchunk_len - 1; drm_dp_sideband_msg_build()
371 memcpy(repmsg->u.link_addr.guid, &raw->msg[idx], 16); drm_dp_sideband_parse_link_address()
373 repmsg->u.link_addr.nports = raw->msg[idx] & 0xf; drm_dp_sideband_parse_link_address()
378 if (raw->msg[idx] & 0x80) drm_dp_sideband_parse_link_address()
381 repmsg->u.link_addr.ports[i].peer_device_type = (raw->msg[idx] >> 4) & 0x7; drm_dp_sideband_parse_link_address()
382 repmsg->u.link_addr.ports[i].port_number = (raw->msg[idx] & 0xf); drm_dp_sideband_parse_link_address()
387 repmsg->u.link_addr.ports[i].mcs = (raw->msg[idx] >> 7) & 0x1; drm_dp_sideband_parse_link_address()
388 repmsg->u.link_addr.ports[i].ddps = (raw->msg[idx] >> 6) & 0x1; drm_dp_sideband_parse_link_address()
390 repmsg->u.link_addr.ports[i].legacy_device_plug_status = (raw->msg[idx] >> 5) & 0x1; drm_dp_sideband_parse_link_address()
395 repmsg->u.link_addr.ports[i].dpcd_revision = (raw->msg[idx]); drm_dp_sideband_parse_link_address()
399 memcpy(repmsg->u.link_addr.ports[i].peer_guid, &raw->msg[idx], 16); drm_dp_sideband_parse_link_address()
403 repmsg->u.link_addr.ports[i].num_sdp_streams = (raw->msg[idx] >> 4) & 0xf; drm_dp_sideband_parse_link_address()
404 repmsg->u.link_addr.ports[i].num_sdp_stream_sinks = (raw->msg[idx] & 0xf); drm_dp_sideband_parse_link_address()
422 repmsg->u.remote_dpcd_read_ack.port_number = raw->msg[idx] & 0xf; drm_dp_sideband_parse_remote_dpcd_read()
426 repmsg->u.remote_dpcd_read_ack.num_bytes = raw->msg[idx]; drm_dp_sideband_parse_remote_dpcd_read()
430 memcpy(repmsg->u.remote_dpcd_read_ack.bytes, &raw->msg[idx], repmsg->u.remote_dpcd_read_ack.num_bytes); drm_dp_sideband_parse_remote_dpcd_read()
441 repmsg->u.remote_dpcd_write_ack.port_number = raw->msg[idx] & 0xf; drm_dp_sideband_parse_remote_dpcd_write()
456 repmsg->u.remote_i2c_read_ack.port_number = (raw->msg[idx] & 0xf); drm_dp_sideband_parse_remote_i2c_read_ack()
460 repmsg->u.remote_i2c_read_ack.num_bytes = raw->msg[idx]; drm_dp_sideband_parse_remote_i2c_read_ack()
463 memcpy(repmsg->u.remote_i2c_read_ack.bytes, &raw->msg[idx], repmsg->u.remote_i2c_read_ack.num_bytes); drm_dp_sideband_parse_remote_i2c_read_ack()
474 repmsg->u.path_resources.port_number = (raw->msg[idx] >> 4) & 0xf; drm_dp_sideband_parse_enum_path_resources_ack()
478 repmsg->u.path_resources.full_payload_bw_number = (raw->msg[idx] << 8) | (raw->msg[idx+1]); drm_dp_sideband_parse_enum_path_resources_ack()
482 repmsg->u.path_resources.avail_payload_bw_number = (raw->msg[idx] << 8) | (raw->msg[idx+1]); drm_dp_sideband_parse_enum_path_resources_ack()
496 repmsg->u.allocate_payload.port_number = (raw->msg[idx] >> 4) & 0xf; drm_dp_sideband_parse_allocate_payload_ack()
500 repmsg->u.allocate_payload.vcpi = raw->msg[idx]; drm_dp_sideband_parse_allocate_payload_ack()
504 repmsg->u.allocate_payload.allocated_pbn = (raw->msg[idx] << 8) | (raw->msg[idx+1]); drm_dp_sideband_parse_allocate_payload_ack()
518 repmsg->u.query_payload.port_number = (raw->msg[idx] >> 4) & 0xf; drm_dp_sideband_parse_query_payload_ack()
522 repmsg->u.query_payload.allocated_pbn = (raw->msg[idx] << 8) | (raw->msg[idx + 1]); drm_dp_sideband_parse_query_payload_ack()
533 struct drm_dp_sideband_msg_reply_body *msg) drm_dp_sideband_parse_reply()
535 memset(msg, 0, sizeof(*msg)); drm_dp_sideband_parse_reply()
536 msg->reply_type = (raw->msg[0] & 0x80) >> 7; drm_dp_sideband_parse_reply()
537 msg->req_type = (raw->msg[0] & 0x7f); drm_dp_sideband_parse_reply()
539 if (msg->reply_type) { drm_dp_sideband_parse_reply()
540 memcpy(msg->u.nak.guid, &raw->msg[1], 16); drm_dp_sideband_parse_reply()
541 msg->u.nak.reason = raw->msg[17]; drm_dp_sideband_parse_reply()
542 msg->u.nak.nak_data = raw->msg[18]; drm_dp_sideband_parse_reply()
546 switch (msg->req_type) { drm_dp_sideband_parse_reply()
548 return drm_dp_sideband_parse_link_address(raw, msg); drm_dp_sideband_parse_reply()
550 return drm_dp_sideband_parse_query_payload_ack(raw, msg); drm_dp_sideband_parse_reply()
552 return drm_dp_sideband_parse_remote_dpcd_read(raw, msg); drm_dp_sideband_parse_reply()
554 return drm_dp_sideband_parse_remote_dpcd_write(raw, msg); drm_dp_sideband_parse_reply()
556 return drm_dp_sideband_parse_remote_i2c_read_ack(raw, msg); drm_dp_sideband_parse_reply()
558 return drm_dp_sideband_parse_enum_path_resources_ack(raw, msg); drm_dp_sideband_parse_reply()
560 return drm_dp_sideband_parse_allocate_payload_ack(raw, msg); drm_dp_sideband_parse_reply()
562 DRM_ERROR("Got unknown reply 0x%02x\n", msg->req_type); drm_dp_sideband_parse_reply()
568 struct drm_dp_sideband_msg_req_body *msg) drm_dp_sideband_parse_connection_status_notify()
572 msg->u.conn_stat.port_number = (raw->msg[idx] & 0xf0) >> 4; drm_dp_sideband_parse_connection_status_notify()
577 memcpy(msg->u.conn_stat.guid, &raw->msg[idx], 16); drm_dp_sideband_parse_connection_status_notify()
582 msg->u.conn_stat.legacy_device_plug_status = (raw->msg[idx] >> 6) & 0x1; drm_dp_sideband_parse_connection_status_notify()
583 msg->u.conn_stat.displayport_device_plug_status = (raw->msg[idx] >> 5) & 0x1; drm_dp_sideband_parse_connection_status_notify()
584 msg->u.conn_stat.message_capability_status = (raw->msg[idx] >> 4) & 0x1; drm_dp_sideband_parse_connection_status_notify()
585 msg->u.conn_stat.input_port = (raw->msg[idx] >> 3) & 0x1; drm_dp_sideband_parse_connection_status_notify()
586 msg->u.conn_stat.peer_device_type = (raw->msg[idx] & 0x7); drm_dp_sideband_parse_connection_status_notify()
595 struct drm_dp_sideband_msg_req_body *msg) drm_dp_sideband_parse_resource_status_notify()
599 msg->u.resource_stat.port_number = (raw->msg[idx] & 0xf0) >> 4; drm_dp_sideband_parse_resource_status_notify()
604 memcpy(msg->u.resource_stat.guid, &raw->msg[idx], 16); drm_dp_sideband_parse_resource_status_notify()
609 msg->u.resource_stat.available_pbn = (raw->msg[idx] << 8) | (raw->msg[idx + 1]); drm_dp_sideband_parse_resource_status_notify()
618 struct drm_dp_sideband_msg_req_body *msg) drm_dp_sideband_parse_req()
620 memset(msg, 0, sizeof(*msg)); drm_dp_sideband_parse_req()
621 msg->req_type = (raw->msg[0] & 0x7f); drm_dp_sideband_parse_req()
623 switch (msg->req_type) { drm_dp_sideband_parse_req()
625 return drm_dp_sideband_parse_connection_status_notify(raw, msg); drm_dp_sideband_parse_req()
627 return drm_dp_sideband_parse_resource_status_notify(raw, msg); drm_dp_sideband_parse_req()
629 DRM_ERROR("Got unknown request 0x%02x\n", msg->req_type); drm_dp_sideband_parse_req()
634 static int build_dpcd_write(struct drm_dp_sideband_msg_tx *msg, u8 port_num, u32 offset, u8 num_bytes, u8 *bytes) build_dpcd_write() argument
643 drm_dp_encode_sideband_req(&req, msg); build_dpcd_write()
648 static int build_link_address(struct drm_dp_sideband_msg_tx *msg) build_link_address() argument
653 drm_dp_encode_sideband_req(&req, msg); build_link_address()
657 static int build_enum_path_resources(struct drm_dp_sideband_msg_tx *msg, int port_num) build_enum_path_resources() argument
663 drm_dp_encode_sideband_req(&req, msg); build_enum_path_resources()
664 msg->path_msg = true; build_enum_path_resources()
668 static int build_allocate_payload(struct drm_dp_sideband_msg_tx *msg, int port_num, build_allocate_payload() argument
677 drm_dp_encode_sideband_req(&req, msg); build_allocate_payload()
678 msg->path_msg = true; build_allocate_payload()
763 DRM_DEBUG_KMS("timedout msg send %p %d %d\n", txmsg, txmsg->state, txmsg->seqno); drm_dp_mst_wait_tx_reply()
838 /* drop any tx slots msg */ drm_dp_destroy_mst_branch_device()
1342 static int build_dpcd_read(struct drm_dp_sideband_msg_tx *msg, u8 port_num, u32 offset, u8 num_bytes)
1350 drm_dp_encode_sideband_req(&req, msg);
1357 bool up, u8 *msg, int len) drm_dp_send_sideband_msg()
1371 &msg[offset], drm_dp_send_sideband_msg()
1394 /* both msg slots are full */ set_hdr_from_dst_qlock()
1410 req_type = txmsg->msg[0] & 0x7f; set_hdr_from_dst_qlock()
1452 /* 48 - sideband msg size - 1 byte for data CRC, x header bytes */ process_single_tx_qlock()
1464 memcpy(&chunk[idx], &txmsg->msg[txmsg->cur_offset], tosend); process_single_tx_qlock()
1471 DRM_DEBUG_KMS("sideband msg failed to send\n"); process_single_tx_qlock()
1490 /* construct a chunk from the first msg in the tx_msg queue */ process_single_down_tx_qlock()
1503 DRM_DEBUG_KMS("failed to send msg in q %d\n", ret); process_single_down_tx_qlock()
1522 /* construct a chunk from the first msg in the tx_msg queue */ process_single_up_tx_qlock()
1526 DRM_DEBUG_KMS("failed to send msg in q %d\n", ret); process_single_up_tx_qlock()
1944 static int drm_dp_encode_up_ack_reply(struct drm_dp_sideband_msg_tx *msg, u8 req_type) drm_dp_encode_up_ack_reply() argument
1950 drm_dp_encode_sideband_reply(&reply, msg); drm_dp_encode_up_ack_reply()
2169 struct drm_dp_sideband_msg_rx *msg; drm_dp_get_one_sb_msg() local
2171 msg = up ? &mgr->up_req_recv : &mgr->down_rep_recv; drm_dp_get_one_sb_msg()
2180 ret = drm_dp_sideband_msg_build(msg, replyblock, len, true); drm_dp_get_one_sb_msg()
2182 DRM_DEBUG_KMS("sideband msg build failed %d\n", replyblock[0]); drm_dp_get_one_sb_msg()
2185 replylen = msg->curchunk_len + msg->curchunk_hdrlen; drm_dp_get_one_sb_msg()
2197 ret = drm_dp_sideband_msg_build(msg, replyblock, len, false); drm_dp_get_one_sb_msg()
2199 DRM_DEBUG_KMS("failed to build sideband msg\n"); drm_dp_get_one_sb_msg()
2233 DRM_DEBUG_KMS("Got MST reply with no msg %p %d %d %02x %02x\n", drm_dp_mst_handle_down_rep()
2238 mgr->down_rep_recv.msg[0]); drm_dp_mst_handle_down_rep()
2268 struct drm_dp_sideband_msg_req_body msg; drm_dp_mst_handle_up_req() local
2284 drm_dp_sideband_parse_req(&mgr->up_req_recv, &msg); drm_dp_mst_handle_up_req()
2286 if (msg.req_type == DP_CONNECTION_STATUS_NOTIFY) { drm_dp_mst_handle_up_req()
2287 drm_dp_send_up_ack_reply(mgr, mgr->mst_primary, msg.req_type, seqno, false); drm_dp_mst_handle_up_req()
2290 mstb = drm_dp_get_mst_branch_device_by_guid(mgr, msg.u.conn_stat.guid); drm_dp_mst_handle_up_req()
2298 drm_dp_update_port(mstb, &msg.u.conn_stat); drm_dp_mst_handle_up_req()
2300 DRM_DEBUG_KMS("Got CSN: pn: %d ldps:%d ddps: %d mcs: %d ip: %d pdt: %d\n", msg.u.conn_stat.port_number, msg.u.conn_stat.legacy_device_plug_status, msg.u.conn_stat.displayport_device_plug_status, msg.u.conn_stat.message_capability_status, msg.u.conn_stat.input_port, msg.u.conn_stat.peer_device_type); drm_dp_mst_handle_up_req()
2303 } else if (msg.req_type == DP_RESOURCE_STATUS_NOTIFY) { drm_dp_mst_handle_up_req()
2304 drm_dp_send_up_ack_reply(mgr, mgr->mst_primary, msg.req_type, seqno, false); drm_dp_mst_handle_up_req()
2306 mstb = drm_dp_get_mst_branch_device_by_guid(mgr, msg.u.resource_stat.guid); drm_dp_mst_handle_up_req()
2314 DRM_DEBUG_KMS("Got RSN: pn: %d avail_pbn %d\n", msg.u.resource_stat.port_number, msg.u.resource_stat.available_pbn); drm_dp_mst_handle_up_req()
2963 struct drm_dp_sideband_msg_req_body msg; drm_dp_mst_i2c_xfer() local
2971 /* construct i2c msg */ drm_dp_mst_i2c_xfer()
2972 /* see if last msg is a read */ drm_dp_mst_i2c_xfer()
2982 memset(&msg, 0, sizeof(msg)); drm_dp_mst_i2c_xfer()
2983 msg.req_type = DP_REMOTE_I2C_READ; drm_dp_mst_i2c_xfer()
2984 msg.u.i2c_read.num_transactions = num - 1; drm_dp_mst_i2c_xfer()
2985 msg.u.i2c_read.port_number = port->port_num; drm_dp_mst_i2c_xfer()
2987 msg.u.i2c_read.transactions[i].i2c_dev_id = msgs[i].addr; drm_dp_mst_i2c_xfer()
2988 msg.u.i2c_read.transactions[i].num_bytes = msgs[i].len; drm_dp_mst_i2c_xfer()
2989 msg.u.i2c_read.transactions[i].bytes = msgs[i].buf; drm_dp_mst_i2c_xfer()
2991 msg.u.i2c_read.read_i2c_device_id = msgs[num - 1].addr; drm_dp_mst_i2c_xfer()
2992 msg.u.i2c_read.num_bytes_read = msgs[num - 1].len; drm_dp_mst_i2c_xfer()
3001 drm_dp_encode_sideband_req(&msg, txmsg); drm_dp_mst_i2c_xfer()
532 drm_dp_sideband_parse_reply(struct drm_dp_sideband_msg_rx *raw, struct drm_dp_sideband_msg_reply_body *msg) drm_dp_sideband_parse_reply() argument
567 drm_dp_sideband_parse_connection_status_notify(struct drm_dp_sideband_msg_rx *raw, struct drm_dp_sideband_msg_req_body *msg) drm_dp_sideband_parse_connection_status_notify() argument
594 drm_dp_sideband_parse_resource_status_notify(struct drm_dp_sideband_msg_rx *raw, struct drm_dp_sideband_msg_req_body *msg) drm_dp_sideband_parse_resource_status_notify() argument
617 drm_dp_sideband_parse_req(struct drm_dp_sideband_msg_rx *raw, struct drm_dp_sideband_msg_req_body *msg) drm_dp_sideband_parse_req() argument
1356 drm_dp_send_sideband_msg(struct drm_dp_mst_topology_mgr *mgr, bool up, u8 *msg, int len) drm_dp_send_sideband_msg() argument
H A Ddrm_mipi_dsi.c235 struct mipi_dsi_msg *msg) mipi_dsi_device_transfer()
243 msg->flags |= MIPI_DSI_MSG_USE_LPM; mipi_dsi_device_transfer()
245 return ops->transfer(dsi->host, msg); mipi_dsi_device_transfer()
319 * @msg: message to translate into a packet
324 const struct mipi_dsi_msg *msg) mipi_dsi_create_packet()
326 if (!packet || !msg) mipi_dsi_create_packet()
330 if (!mipi_dsi_packet_format_is_short(msg->type) && mipi_dsi_create_packet()
331 !mipi_dsi_packet_format_is_long(msg->type)) mipi_dsi_create_packet()
334 if (msg->channel > 3) mipi_dsi_create_packet()
338 packet->header[0] = ((msg->channel & 0x3) << 6) | (msg->type & 0x3f); mipi_dsi_create_packet()
349 if (mipi_dsi_packet_format_is_long(msg->type)) { mipi_dsi_create_packet()
350 packet->header[1] = (msg->tx_len >> 0) & 0xff; mipi_dsi_create_packet()
351 packet->header[2] = (msg->tx_len >> 8) & 0xff; mipi_dsi_create_packet()
353 packet->payload_length = msg->tx_len; mipi_dsi_create_packet()
354 packet->payload = msg->tx_buf; mipi_dsi_create_packet()
356 const u8 *tx = msg->tx_buf; mipi_dsi_create_packet()
358 packet->header[1] = (msg->tx_len > 0) ? tx[0] : 0; mipi_dsi_create_packet()
359 packet->header[2] = (msg->tx_len > 1) ? tx[1] : 0; mipi_dsi_create_packet()
381 struct mipi_dsi_msg msg = { mipi_dsi_set_maximum_return_packet_size() local
388 return mipi_dsi_device_transfer(dsi, &msg); mipi_dsi_set_maximum_return_packet_size()
407 struct mipi_dsi_msg msg = { mipi_dsi_generic_write() local
415 msg.type = MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM; mipi_dsi_generic_write()
419 msg.type = MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM; mipi_dsi_generic_write()
423 msg.type = MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM; mipi_dsi_generic_write()
427 msg.type = MIPI_DSI_GENERIC_LONG_WRITE; mipi_dsi_generic_write()
431 return mipi_dsi_device_transfer(dsi, &msg); mipi_dsi_generic_write()
452 struct mipi_dsi_msg msg = { mipi_dsi_generic_read() local
462 msg.type = MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM; mipi_dsi_generic_read()
466 msg.type = MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM; mipi_dsi_generic_read()
470 msg.type = MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM; mipi_dsi_generic_read()
477 return mipi_dsi_device_transfer(dsi, &msg); mipi_dsi_generic_read()
496 struct mipi_dsi_msg msg = { mipi_dsi_dcs_write_buffer() local
507 msg.type = MIPI_DSI_DCS_SHORT_WRITE; mipi_dsi_dcs_write_buffer()
511 msg.type = MIPI_DSI_DCS_SHORT_WRITE_PARAM; mipi_dsi_dcs_write_buffer()
515 msg.type = MIPI_DSI_DCS_LONG_WRITE; mipi_dsi_dcs_write_buffer()
519 return mipi_dsi_device_transfer(dsi, &msg); mipi_dsi_dcs_write_buffer()
579 struct mipi_dsi_msg msg = { mipi_dsi_dcs_read() local
588 return mipi_dsi_device_transfer(dsi, &msg); mipi_dsi_dcs_read()
234 mipi_dsi_device_transfer(struct mipi_dsi_device *dsi, struct mipi_dsi_msg *msg) mipi_dsi_device_transfer() argument
323 mipi_dsi_create_packet(struct mipi_dsi_packet *packet, const struct mipi_dsi_msg *msg) mipi_dsi_create_packet() argument
/linux-4.4.14/drivers/media/tuners/
H A Dtda827x.c137 struct i2c_msg *msg, tuner_transfer()
145 rc = i2c_transfer(priv->i2c_adap, msg, size); tuner_transfer()
162 struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0, tda827xo_set_params() local
206 msg.len = 14; tda827xo_set_params()
207 rc = tuner_transfer(fe, &msg, 1); tda827xo_set_params()
215 msg.len = 2; tda827xo_set_params()
217 rc = tuner_transfer(fe, &msg, 1); tda827xo_set_params()
236 struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0, tda827xo_sleep() local
240 tuner_transfer(fe, &msg, 1); tda827xo_sleep()
258 struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0 }; tda827xo_set_analog_params() local
288 msg.buf = tuner_reg; tda827xo_set_analog_params()
289 msg.len = 8; tda827xo_set_analog_params()
290 tuner_transfer(fe, &msg, 1); tda827xo_set_analog_params()
292 msg.buf = reg2; tda827xo_set_analog_params()
293 msg.len = 2; tda827xo_set_analog_params()
296 tuner_transfer(fe, &msg, 1); tda827xo_set_analog_params()
300 tuner_transfer(fe, &msg, 1); tda827xo_set_analog_params()
304 tuner_transfer(fe, &msg, 1); tda827xo_set_analog_params()
309 tuner_transfer(fe, &msg, 1); tda827xo_set_analog_params()
314 tuner_transfer(fe, &msg, 1); tda827xo_set_analog_params()
319 tuner_transfer(fe, &msg, 1); tda827xo_set_analog_params()
323 tuner_transfer(fe, &msg, 1); tda827xo_set_analog_params()
327 tuner_transfer(fe, &msg, 1); tda827xo_set_analog_params()
338 struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0, tda827xo_agcf() local
341 tuner_transfer(fe, &msg, 1); tda827xo_agcf()
448 struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0, tda827xa_sleep() local
453 tuner_transfer(fe, &msg, 1); tda827xa_sleep()
468 struct i2c_msg msg = { .flags = 0, .buf = buf, .len = sizeof(buf) }; tda827xa_lna_gain() local
474 msg.addr = priv->cfg->switch_addr; tda827xa_lna_gain()
504 tuner_transfer(fe, &msg, 1); tda827xa_lna_gain()
521 struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0, tda827xa_set_params() local
575 msg.len = 11; tda827xa_set_params()
576 rc = tuner_transfer(fe, &msg, 1); tda827xa_set_params()
585 msg.len = 5; tda827xa_set_params()
586 rc = tuner_transfer(fe, &msg, 1); tda827xa_set_params()
592 msg.len = 2; tda827xa_set_params()
593 rc = tuner_transfer(fe, &msg, 1); tda827xa_set_params()
598 msg.flags = I2C_M_RD; tda827xa_set_params()
599 rc = tuner_transfer(fe, &msg, 1); tda827xa_set_params()
602 msg.flags = 0; tda827xa_set_params()
610 rc = tuner_transfer(fe, &msg, 1); tda827xa_set_params()
617 rc = tuner_transfer(fe, &msg, 1); tda827xa_set_params()
623 rc = tuner_transfer(fe, &msg, 1); tda827xa_set_params()
630 rc = tuner_transfer(fe, &msg, 1); tda827xa_set_params()
637 rc = tuner_transfer(fe, &msg, 1); tda827xa_set_params()
645 rc = tuner_transfer(fe, &msg, 1); tda827xa_set_params()
668 struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0, tda827xa_set_analog_params() local
704 msg.len = 11; tda827xa_set_analog_params()
705 tuner_transfer(fe, &msg, 1); tda827xa_set_analog_params()
712 msg.len = 5; tda827xa_set_analog_params()
713 tuner_transfer(fe, &msg, 1); tda827xa_set_analog_params()
717 msg.len = 2; tda827xa_set_analog_params()
718 tuner_transfer(fe, &msg, 1); tda827xa_set_analog_params()
722 tuner_transfer(fe, &msg, 1); tda827xa_set_analog_params()
724 msg.flags = I2C_M_RD; tda827xa_set_analog_params()
725 tuner_transfer(fe, &msg, 1); tda827xa_set_analog_params()
726 msg.flags = 0; tda827xa_set_analog_params()
735 tuner_transfer(fe, &msg, 1); tda827xa_set_analog_params()
740 tuner_transfer(fe, &msg, 1); tda827xa_set_analog_params()
744 tuner_transfer(fe, &msg, 1); tda827xa_set_analog_params()
748 tuner_transfer(fe, &msg, 1); tda827xa_set_analog_params()
752 tuner_transfer(fe, &msg, 1); tda827xa_set_analog_params()
763 struct i2c_msg msg = {.addr = priv->i2c_addr, .flags = 0, tda827xa_agcf() local
765 tuner_transfer(fe, &msg, 1); tda827xa_agcf()
858 struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = I2C_M_RD, tda827x_probe_version() local
861 rc = tuner_transfer(fe, &msg, 1); tda827x_probe_version()
865 __func__, msg.addr << 1); tda827x_probe_version()
136 tuner_transfer(struct dvb_frontend *fe, struct i2c_msg *msg, const int size) tuner_transfer() argument
/linux-4.4.14/net/wireless/
H A Dnl80211.c588 static int nl80211_msg_put_channel(struct sk_buff *msg, nl80211_msg_put_channel() argument
599 if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_FREQ, nl80211_msg_put_channel()
604 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_DISABLED)) nl80211_msg_put_channel()
607 if (nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_IR)) nl80211_msg_put_channel()
609 if (nla_put_flag(msg, __NL80211_FREQUENCY_ATTR_NO_IBSS)) nl80211_msg_put_channel()
613 if (nla_put_flag(msg, NL80211_FREQUENCY_ATTR_RADAR)) nl80211_msg_put_channel()
620 if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_DFS_STATE, nl80211_msg_put_channel()
623 if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_DFS_TIME, nl80211_msg_put_channel()
626 if (nla_put_u32(msg, nl80211_msg_put_channel()
635 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_HT40_MINUS)) nl80211_msg_put_channel()
638 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_HT40_PLUS)) nl80211_msg_put_channel()
641 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_80MHZ)) nl80211_msg_put_channel()
644 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_160MHZ)) nl80211_msg_put_channel()
647 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_INDOOR_ONLY)) nl80211_msg_put_channel()
650 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_IR_CONCURRENT)) nl80211_msg_put_channel()
653 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_20MHZ)) nl80211_msg_put_channel()
656 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_10MHZ)) nl80211_msg_put_channel()
660 if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_MAX_TX_POWER, nl80211_msg_put_channel()
925 static int nl80211_put_iftypes(struct sk_buff *msg, u32 attr, u16 ifmodes) nl80211_put_iftypes() argument
927 struct nlattr *nl_modes = nla_nest_start(msg, attr); nl80211_put_iftypes()
935 if ((ifmodes & 1) && nla_put_flag(msg, i)) nl80211_put_iftypes()
941 nla_nest_end(msg, nl_modes); nl80211_put_iftypes()
949 struct sk_buff *msg, nl80211_put_iface_combinations()
955 nl_combis = nla_nest_start(msg, nl80211_put_iface_combinations()
966 nl_combi = nla_nest_start(msg, i + 1); nl80211_put_iface_combinations()
970 nl_limits = nla_nest_start(msg, NL80211_IFACE_COMB_LIMITS); nl80211_put_iface_combinations()
977 nl_limit = nla_nest_start(msg, j + 1); nl80211_put_iface_combinations()
980 if (nla_put_u32(msg, NL80211_IFACE_LIMIT_MAX, nl80211_put_iface_combinations()
983 if (nl80211_put_iftypes(msg, NL80211_IFACE_LIMIT_TYPES, nl80211_put_iface_combinations()
986 nla_nest_end(msg, nl_limit); nl80211_put_iface_combinations()
989 nla_nest_end(msg, nl_limits); nl80211_put_iface_combinations()
992 nla_put_flag(msg, NL80211_IFACE_COMB_STA_AP_BI_MATCH)) nl80211_put_iface_combinations()
994 if (nla_put_u32(msg, NL80211_IFACE_COMB_NUM_CHANNELS, nl80211_put_iface_combinations()
996 nla_put_u32(msg, NL80211_IFACE_COMB_MAXNUM, nl80211_put_iface_combinations()
1000 (nla_put_u32(msg, NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS, nl80211_put_iface_combinations()
1002 nla_put_u32(msg, NL80211_IFACE_COMB_RADAR_DETECT_REGIONS, nl80211_put_iface_combinations()
1006 nla_nest_end(msg, nl_combi); nl80211_put_iface_combinations()
1009 nla_nest_end(msg, nl_combis); nl80211_put_iface_combinations()
1018 struct sk_buff *msg) nl80211_send_wowlan_tcp_caps()
1026 nl_tcp = nla_nest_start(msg, NL80211_WOWLAN_TRIG_TCP_CONNECTION); nl80211_send_wowlan_tcp_caps()
1030 if (nla_put_u32(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD, nl80211_send_wowlan_tcp_caps()
1034 if (nla_put_u32(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD, nl80211_send_wowlan_tcp_caps()
1038 if (tcp->seq && nla_put_flag(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ)) nl80211_send_wowlan_tcp_caps()
1041 if (tcp->tok && nla_put(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN, nl80211_send_wowlan_tcp_caps()
1045 if (nla_put_u32(msg, NL80211_WOWLAN_TCP_DATA_INTERVAL, nl80211_send_wowlan_tcp_caps()
1049 if (nla_put_u32(msg, NL80211_WOWLAN_TCP_WAKE_PAYLOAD, nl80211_send_wowlan_tcp_caps()
1053 nla_nest_end(msg, nl_tcp); nl80211_send_wowlan_tcp_caps()
1057 static int nl80211_send_wowlan(struct sk_buff *msg, nl80211_send_wowlan() argument
1066 nl_wowlan = nla_nest_start(msg, NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED); nl80211_send_wowlan()
1071 nla_put_flag(msg, NL80211_WOWLAN_TRIG_ANY)) || nl80211_send_wowlan()
1073 nla_put_flag(msg, NL80211_WOWLAN_TRIG_DISCONNECT)) || nl80211_send_wowlan()
1075 nla_put_flag(msg, NL80211_WOWLAN_TRIG_MAGIC_PKT)) || nl80211_send_wowlan()
1077 nla_put_flag(msg, NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED)) || nl80211_send_wowlan()
1079 nla_put_flag(msg, NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE)) || nl80211_send_wowlan()
1081 nla_put_flag(msg, NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST)) || nl80211_send_wowlan()
1083 nla_put_flag(msg, NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE)) || nl80211_send_wowlan()
1085 nla_put_flag(msg, NL80211_WOWLAN_TRIG_RFKILL_RELEASE))) nl80211_send_wowlan()
1096 if (nla_put(msg, NL80211_WOWLAN_TRIG_PKT_PATTERN, nl80211_send_wowlan()
1102 nla_put_u32(msg, NL80211_WOWLAN_TRIG_NET_DETECT, nl80211_send_wowlan()
1106 if (large && nl80211_send_wowlan_tcp_caps(rdev, msg)) nl80211_send_wowlan()
1109 nla_nest_end(msg, nl_wowlan); nl80211_send_wowlan()
1115 static int nl80211_send_coalesce(struct sk_buff *msg, nl80211_send_coalesce() argument
1130 if (nla_put(msg, NL80211_ATTR_COALESCE_RULE, sizeof(rule), &rule)) nl80211_send_coalesce()
1136 static int nl80211_send_band_rateinfo(struct sk_buff *msg, nl80211_send_band_rateinfo() argument
1145 (nla_put(msg, NL80211_BAND_ATTR_HT_MCS_SET, nl80211_send_band_rateinfo()
1148 nla_put_u16(msg, NL80211_BAND_ATTR_HT_CAPA, nl80211_send_band_rateinfo()
1150 nla_put_u8(msg, NL80211_BAND_ATTR_HT_AMPDU_FACTOR, nl80211_send_band_rateinfo()
1152 nla_put_u8(msg, NL80211_BAND_ATTR_HT_AMPDU_DENSITY, nl80211_send_band_rateinfo()
1158 (nla_put(msg, NL80211_BAND_ATTR_VHT_MCS_SET, nl80211_send_band_rateinfo()
1161 nla_put_u32(msg, NL80211_BAND_ATTR_VHT_CAPA, nl80211_send_band_rateinfo()
1166 nl_rates = nla_nest_start(msg, NL80211_BAND_ATTR_RATES); nl80211_send_band_rateinfo()
1171 nl_rate = nla_nest_start(msg, i); nl80211_send_band_rateinfo()
1176 if (nla_put_u32(msg, NL80211_BITRATE_ATTR_RATE, nl80211_send_band_rateinfo()
1180 nla_put_flag(msg, nl80211_send_band_rateinfo()
1184 nla_nest_end(msg, nl_rate); nl80211_send_band_rateinfo()
1187 nla_nest_end(msg, nl_rates); nl80211_send_band_rateinfo()
1193 nl80211_send_mgmt_stypes(struct sk_buff *msg, nl80211_send_mgmt_stypes() argument
1204 nl_ifs = nla_nest_start(msg, NL80211_ATTR_TX_FRAME_TYPES); nl80211_send_mgmt_stypes()
1209 nl_ftypes = nla_nest_start(msg, ift); nl80211_send_mgmt_stypes()
1216 nla_put_u16(msg, NL80211_ATTR_FRAME_TYPE, nl80211_send_mgmt_stypes()
1222 nla_nest_end(msg, nl_ftypes); nl80211_send_mgmt_stypes()
1225 nla_nest_end(msg, nl_ifs); nl80211_send_mgmt_stypes()
1227 nl_ifs = nla_nest_start(msg, NL80211_ATTR_RX_FRAME_TYPES); nl80211_send_mgmt_stypes()
1232 nl_ftypes = nla_nest_start(msg, ift); nl80211_send_mgmt_stypes()
1239 nla_put_u16(msg, NL80211_ATTR_FRAME_TYPE, nl80211_send_mgmt_stypes()
1245 nla_nest_end(msg, nl_ftypes); nl80211_send_mgmt_stypes()
1247 nla_nest_end(msg, nl_ifs); nl80211_send_mgmt_stypes()
1261 struct sk_buff *msg, u32 portid, u32 seq, nl80211_send_wiphy()
1275 hdr = nl80211hdr_put(msg, portid, seq, flags, cmd); nl80211_send_wiphy()
1282 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || nl80211_send_wiphy()
1283 nla_put_string(msg, NL80211_ATTR_WIPHY_NAME, nl80211_send_wiphy()
1285 nla_put_u32(msg, NL80211_ATTR_GENERATION, nl80211_send_wiphy()
1294 if (nla_put_u8(msg, NL80211_ATTR_WIPHY_RETRY_SHORT, nl80211_send_wiphy()
1296 nla_put_u8(msg, NL80211_ATTR_WIPHY_RETRY_LONG, nl80211_send_wiphy()
1298 nla_put_u32(msg, NL80211_ATTR_WIPHY_FRAG_THRESHOLD, nl80211_send_wiphy()
1300 nla_put_u32(msg, NL80211_ATTR_WIPHY_RTS_THRESHOLD, nl80211_send_wiphy()
1302 nla_put_u8(msg, NL80211_ATTR_WIPHY_COVERAGE_CLASS, nl80211_send_wiphy()
1304 nla_put_u8(msg, NL80211_ATTR_MAX_NUM_SCAN_SSIDS, nl80211_send_wiphy()
1306 nla_put_u8(msg, NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS, nl80211_send_wiphy()
1308 nla_put_u16(msg, NL80211_ATTR_MAX_SCAN_IE_LEN, nl80211_send_wiphy()
1310 nla_put_u16(msg, NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN, nl80211_send_wiphy()
1312 nla_put_u8(msg, NL80211_ATTR_MAX_MATCH_SETS, nl80211_send_wiphy()
1314 nla_put_u32(msg, NL80211_ATTR_MAX_NUM_SCHED_SCAN_PLANS, nl80211_send_wiphy()
1316 nla_put_u32(msg, NL80211_ATTR_MAX_SCAN_PLAN_INTERVAL, nl80211_send_wiphy()
1318 nla_put_u32(msg, NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS, nl80211_send_wiphy()
1323 nla_put_flag(msg, NL80211_ATTR_SUPPORT_IBSS_RSN)) nl80211_send_wiphy()
1326 nla_put_flag(msg, NL80211_ATTR_SUPPORT_MESH_AUTH)) nl80211_send_wiphy()
1329 nla_put_flag(msg, NL80211_ATTR_SUPPORT_AP_UAPSD)) nl80211_send_wiphy()
1332 nla_put_flag(msg, NL80211_ATTR_ROAM_SUPPORT)) nl80211_send_wiphy()
1335 nla_put_flag(msg, NL80211_ATTR_TDLS_SUPPORT)) nl80211_send_wiphy()
1338 nla_put_flag(msg, NL80211_ATTR_TDLS_EXTERNAL_SETUP)) nl80211_send_wiphy()
1344 if (nla_put(msg, NL80211_ATTR_CIPHER_SUITES, nl80211_send_wiphy()
1349 if (nla_put_u8(msg, NL80211_ATTR_MAX_NUM_PMKIDS, nl80211_send_wiphy()
1354 nla_put_flag(msg, NL80211_ATTR_CONTROL_PORT_ETHERTYPE)) nl80211_send_wiphy()
1357 if (nla_put_u32(msg, NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX, nl80211_send_wiphy()
1359 nla_put_u32(msg, NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX, nl80211_send_wiphy()
1364 nla_put_u32(msg, NL80211_ATTR_PROBE_RESP_OFFLOAD, nl80211_send_wiphy()
1375 if (nla_put_u32(msg, nl80211_send_wiphy()
1378 nla_put_u32(msg, nl80211_send_wiphy()
1389 if (nl80211_put_iftypes(msg, NL80211_ATTR_SUPPORTED_IFTYPES, nl80211_send_wiphy()
1396 nl_bands = nla_nest_start(msg, NL80211_ATTR_WIPHY_BANDS); nl80211_send_wiphy()
1409 nl_band = nla_nest_start(msg, band); nl80211_send_wiphy()
1415 if (nl80211_send_band_rateinfo(msg, sband)) nl80211_send_wiphy()
1423 msg, NL80211_BAND_ATTR_FREQS); nl80211_send_wiphy()
1430 nl_freq = nla_nest_start(msg, i); nl80211_send_wiphy()
1437 msg, chan, nl80211_send_wiphy()
1441 nla_nest_end(msg, nl_freq); nl80211_send_wiphy()
1449 nla_nest_end(msg, nl_freqs); nl80211_send_wiphy()
1452 nla_nest_end(msg, nl_band); nl80211_send_wiphy()
1461 nla_nest_end(msg, nl_bands); nl80211_send_wiphy()
1474 nl_cmds = nla_nest_start(msg, NL80211_ATTR_SUPPORTED_COMMANDS); nl80211_send_wiphy()
1483 if (nla_put_u32(msg, i, NL80211_CMD_ ## n)) \ nl80211_send_wiphy()
1512 if (nla_put_u32(msg, i, NL80211_CMD_SET_WIPHY_NETNS)) nl80211_send_wiphy()
1518 if (nla_put_u32(msg, i, NL80211_CMD_SET_CHANNEL)) nl80211_send_wiphy()
1532 if (nla_put_u32(msg, i, NL80211_CMD_REGISTER_BEACONS)) nl80211_send_wiphy()
1555 if (nla_put_u32(msg, i, NL80211_CMD_CONNECT)) nl80211_send_wiphy()
1561 if (nla_put_u32(msg, i, NL80211_CMD_DISCONNECT)) nl80211_send_wiphy()
1565 nla_nest_end(msg, nl_cmds); nl80211_send_wiphy()
1572 nla_put_u32(msg, nl80211_send_wiphy()
1578 nla_put_flag(msg, NL80211_ATTR_OFFCHANNEL_TX_OK)) nl80211_send_wiphy()
1581 if (nl80211_send_mgmt_stypes(msg, mgmt_stypes)) nl80211_send_wiphy()
1588 if (nl80211_send_wowlan(msg, rdev, state->split)) nl80211_send_wiphy()
1597 if (nl80211_put_iftypes(msg, NL80211_ATTR_SOFTWARE_IFTYPES, nl80211_send_wiphy()
1601 if (nl80211_put_iface_combinations(&rdev->wiphy, msg, nl80211_send_wiphy()
1610 nla_put_u32(msg, NL80211_ATTR_DEVICE_AP_SME, nl80211_send_wiphy()
1622 if (nla_put_u32(msg, NL80211_ATTR_FEATURE_FLAGS, features)) nl80211_send_wiphy()
1626 nla_put(msg, NL80211_ATTR_HT_CAPABILITY_MASK, nl80211_send_wiphy()
1633 nla_put_u32(msg, NL80211_ATTR_MAC_ACL_MAX, nl80211_send_wiphy()
1651 (nla_put(msg, NL80211_ATTR_EXT_CAPA, nl80211_send_wiphy()
1654 nla_put(msg, NL80211_ATTR_EXT_CAPA_MASK, nl80211_send_wiphy()
1660 nla_put(msg, NL80211_ATTR_VHT_CAPABILITY_MASK, nl80211_send_wiphy()
1668 if (nl80211_send_coalesce(msg, rdev)) nl80211_send_wiphy()
1672 (nla_put_flag(msg, NL80211_ATTR_SUPPORT_5_MHZ) || nl80211_send_wiphy()
1673 nla_put_flag(msg, NL80211_ATTR_SUPPORT_10_MHZ))) nl80211_send_wiphy()
1677 nla_put_u32(msg, NL80211_ATTR_MAX_AP_ASSOC_STA, nl80211_send_wiphy()
1688 nested = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA); nl80211_send_wiphy()
1694 if (nla_put(msg, i + 1, sizeof(*info), info)) nl80211_send_wiphy()
1697 nla_nest_end(msg, nested); nl80211_send_wiphy()
1704 nested = nla_nest_start(msg, nl80211_send_wiphy()
1711 if (nla_put(msg, i + 1, sizeof(*info), info)) nl80211_send_wiphy()
1714 nla_nest_end(msg, nested); nl80211_send_wiphy()
1720 nla_put_u8(msg, NL80211_ATTR_MAX_CSA_COUNTERS, nl80211_send_wiphy()
1725 nla_put_flag(msg, NL80211_ATTR_WIPHY_SELF_MANAGED_REG)) nl80211_send_wiphy()
1728 if (nla_put(msg, NL80211_ATTR_EXT_FEATURES, nl80211_send_wiphy()
1738 genlmsg_end(msg, hdr); nl80211_send_wiphy()
1742 genlmsg_cancel(msg, hdr); nl80211_send_wiphy()
1861 struct sk_buff *msg; nl80211_get_wiphy() local
1865 msg = nlmsg_new(4096, GFP_KERNEL); nl80211_get_wiphy()
1866 if (!msg) nl80211_get_wiphy()
1869 if (nl80211_send_wiphy(rdev, NL80211_CMD_NEW_WIPHY, msg, nl80211_get_wiphy()
1872 nlmsg_free(msg); nl80211_get_wiphy()
1876 return genlmsg_reply(msg, info); nl80211_get_wiphy()
2349 static int nl80211_send_chandef(struct sk_buff *msg, nl80211_send_chandef() argument
2355 if (nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, nl80211_send_chandef()
2362 if (nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, nl80211_send_chandef()
2369 if (nla_put_u32(msg, NL80211_ATTR_CHANNEL_WIDTH, chandef->width)) nl80211_send_chandef()
2371 if (nla_put_u32(msg, NL80211_ATTR_CENTER_FREQ1, chandef->center_freq1)) nl80211_send_chandef()
2374 nla_put_u32(msg, NL80211_ATTR_CENTER_FREQ2, chandef->center_freq2)) nl80211_send_chandef()
2379 static int nl80211_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flags, nl80211_send_iface() argument
2390 hdr = nl80211hdr_put(msg, portid, seq, flags, cmd); nl80211_send_iface()
2395 (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || nl80211_send_iface()
2396 nla_put_string(msg, NL80211_ATTR_IFNAME, dev->name))) nl80211_send_iface()
2399 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || nl80211_send_iface()
2400 nla_put_u32(msg, NL80211_ATTR_IFTYPE, wdev->iftype) || nl80211_send_iface()
2401 nla_put_u64(msg, NL80211_ATTR_WDEV, wdev_id(wdev)) || nl80211_send_iface()
2402 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, wdev_address(wdev)) || nl80211_send_iface()
2403 nla_put_u32(msg, NL80211_ATTR_GENERATION, nl80211_send_iface()
2414 if (nl80211_send_chandef(msg, &chandef)) nl80211_send_iface()
2424 nla_put_u32(msg, NL80211_ATTR_WIPHY_TX_POWER_LEVEL, nl80211_send_iface()
2430 if (nla_put(msg, NL80211_ATTR_SSID, wdev->ssid_len, wdev->ssid)) nl80211_send_iface()
2434 genlmsg_end(msg, hdr); nl80211_send_iface()
2438 genlmsg_cancel(msg, hdr); nl80211_send_iface()
2487 struct sk_buff *msg; nl80211_get_interface() local
2491 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_get_interface()
2492 if (!msg) nl80211_get_interface()
2495 if (nl80211_send_iface(msg, info->snd_portid, info->snd_seq, 0, nl80211_get_interface()
2497 nlmsg_free(msg); nl80211_get_interface()
2501 return genlmsg_reply(msg, info); nl80211_get_interface()
2642 struct sk_buff *msg, *event; nl80211_new_interface() local
2689 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_new_interface()
2690 if (!msg) nl80211_new_interface()
2698 nlmsg_free(msg); nl80211_new_interface()
2701 nlmsg_free(msg); nl80211_new_interface()
2740 if (nl80211_send_iface(msg, info->snd_portid, info->snd_seq, 0, nl80211_new_interface()
2742 nlmsg_free(msg); nl80211_new_interface()
2760 return genlmsg_reply(msg, info); nl80211_new_interface()
2767 struct sk_buff *msg; nl80211_del_interface() local
2773 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_del_interface()
2774 if (msg && nl80211_send_iface(msg, 0, 0, 0, rdev, wdev, true) < 0) { nl80211_del_interface()
2775 nlmsg_free(msg); nl80211_del_interface()
2776 msg = NULL; nl80211_del_interface()
2790 if (status >= 0 && msg) nl80211_del_interface()
2792 msg, 0, NL80211_MCGRP_CONFIG, nl80211_del_interface()
2795 nlmsg_free(msg); nl80211_del_interface()
2818 struct sk_buff *msg; member in struct:get_key_cookie
2829 nla_put(cookie->msg, NL80211_ATTR_KEY_DATA, get_key_callback()
2832 nla_put(cookie->msg, NL80211_ATTR_KEY_SEQ, get_key_callback()
2835 nla_put_u32(cookie->msg, NL80211_ATTR_KEY_CIPHER, get_key_callback()
2839 key = nla_nest_start(cookie->msg, NL80211_ATTR_KEY); get_key_callback()
2844 nla_put(cookie->msg, NL80211_KEY_DATA, get_key_callback()
2847 nla_put(cookie->msg, NL80211_KEY_SEQ, get_key_callback()
2850 nla_put_u32(cookie->msg, NL80211_KEY_CIPHER, get_key_callback()
2854 if (nla_put_u8(cookie->msg, NL80211_ATTR_KEY_IDX, cookie->idx)) get_key_callback()
2857 nla_nest_end(cookie->msg, key); get_key_callback()
2876 struct sk_buff *msg; nl80211_get_key() local
2904 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_get_key()
2905 if (!msg) nl80211_get_key()
2908 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, nl80211_get_key()
2913 cookie.msg = msg; nl80211_get_key()
2916 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || nl80211_get_key()
2917 nla_put_u8(msg, NL80211_ATTR_KEY_IDX, key_idx)) nl80211_get_key()
2920 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr)) nl80211_get_key()
2932 genlmsg_end(msg, hdr); nl80211_get_key()
2933 return genlmsg_reply(msg, info); nl80211_get_key()
2938 nlmsg_free(msg); nl80211_get_key()
3603 static bool nl80211_put_sta_rate(struct sk_buff *msg, struct rate_info *info, nl80211_put_sta_rate() argument
3611 rate = nla_nest_start(msg, attr); nl80211_put_sta_rate()
3620 nla_put_u32(msg, NL80211_RATE_INFO_BITRATE32, bitrate)) nl80211_put_sta_rate()
3623 nla_put_u16(msg, NL80211_RATE_INFO_BITRATE, bitrate_compat)) nl80211_put_sta_rate()
3650 if (rate_flg && nla_put_flag(msg, rate_flg)) nl80211_put_sta_rate()
3654 if (nla_put_u8(msg, NL80211_RATE_INFO_MCS, info->mcs)) nl80211_put_sta_rate()
3657 nla_put_flag(msg, NL80211_RATE_INFO_SHORT_GI)) nl80211_put_sta_rate()
3660 if (nla_put_u8(msg, NL80211_RATE_INFO_VHT_MCS, info->mcs)) nl80211_put_sta_rate()
3662 if (nla_put_u8(msg, NL80211_RATE_INFO_VHT_NSS, info->nss)) nl80211_put_sta_rate()
3665 nla_put_flag(msg, NL80211_RATE_INFO_SHORT_GI)) nl80211_put_sta_rate()
3669 nla_nest_end(msg, rate); nl80211_put_sta_rate()
3673 static bool nl80211_put_signal(struct sk_buff *msg, u8 mask, s8 *signal, nl80211_put_signal() argument
3682 attr = nla_nest_start(msg, id); nl80211_put_signal()
3690 if (nla_put_u8(msg, i, signal[i])) nl80211_put_signal()
3694 nla_nest_end(msg, attr); nl80211_put_signal()
3699 static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid, nl80211_send_station() argument
3708 hdr = nl80211hdr_put(msg, portid, seq, flags, cmd); nl80211_send_station()
3712 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || nl80211_send_station()
3713 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr) || nl80211_send_station()
3714 nla_put_u32(msg, NL80211_ATTR_GENERATION, sinfo->generation)) nl80211_send_station()
3717 sinfoattr = nla_nest_start(msg, NL80211_ATTR_STA_INFO); nl80211_send_station()
3723 nla_put_ ## type(msg, NL80211_STA_INFO_ ## attr, \ nl80211_send_station()
3733 nla_put_u32(msg, NL80211_STA_INFO_RX_BYTES, nl80211_send_station()
3739 nla_put_u32(msg, NL80211_STA_INFO_TX_BYTES, nl80211_send_station()
3758 if (!nl80211_put_signal(msg, sinfo->chains, nl80211_send_station()
3764 if (!nl80211_put_signal(msg, sinfo->chains, nl80211_send_station()
3770 if (!nl80211_put_sta_rate(msg, &sinfo->txrate, nl80211_send_station()
3775 if (!nl80211_put_sta_rate(msg, &sinfo->rxrate, nl80211_send_station()
3791 bss_param = nla_nest_start(msg, NL80211_STA_INFO_BSS_PARAM); nl80211_send_station()
3796 nla_put_flag(msg, NL80211_STA_BSS_PARAM_CTS_PROT)) || nl80211_send_station()
3798 nla_put_flag(msg, NL80211_STA_BSS_PARAM_SHORT_PREAMBLE)) || nl80211_send_station()
3800 nla_put_flag(msg, NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME)) || nl80211_send_station()
3801 nla_put_u8(msg, NL80211_STA_BSS_PARAM_DTIM_PERIOD, nl80211_send_station()
3803 nla_put_u16(msg, NL80211_STA_BSS_PARAM_BEACON_INTERVAL, nl80211_send_station()
3807 nla_nest_end(msg, bss_param); nl80211_send_station()
3810 nla_put(msg, NL80211_STA_INFO_STA_FLAGS, nl80211_send_station()
3826 tidsattr = nla_nest_start(msg, NL80211_STA_INFO_TID_STATS); nl80211_send_station()
3839 tidattr = nla_nest_start(msg, tid + 1); nl80211_send_station()
3845 nla_put_ ## type(msg, NL80211_TID_STATS_ ## attr, \ nl80211_send_station()
3856 nla_nest_end(msg, tidattr); nl80211_send_station()
3859 nla_nest_end(msg, tidsattr); nl80211_send_station()
3862 nla_nest_end(msg, sinfoattr); nl80211_send_station()
3865 nla_put(msg, NL80211_ATTR_IE, sinfo->assoc_req_ies_len, nl80211_send_station()
3869 genlmsg_end(msg, hdr); nl80211_send_station()
3873 genlmsg_cancel(msg, hdr); nl80211_send_station()
3935 struct sk_buff *msg; nl80211_get_station() local
3953 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_get_station()
3954 if (!msg) nl80211_get_station()
3957 if (nl80211_send_station(msg, NL80211_CMD_NEW_STATION, nl80211_get_station()
3960 nlmsg_free(msg); nl80211_get_station()
3964 return genlmsg_reply(msg, info); nl80211_get_station()
4577 static int nl80211_send_mpath(struct sk_buff *msg, u32 portid, u32 seq, nl80211_send_mpath() argument
4585 hdr = nl80211hdr_put(msg, portid, seq, flags, NL80211_CMD_NEW_MPATH); nl80211_send_mpath()
4589 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || nl80211_send_mpath()
4590 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, dst) || nl80211_send_mpath()
4591 nla_put(msg, NL80211_ATTR_MPATH_NEXT_HOP, ETH_ALEN, next_hop) || nl80211_send_mpath()
4592 nla_put_u32(msg, NL80211_ATTR_GENERATION, pinfo->generation)) nl80211_send_mpath()
4595 pinfoattr = nla_nest_start(msg, NL80211_ATTR_MPATH_INFO); nl80211_send_mpath()
4599 nla_put_u32(msg, NL80211_MPATH_INFO_FRAME_QLEN, nl80211_send_mpath()
4603 nla_put_u32(msg, NL80211_MPATH_INFO_SN, pinfo->sn)) || nl80211_send_mpath()
4605 nla_put_u32(msg, NL80211_MPATH_INFO_METRIC, nl80211_send_mpath()
4608 nla_put_u32(msg, NL80211_MPATH_INFO_EXPTIME, nl80211_send_mpath()
4611 nla_put_u8(msg, NL80211_MPATH_INFO_FLAGS, nl80211_send_mpath()
4614 nla_put_u32(msg, NL80211_MPATH_INFO_DISCOVERY_TIMEOUT, nl80211_send_mpath()
4617 nla_put_u8(msg, NL80211_MPATH_INFO_DISCOVERY_RETRIES, nl80211_send_mpath()
4621 nla_nest_end(msg, pinfoattr); nl80211_send_mpath()
4623 genlmsg_end(msg, hdr); nl80211_send_mpath()
4627 genlmsg_cancel(msg, hdr); nl80211_send_mpath()
4688 struct sk_buff *msg; nl80211_get_mpath() local
4709 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_get_mpath()
4710 if (!msg) nl80211_get_mpath()
4713 if (nl80211_send_mpath(msg, info->snd_portid, info->snd_seq, 0, nl80211_get_mpath()
4715 nlmsg_free(msg); nl80211_get_mpath()
4719 return genlmsg_reply(msg, info); nl80211_get_mpath()
4793 struct sk_buff *msg; nl80211_get_mpp() local
4814 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_get_mpp()
4815 if (!msg) nl80211_get_mpp()
4818 if (nl80211_send_mpath(msg, info->snd_portid, info->snd_seq, 0, nl80211_get_mpp()
4820 nlmsg_free(msg); nl80211_get_mpp()
4824 return genlmsg_reply(msg, info); nl80211_get_mpp()
5012 struct sk_buff *msg; nl80211_get_mesh_config() local
5032 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_get_mesh_config()
5033 if (!msg) nl80211_get_mesh_config()
5035 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, nl80211_get_mesh_config()
5039 pinfoattr = nla_nest_start(msg, NL80211_ATTR_MESH_CONFIG); nl80211_get_mesh_config()
5042 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || nl80211_get_mesh_config()
5043 nla_put_u16(msg, NL80211_MESHCONF_RETRY_TIMEOUT, nl80211_get_mesh_config()
5045 nla_put_u16(msg, NL80211_MESHCONF_CONFIRM_TIMEOUT, nl80211_get_mesh_config()
5047 nla_put_u16(msg, NL80211_MESHCONF_HOLDING_TIMEOUT, nl80211_get_mesh_config()
5049 nla_put_u16(msg, NL80211_MESHCONF_MAX_PEER_LINKS, nl80211_get_mesh_config()
5051 nla_put_u8(msg, NL80211_MESHCONF_MAX_RETRIES, nl80211_get_mesh_config()
5053 nla_put_u8(msg, NL80211_MESHCONF_TTL, nl80211_get_mesh_config()
5055 nla_put_u8(msg, NL80211_MESHCONF_ELEMENT_TTL, nl80211_get_mesh_config()
5057 nla_put_u8(msg, NL80211_MESHCONF_AUTO_OPEN_PLINKS, nl80211_get_mesh_config()
5059 nla_put_u32(msg, NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR, nl80211_get_mesh_config()
5061 nla_put_u8(msg, NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES, nl80211_get_mesh_config()
5063 nla_put_u32(msg, NL80211_MESHCONF_PATH_REFRESH_TIME, nl80211_get_mesh_config()
5065 nla_put_u16(msg, NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT, nl80211_get_mesh_config()
5067 nla_put_u32(msg, NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT, nl80211_get_mesh_config()
5069 nla_put_u16(msg, NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL, nl80211_get_mesh_config()
5071 nla_put_u16(msg, NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL, nl80211_get_mesh_config()
5073 nla_put_u16(msg, NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, nl80211_get_mesh_config()
5075 nla_put_u8(msg, NL80211_MESHCONF_HWMP_ROOTMODE, nl80211_get_mesh_config()
5077 nla_put_u16(msg, NL80211_MESHCONF_HWMP_RANN_INTERVAL, nl80211_get_mesh_config()
5079 nla_put_u8(msg, NL80211_MESHCONF_GATE_ANNOUNCEMENTS, nl80211_get_mesh_config()
5081 nla_put_u8(msg, NL80211_MESHCONF_FORWARDING, nl80211_get_mesh_config()
5083 nla_put_u32(msg, NL80211_MESHCONF_RSSI_THRESHOLD, nl80211_get_mesh_config()
5085 nla_put_u32(msg, NL80211_MESHCONF_HT_OPMODE, nl80211_get_mesh_config()
5087 nla_put_u32(msg, NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, nl80211_get_mesh_config()
5089 nla_put_u16(msg, NL80211_MESHCONF_HWMP_ROOT_INTERVAL, nl80211_get_mesh_config()
5091 nla_put_u16(msg, NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, nl80211_get_mesh_config()
5093 nla_put_u32(msg, NL80211_MESHCONF_POWER_MODE, nl80211_get_mesh_config()
5095 nla_put_u16(msg, NL80211_MESHCONF_AWAKE_WINDOW, nl80211_get_mesh_config()
5097 nla_put_u32(msg, NL80211_MESHCONF_PLINK_TIMEOUT, nl80211_get_mesh_config()
5100 nla_nest_end(msg, pinfoattr); nl80211_get_mesh_config()
5101 genlmsg_end(msg, hdr); nl80211_get_mesh_config()
5102 return genlmsg_reply(msg, info); nl80211_get_mesh_config()
5105 genlmsg_cancel(msg, hdr); nl80211_get_mesh_config()
5107 nlmsg_free(msg); nl80211_get_mesh_config()
5380 struct sk_buff *msg) nl80211_put_regdom()
5385 if (nla_put_string(msg, NL80211_ATTR_REG_ALPHA2, regdom->alpha2) || nl80211_put_regdom()
5387 nla_put_u8(msg, NL80211_ATTR_DFS_REGION, regdom->dfs_region))) nl80211_put_regdom()
5390 nl_reg_rules = nla_nest_start(msg, NL80211_ATTR_REG_RULES); nl80211_put_regdom()
5405 nl_reg_rule = nla_nest_start(msg, i); nl80211_put_regdom()
5414 if (nla_put_u32(msg, NL80211_ATTR_REG_RULE_FLAGS, nl80211_put_regdom()
5416 nla_put_u32(msg, NL80211_ATTR_FREQ_RANGE_START, nl80211_put_regdom()
5418 nla_put_u32(msg, NL80211_ATTR_FREQ_RANGE_END, nl80211_put_regdom()
5420 nla_put_u32(msg, NL80211_ATTR_FREQ_RANGE_MAX_BW, nl80211_put_regdom()
5422 nla_put_u32(msg, NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN, nl80211_put_regdom()
5424 nla_put_u32(msg, NL80211_ATTR_POWER_RULE_MAX_EIRP, nl80211_put_regdom()
5426 nla_put_u32(msg, NL80211_ATTR_DFS_CAC_TIME, nl80211_put_regdom()
5430 nla_nest_end(msg, nl_reg_rule); nl80211_put_regdom()
5433 nla_nest_end(msg, nl_reg_rules); nl80211_put_regdom()
5445 struct sk_buff *msg; nl80211_get_reg_do() local
5448 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_get_reg_do()
5449 if (!msg) nl80211_get_reg_do()
5452 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, nl80211_get_reg_do()
5462 nlmsg_free(msg); nl80211_get_reg_do()
5473 nlmsg_free(msg); nl80211_get_reg_do()
5478 nla_put_u32(msg, NL80211_ATTR_WIPHY, get_wiphy_idx(wiphy))) nl80211_get_reg_do()
5483 nla_put_u32(msg, NL80211_ATTR_USER_REG_HINT_TYPE, nl80211_get_reg_do()
5492 if (nl80211_put_regdom(regdom, msg)) nl80211_get_reg_do()
5497 genlmsg_end(msg, hdr); nl80211_get_reg_do()
5498 return genlmsg_reply(msg, info); nl80211_get_reg_do()
5503 genlmsg_cancel(msg, hdr); nl80211_get_reg_do()
5505 nlmsg_free(msg); nl80211_get_reg_do()
5509 static int nl80211_send_regdom(struct sk_buff *msg, struct netlink_callback *cb, nl80211_send_regdom() argument
5513 void *hdr = nl80211hdr_put(msg, NETLINK_CB(cb->skb).portid, seq, flags, nl80211_send_regdom()
5521 if (nl80211_put_regdom(regdom, msg)) nl80211_send_regdom()
5525 nla_put_u32(msg, NL80211_ATTR_USER_REG_HINT_TYPE, nl80211_send_regdom()
5530 nla_put_u32(msg, NL80211_ATTR_WIPHY, get_wiphy_idx(wiphy))) nl80211_send_regdom()
5534 nla_put_flag(msg, NL80211_ATTR_WIPHY_SELF_MANAGED_REG)) nl80211_send_regdom()
5537 genlmsg_end(msg, hdr); nl80211_send_regdom()
5541 genlmsg_cancel(msg, hdr); nl80211_send_regdom()
6679 static int nl80211_send_bss(struct sk_buff *msg, struct netlink_callback *cb, nl80211_send_bss() argument
6692 hdr = nl80211hdr_put(msg, NETLINK_CB(cb->skb).portid, seq, flags, nl80211_send_bss()
6699 if (nla_put_u32(msg, NL80211_ATTR_GENERATION, rdev->bss_generation)) nl80211_send_bss()
6702 nla_put_u32(msg, NL80211_ATTR_IFINDEX, wdev->netdev->ifindex)) nl80211_send_bss()
6704 if (nla_put_u64(msg, NL80211_ATTR_WDEV, wdev_id(wdev))) nl80211_send_bss()
6707 bss = nla_nest_start(msg, NL80211_ATTR_BSS); nl80211_send_bss()
6711 nla_put(msg, NL80211_BSS_BSSID, ETH_ALEN, res->bssid))) nl80211_send_bss()
6717 nla_put_flag(msg, NL80211_BSS_PRESP_DATA)) nl80211_send_bss()
6725 if (nla_put_u64(msg, NL80211_BSS_TSF, ies->tsf)) nl80211_send_bss()
6727 if (ies->len && nla_put(msg, NL80211_BSS_INFORMATION_ELEMENTS, nl80211_send_bss()
6735 if (nla_put_u64(msg, NL80211_BSS_BEACON_TSF, ies->tsf)) nl80211_send_bss()
6737 if (ies->len && nla_put(msg, NL80211_BSS_BEACON_IES, nl80211_send_bss()
6744 nla_put_u16(msg, NL80211_BSS_BEACON_INTERVAL, res->beacon_interval)) nl80211_send_bss()
6746 if (nla_put_u16(msg, NL80211_BSS_CAPABILITY, res->capability) || nl80211_send_bss()
6747 nla_put_u32(msg, NL80211_BSS_FREQUENCY, res->channel->center_freq) || nl80211_send_bss()
6748 nla_put_u32(msg, NL80211_BSS_CHAN_WIDTH, res->scan_width) || nl80211_send_bss()
6749 nla_put_u32(msg, NL80211_BSS_SEEN_MS_AGO, nl80211_send_bss()
6754 nla_put_u64(msg, NL80211_BSS_LAST_SEEN_BOOTTIME, nl80211_send_bss()
6760 if (nla_put_u32(msg, NL80211_BSS_SIGNAL_MBM, res->signal)) nl80211_send_bss()
6764 if (nla_put_u8(msg, NL80211_BSS_SIGNAL_UNSPEC, res->signal)) nl80211_send_bss()
6775 nla_put_u32(msg, NL80211_BSS_STATUS, nl80211_send_bss()
6781 nla_put_u32(msg, NL80211_BSS_STATUS, nl80211_send_bss()
6789 nla_nest_end(msg, bss); nl80211_send_bss()
6791 genlmsg_end(msg, hdr); nl80211_send_bss()
6797 genlmsg_cancel(msg, hdr); nl80211_send_bss()
6839 static int nl80211_send_survey(struct sk_buff *msg, u32 portid, u32 seq, nl80211_send_survey() argument
6851 hdr = nl80211hdr_put(msg, portid, seq, flags, nl80211_send_survey()
6856 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex)) nl80211_send_survey()
6859 infoattr = nla_nest_start(msg, NL80211_ATTR_SURVEY_INFO); nl80211_send_survey()
6864 nla_put_u32(msg, NL80211_SURVEY_INFO_FREQUENCY, nl80211_send_survey()
6869 nla_put_u8(msg, NL80211_SURVEY_INFO_NOISE, survey->noise)) nl80211_send_survey()
6872 nla_put_flag(msg, NL80211_SURVEY_INFO_IN_USE)) nl80211_send_survey()
6875 nla_put_u64(msg, NL80211_SURVEY_INFO_TIME, nl80211_send_survey()
6879 nla_put_u64(msg, NL80211_SURVEY_INFO_TIME_BUSY, nl80211_send_survey()
6883 nla_put_u64(msg, NL80211_SURVEY_INFO_TIME_EXT_BUSY, nl80211_send_survey()
6887 nla_put_u64(msg, NL80211_SURVEY_INFO_TIME_RX, nl80211_send_survey()
6891 nla_put_u64(msg, NL80211_SURVEY_INFO_TIME_TX, nl80211_send_survey()
6895 nla_put_u64(msg, NL80211_SURVEY_INFO_TIME_SCAN, nl80211_send_survey()
6899 nla_nest_end(msg, infoattr); nl80211_send_survey()
6901 genlmsg_end(msg, hdr); nl80211_send_survey()
6905 genlmsg_cancel(msg, hdr); nl80211_send_survey()
8135 struct sk_buff *msg; nl80211_remain_on_channel() local
8163 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_remain_on_channel()
8164 if (!msg) nl80211_remain_on_channel()
8167 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, nl80211_remain_on_channel()
8180 if (nla_put_u64(msg, NL80211_ATTR_COOKIE, cookie)) nl80211_remain_on_channel()
8183 genlmsg_end(msg, hdr); nl80211_remain_on_channel()
8185 return genlmsg_reply(msg, info); nl80211_remain_on_channel()
8190 nlmsg_free(msg); nl80211_remain_on_channel()
8489 struct sk_buff *msg = NULL; nl80211_tx_mgmt() local
8574 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_tx_mgmt()
8575 if (!msg) nl80211_tx_mgmt()
8578 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, nl80211_tx_mgmt()
8591 if (msg) { nl80211_tx_mgmt()
8592 if (nla_put_u64(msg, NL80211_ATTR_COOKIE, cookie)) nl80211_tx_mgmt()
8595 genlmsg_end(msg, hdr); nl80211_tx_mgmt()
8596 return genlmsg_reply(msg, info); nl80211_tx_mgmt()
8604 nlmsg_free(msg); nl80211_tx_mgmt()
8677 struct sk_buff *msg; nl80211_get_power_save() local
8686 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_get_power_save()
8687 if (!msg) nl80211_get_power_save()
8690 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, nl80211_get_power_save()
8702 if (nla_put_u32(msg, NL80211_ATTR_PS_STATE, ps_state)) nl80211_get_power_save()
8705 genlmsg_end(msg, hdr); nl80211_get_power_save()
8706 return genlmsg_reply(msg, info); nl80211_get_power_save()
8711 nlmsg_free(msg); nl80211_get_power_save()
8921 static int nl80211_send_wowlan_patterns(struct sk_buff *msg, nl80211_send_wowlan_patterns() argument
8931 nl_pats = nla_nest_start(msg, NL80211_WOWLAN_TRIG_PKT_PATTERN); nl80211_send_wowlan_patterns()
8936 nl_pat = nla_nest_start(msg, i + 1); nl80211_send_wowlan_patterns()
8940 if (nla_put(msg, NL80211_PKTPAT_MASK, DIV_ROUND_UP(pat_len, 8), nl80211_send_wowlan_patterns()
8942 nla_put(msg, NL80211_PKTPAT_PATTERN, pat_len, nl80211_send_wowlan_patterns()
8944 nla_put_u32(msg, NL80211_PKTPAT_OFFSET, nl80211_send_wowlan_patterns()
8947 nla_nest_end(msg, nl_pat); nl80211_send_wowlan_patterns()
8949 nla_nest_end(msg, nl_pats); nl80211_send_wowlan_patterns()
8954 static int nl80211_send_wowlan_tcp(struct sk_buff *msg, nl80211_send_wowlan_tcp() argument
8962 nl_tcp = nla_nest_start(msg, NL80211_WOWLAN_TRIG_TCP_CONNECTION); nl80211_send_wowlan_tcp()
8966 if (nla_put_in_addr(msg, NL80211_WOWLAN_TCP_SRC_IPV4, tcp->src) || nl80211_send_wowlan_tcp()
8967 nla_put_in_addr(msg, NL80211_WOWLAN_TCP_DST_IPV4, tcp->dst) || nl80211_send_wowlan_tcp()
8968 nla_put(msg, NL80211_WOWLAN_TCP_DST_MAC, ETH_ALEN, tcp->dst_mac) || nl80211_send_wowlan_tcp()
8969 nla_put_u16(msg, NL80211_WOWLAN_TCP_SRC_PORT, tcp->src_port) || nl80211_send_wowlan_tcp()
8970 nla_put_u16(msg, NL80211_WOWLAN_TCP_DST_PORT, tcp->dst_port) || nl80211_send_wowlan_tcp()
8971 nla_put(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD, nl80211_send_wowlan_tcp()
8973 nla_put_u32(msg, NL80211_WOWLAN_TCP_DATA_INTERVAL, nl80211_send_wowlan_tcp()
8975 nla_put(msg, NL80211_WOWLAN_TCP_WAKE_PAYLOAD, nl80211_send_wowlan_tcp()
8977 nla_put(msg, NL80211_WOWLAN_TCP_WAKE_MASK, nl80211_send_wowlan_tcp()
8982 nla_put(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ, nl80211_send_wowlan_tcp()
8987 nla_put(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN, nl80211_send_wowlan_tcp()
8992 nla_nest_end(msg, nl_tcp); nl80211_send_wowlan_tcp()
8997 static int nl80211_send_wowlan_nd(struct sk_buff *msg, nl80211_send_wowlan_nd() argument
9006 nd = nla_nest_start(msg, NL80211_WOWLAN_TRIG_NET_DETECT); nl80211_send_wowlan_nd()
9011 nla_put_u32(msg, NL80211_ATTR_SCHED_SCAN_INTERVAL, nl80211_send_wowlan_nd()
9015 if (nla_put_u32(msg, NL80211_ATTR_SCHED_SCAN_DELAY, req->delay)) nl80211_send_wowlan_nd()
9018 freqs = nla_nest_start(msg, NL80211_ATTR_SCAN_FREQUENCIES); nl80211_send_wowlan_nd()
9023 nla_put_u32(msg, i, req->channels[i]->center_freq); nl80211_send_wowlan_nd()
9025 nla_nest_end(msg, freqs); nl80211_send_wowlan_nd()
9028 matches = nla_nest_start(msg, NL80211_ATTR_SCHED_SCAN_MATCH); nl80211_send_wowlan_nd()
9030 match = nla_nest_start(msg, i); nl80211_send_wowlan_nd()
9031 nla_put(msg, NL80211_SCHED_SCAN_MATCH_ATTR_SSID, nl80211_send_wowlan_nd()
9034 nla_nest_end(msg, match); nl80211_send_wowlan_nd()
9036 nla_nest_end(msg, matches); nl80211_send_wowlan_nd()
9039 scan_plans = nla_nest_start(msg, NL80211_ATTR_SCHED_SCAN_PLANS); nl80211_send_wowlan_nd()
9044 scan_plan = nla_nest_start(msg, i + 1); nl80211_send_wowlan_nd()
9046 nla_put_u32(msg, NL80211_SCHED_SCAN_PLAN_INTERVAL, nl80211_send_wowlan_nd()
9049 nla_put_u32(msg, NL80211_SCHED_SCAN_PLAN_ITERATIONS, nl80211_send_wowlan_nd()
9052 nla_nest_end(msg, scan_plan); nl80211_send_wowlan_nd()
9054 nla_nest_end(msg, scan_plans); nl80211_send_wowlan_nd()
9056 nla_nest_end(msg, nd); nl80211_send_wowlan_nd()
9064 struct sk_buff *msg; nl80211_get_wowlan() local
9079 msg = nlmsg_new(size, GFP_KERNEL); nl80211_get_wowlan()
9080 if (!msg) nl80211_get_wowlan()
9083 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, nl80211_get_wowlan()
9091 nl_wowlan = nla_nest_start(msg, NL80211_ATTR_WOWLAN_TRIGGERS); nl80211_get_wowlan()
9096 nla_put_flag(msg, NL80211_WOWLAN_TRIG_ANY)) || nl80211_get_wowlan()
9098 nla_put_flag(msg, NL80211_WOWLAN_TRIG_DISCONNECT)) || nl80211_get_wowlan()
9100 nla_put_flag(msg, NL80211_WOWLAN_TRIG_MAGIC_PKT)) || nl80211_get_wowlan()
9102 nla_put_flag(msg, NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE)) || nl80211_get_wowlan()
9104 nla_put_flag(msg, NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST)) || nl80211_get_wowlan()
9106 nla_put_flag(msg, NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE)) || nl80211_get_wowlan()
9108 nla_put_flag(msg, NL80211_WOWLAN_TRIG_RFKILL_RELEASE))) nl80211_get_wowlan()
9111 if (nl80211_send_wowlan_patterns(msg, rdev)) nl80211_get_wowlan()
9114 if (nl80211_send_wowlan_tcp(msg, nl80211_get_wowlan()
9119 msg, nl80211_get_wowlan()
9123 nla_nest_end(msg, nl_wowlan); nl80211_get_wowlan()
9126 genlmsg_end(msg, hdr); nl80211_get_wowlan()
9127 return genlmsg_reply(msg, info); nl80211_get_wowlan()
9130 nlmsg_free(msg); nl80211_get_wowlan()
9513 static int nl80211_send_coalesce_rules(struct sk_buff *msg, nl80211_send_coalesce_rules() argument
9523 nl_rules = nla_nest_start(msg, NL80211_ATTR_COALESCE_RULE); nl80211_send_coalesce_rules()
9528 nl_rule = nla_nest_start(msg, i + 1); nl80211_send_coalesce_rules()
9533 if (nla_put_u32(msg, NL80211_ATTR_COALESCE_RULE_DELAY, nl80211_send_coalesce_rules()
9537 if (nla_put_u32(msg, NL80211_ATTR_COALESCE_RULE_CONDITION, nl80211_send_coalesce_rules()
9541 nl_pats = nla_nest_start(msg, nl80211_send_coalesce_rules()
9547 nl_pat = nla_nest_start(msg, j + 1); nl80211_send_coalesce_rules()
9551 if (nla_put(msg, NL80211_PKTPAT_MASK, nl80211_send_coalesce_rules()
9554 nla_put(msg, NL80211_PKTPAT_PATTERN, pat_len, nl80211_send_coalesce_rules()
9556 nla_put_u32(msg, NL80211_PKTPAT_OFFSET, nl80211_send_coalesce_rules()
9559 nla_nest_end(msg, nl_pat); nl80211_send_coalesce_rules()
9561 nla_nest_end(msg, nl_pats); nl80211_send_coalesce_rules()
9562 nla_nest_end(msg, nl_rule); nl80211_send_coalesce_rules()
9564 nla_nest_end(msg, nl_rules); nl80211_send_coalesce_rules()
9572 struct sk_buff *msg; nl80211_get_coalesce() local
9578 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_get_coalesce()
9579 if (!msg) nl80211_get_coalesce()
9582 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, nl80211_get_coalesce()
9587 if (rdev->coalesce && nl80211_send_coalesce_rules(msg, rdev)) nl80211_get_coalesce()
9590 genlmsg_end(msg, hdr); nl80211_get_coalesce()
9591 return genlmsg_reply(msg, info); nl80211_get_coalesce()
9594 nlmsg_free(msg); nl80211_get_coalesce()
9845 struct sk_buff *msg; nl80211_probe_client() local
9861 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_probe_client()
9862 if (!msg) nl80211_probe_client()
9865 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, nl80211_probe_client()
9878 if (nla_put_u64(msg, NL80211_ATTR_COOKIE, cookie)) nl80211_probe_client()
9881 genlmsg_end(msg, hdr); nl80211_probe_client()
9883 return genlmsg_reply(msg, info); nl80211_probe_client()
9888 nlmsg_free(msg); nl80211_probe_client()
9974 struct sk_buff *msg; nl80211_get_protocol_features() local
9976 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_get_protocol_features()
9977 if (!msg) nl80211_get_protocol_features()
9980 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, nl80211_get_protocol_features()
9985 if (nla_put_u32(msg, NL80211_ATTR_PROTOCOL_FEATURES, nl80211_get_protocol_features()
9989 genlmsg_end(msg, hdr); nl80211_get_protocol_features()
9990 return genlmsg_reply(msg, info); nl80211_get_protocol_features()
9993 kfree_skb(msg); nl80211_get_protocol_features()
11428 struct sk_buff *msg; nl80211_notify_wiphy() local
11434 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_notify_wiphy()
11435 if (!msg) nl80211_notify_wiphy()
11438 if (nl80211_send_wiphy(rdev, cmd, msg, 0, 0, 0, &state) < 0) { nl80211_notify_wiphy()
11439 nlmsg_free(msg); nl80211_notify_wiphy()
11443 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, nl80211_notify_wiphy()
11447 static int nl80211_add_scan_req(struct sk_buff *msg, nl80211_add_scan_req() argument
11457 nest = nla_nest_start(msg, NL80211_ATTR_SCAN_SSIDS); nl80211_add_scan_req()
11461 if (nla_put(msg, i, req->ssids[i].ssid_len, req->ssids[i].ssid)) nl80211_add_scan_req()
11464 nla_nest_end(msg, nest); nl80211_add_scan_req()
11466 nest = nla_nest_start(msg, NL80211_ATTR_SCAN_FREQUENCIES); nl80211_add_scan_req()
11470 if (nla_put_u32(msg, i, req->channels[i]->center_freq)) nl80211_add_scan_req()
11473 nla_nest_end(msg, nest); nl80211_add_scan_req()
11476 nla_put(msg, NL80211_ATTR_IE, req->ie_len, req->ie)) nl80211_add_scan_req()
11480 nla_put_u32(msg, NL80211_ATTR_SCAN_FLAGS, req->flags)) nl80211_add_scan_req()
11488 static int nl80211_send_scan_msg(struct sk_buff *msg, nl80211_send_scan_msg() argument
11496 hdr = nl80211hdr_put(msg, portid, seq, flags, cmd); nl80211_send_scan_msg()
11500 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || nl80211_send_scan_msg()
11501 (wdev->netdev && nla_put_u32(msg, NL80211_ATTR_IFINDEX, nl80211_send_scan_msg()
11503 nla_put_u64(msg, NL80211_ATTR_WDEV, wdev_id(wdev))) nl80211_send_scan_msg()
11507 nl80211_add_scan_req(msg, rdev); nl80211_send_scan_msg()
11509 genlmsg_end(msg, hdr); nl80211_send_scan_msg()
11513 genlmsg_cancel(msg, hdr); nl80211_send_scan_msg()
11518 nl80211_send_sched_scan_msg(struct sk_buff *msg, nl80211_send_sched_scan_msg() argument
11525 hdr = nl80211hdr_put(msg, portid, seq, flags, cmd); nl80211_send_sched_scan_msg()
11529 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || nl80211_send_sched_scan_msg()
11530 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex)) nl80211_send_sched_scan_msg()
11533 genlmsg_end(msg, hdr); nl80211_send_sched_scan_msg()
11537 genlmsg_cancel(msg, hdr); nl80211_send_sched_scan_msg()
11544 struct sk_buff *msg; nl80211_send_scan_start() local
11546 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_send_scan_start()
11547 if (!msg) nl80211_send_scan_start()
11550 if (nl80211_send_scan_msg(msg, rdev, wdev, 0, 0, 0, nl80211_send_scan_start()
11552 nlmsg_free(msg); nl80211_send_scan_start()
11556 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, nl80211_send_scan_start()
11563 struct sk_buff *msg; nl80211_build_scan_msg() local
11565 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_build_scan_msg()
11566 if (!msg) nl80211_build_scan_msg()
11569 if (nl80211_send_scan_msg(msg, rdev, wdev, 0, 0, 0, nl80211_build_scan_msg()
11572 nlmsg_free(msg); nl80211_build_scan_msg()
11576 return msg; nl80211_build_scan_msg()
11580 struct sk_buff *msg) nl80211_send_scan_result()
11582 if (!msg) nl80211_send_scan_result()
11585 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, nl80211_send_scan_result()
11592 struct sk_buff *msg; nl80211_send_sched_scan_results() local
11594 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_send_sched_scan_results()
11595 if (!msg) nl80211_send_sched_scan_results()
11598 if (nl80211_send_sched_scan_msg(msg, rdev, netdev, 0, 0, 0, nl80211_send_sched_scan_results()
11600 nlmsg_free(msg); nl80211_send_sched_scan_results()
11604 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, nl80211_send_sched_scan_results()
11611 struct sk_buff *msg; nl80211_send_sched_scan() local
11613 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_send_sched_scan()
11614 if (!msg) nl80211_send_sched_scan()
11617 if (nl80211_send_sched_scan_msg(msg, rdev, netdev, 0, 0, 0, cmd) < 0) { nl80211_send_sched_scan()
11618 nlmsg_free(msg); nl80211_send_sched_scan()
11622 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, nl80211_send_sched_scan()
11626 static bool nl80211_reg_change_event_fill(struct sk_buff *msg, nl80211_reg_change_event_fill() argument
11630 if (nla_put_u8(msg, NL80211_ATTR_REG_INITIATOR, request->initiator)) nl80211_reg_change_event_fill()
11634 if (nla_put_u8(msg, NL80211_ATTR_REG_TYPE, nl80211_reg_change_event_fill()
11638 if (nla_put_u8(msg, NL80211_ATTR_REG_TYPE, nl80211_reg_change_event_fill()
11643 if (nla_put_u8(msg, NL80211_ATTR_REG_TYPE, nl80211_reg_change_event_fill()
11647 if (nla_put_u8(msg, NL80211_ATTR_REG_TYPE, nl80211_reg_change_event_fill()
11649 nla_put_string(msg, NL80211_ATTR_REG_ALPHA2, nl80211_reg_change_event_fill()
11658 nla_put_u32(msg, NL80211_ATTR_WIPHY, request->wiphy_idx)) nl80211_reg_change_event_fill()
11663 nla_put_flag(msg, NL80211_ATTR_WIPHY_SELF_MANAGED_REG)) nl80211_reg_change_event_fill()
11680 struct sk_buff *msg; nl80211_common_reg_change_event() local
11683 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_common_reg_change_event()
11684 if (!msg) nl80211_common_reg_change_event()
11687 hdr = nl80211hdr_put(msg, 0, 0, 0, cmd_id); nl80211_common_reg_change_event()
11689 nlmsg_free(msg); nl80211_common_reg_change_event()
11693 if (nl80211_reg_change_event_fill(msg, request) == false) nl80211_common_reg_change_event()
11696 genlmsg_end(msg, hdr); nl80211_common_reg_change_event()
11699 genlmsg_multicast_allns(&nl80211_fam, msg, 0, nl80211_common_reg_change_event()
11706 genlmsg_cancel(msg, hdr); nl80211_common_reg_change_event()
11707 nlmsg_free(msg); nl80211_common_reg_change_event()
11716 struct sk_buff *msg; nl80211_send_mlme_event() local
11719 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); nl80211_send_mlme_event()
11720 if (!msg) nl80211_send_mlme_event()
11723 hdr = nl80211hdr_put(msg, 0, 0, 0, cmd); nl80211_send_mlme_event()
11725 nlmsg_free(msg); nl80211_send_mlme_event()
11729 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || nl80211_send_mlme_event()
11730 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || nl80211_send_mlme_event()
11731 nla_put(msg, NL80211_ATTR_FRAME, len, buf)) nl80211_send_mlme_event()
11736 nla_nest_start(msg, NL80211_ATTR_STA_WME); nl80211_send_mlme_event()
11740 if (nla_put_u8(msg, NL80211_STA_WME_UAPSD_QUEUES, nl80211_send_mlme_event()
11744 nla_nest_end(msg, nla_wmm); nl80211_send_mlme_event()
11747 genlmsg_end(msg, hdr); nl80211_send_mlme_event()
11749 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, nl80211_send_mlme_event()
11754 genlmsg_cancel(msg, hdr); nl80211_send_mlme_event()
11755 nlmsg_free(msg); nl80211_send_mlme_event()
11816 struct sk_buff *msg; nl80211_send_mlme_timeout() local
11819 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); nl80211_send_mlme_timeout()
11820 if (!msg) nl80211_send_mlme_timeout()
11823 hdr = nl80211hdr_put(msg, 0, 0, 0, cmd); nl80211_send_mlme_timeout()
11825 nlmsg_free(msg); nl80211_send_mlme_timeout()
11829 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || nl80211_send_mlme_timeout()
11830 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || nl80211_send_mlme_timeout()
11831 nla_put_flag(msg, NL80211_ATTR_TIMED_OUT) || nl80211_send_mlme_timeout()
11832 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr)) nl80211_send_mlme_timeout()
11835 genlmsg_end(msg, hdr); nl80211_send_mlme_timeout()
11837 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, nl80211_send_mlme_timeout()
11842 genlmsg_cancel(msg, hdr); nl80211_send_mlme_timeout()
11843 nlmsg_free(msg); nl80211_send_mlme_timeout()
11868 struct sk_buff *msg; nl80211_send_connect_result() local
11871 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); nl80211_send_connect_result()
11872 if (!msg) nl80211_send_connect_result()
11875 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_CONNECT); nl80211_send_connect_result()
11877 nlmsg_free(msg); nl80211_send_connect_result()
11881 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || nl80211_send_connect_result()
11882 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || nl80211_send_connect_result()
11883 (bssid && nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, bssid)) || nl80211_send_connect_result()
11884 nla_put_u16(msg, NL80211_ATTR_STATUS_CODE, status) || nl80211_send_connect_result()
11886 nla_put(msg, NL80211_ATTR_REQ_IE, req_ie_len, req_ie)) || nl80211_send_connect_result()
11888 nla_put(msg, NL80211_ATTR_RESP_IE, resp_ie_len, resp_ie))) nl80211_send_connect_result()
11891 genlmsg_end(msg, hdr); nl80211_send_connect_result()
11893 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, nl80211_send_connect_result()
11898 genlmsg_cancel(msg, hdr); nl80211_send_connect_result()
11899 nlmsg_free(msg); nl80211_send_connect_result()
11908 struct sk_buff *msg; nl80211_send_roamed() local
11911 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); nl80211_send_roamed()
11912 if (!msg) nl80211_send_roamed()
11915 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_ROAM); nl80211_send_roamed()
11917 nlmsg_free(msg); nl80211_send_roamed()
11921 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || nl80211_send_roamed()
11922 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || nl80211_send_roamed()
11923 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, bssid) || nl80211_send_roamed()
11925 nla_put(msg, NL80211_ATTR_REQ_IE, req_ie_len, req_ie)) || nl80211_send_roamed()
11927 nla_put(msg, NL80211_ATTR_RESP_IE, resp_ie_len, resp_ie))) nl80211_send_roamed()
11930 genlmsg_end(msg, hdr); nl80211_send_roamed()
11932 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, nl80211_send_roamed()
11937 genlmsg_cancel(msg, hdr); nl80211_send_roamed()
11938 nlmsg_free(msg); nl80211_send_roamed()
11946 struct sk_buff *msg; nl80211_send_disconnected() local
11949 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_send_disconnected()
11950 if (!msg) nl80211_send_disconnected()
11953 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_DISCONNECT); nl80211_send_disconnected()
11955 nlmsg_free(msg); nl80211_send_disconnected()
11959 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || nl80211_send_disconnected()
11960 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || nl80211_send_disconnected()
11962 nla_put_u16(msg, NL80211_ATTR_REASON_CODE, reason)) || nl80211_send_disconnected()
11964 nla_put_flag(msg, NL80211_ATTR_DISCONNECTED_BY_AP)) || nl80211_send_disconnected()
11965 (ie && nla_put(msg, NL80211_ATTR_IE, ie_len, ie))) nl80211_send_disconnected()
11968 genlmsg_end(msg, hdr); nl80211_send_disconnected()
11970 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, nl80211_send_disconnected()
11975 genlmsg_cancel(msg, hdr); nl80211_send_disconnected()
11976 nlmsg_free(msg); nl80211_send_disconnected()
11984 struct sk_buff *msg; nl80211_send_ibss_bssid() local
11987 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); nl80211_send_ibss_bssid()
11988 if (!msg) nl80211_send_ibss_bssid()
11991 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_JOIN_IBSS); nl80211_send_ibss_bssid()
11993 nlmsg_free(msg); nl80211_send_ibss_bssid()
11997 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || nl80211_send_ibss_bssid()
11998 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || nl80211_send_ibss_bssid()
11999 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, bssid)) nl80211_send_ibss_bssid()
12002 genlmsg_end(msg, hdr); nl80211_send_ibss_bssid()
12004 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, nl80211_send_ibss_bssid()
12009 genlmsg_cancel(msg, hdr); nl80211_send_ibss_bssid()
12010 nlmsg_free(msg); nl80211_send_ibss_bssid()
12018 struct sk_buff *msg; cfg80211_notify_new_peer_candidate() local
12026 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); cfg80211_notify_new_peer_candidate()
12027 if (!msg) cfg80211_notify_new_peer_candidate()
12030 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_NEW_PEER_CANDIDATE); cfg80211_notify_new_peer_candidate()
12032 nlmsg_free(msg); cfg80211_notify_new_peer_candidate()
12036 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || cfg80211_notify_new_peer_candidate()
12037 nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || cfg80211_notify_new_peer_candidate()
12038 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr) || cfg80211_notify_new_peer_candidate()
12040 nla_put(msg, NL80211_ATTR_IE, ie_len , ie))) cfg80211_notify_new_peer_candidate()
12043 genlmsg_end(msg, hdr); cfg80211_notify_new_peer_candidate()
12045 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, cfg80211_notify_new_peer_candidate()
12050 genlmsg_cancel(msg, hdr); cfg80211_notify_new_peer_candidate()
12051 nlmsg_free(msg); cfg80211_notify_new_peer_candidate()
12060 struct sk_buff *msg; nl80211_michael_mic_failure() local
12063 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); nl80211_michael_mic_failure()
12064 if (!msg) nl80211_michael_mic_failure()
12067 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_MICHAEL_MIC_FAILURE); nl80211_michael_mic_failure()
12069 nlmsg_free(msg); nl80211_michael_mic_failure()
12073 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || nl80211_michael_mic_failure()
12074 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || nl80211_michael_mic_failure()
12075 (addr && nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr)) || nl80211_michael_mic_failure()
12076 nla_put_u32(msg, NL80211_ATTR_KEY_TYPE, key_type) || nl80211_michael_mic_failure()
12078 nla_put_u8(msg, NL80211_ATTR_KEY_IDX, key_id)) || nl80211_michael_mic_failure()
12079 (tsc && nla_put(msg, NL80211_ATTR_KEY_SEQ, 6, tsc))) nl80211_michael_mic_failure()
12082 genlmsg_end(msg, hdr); nl80211_michael_mic_failure()
12084 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, nl80211_michael_mic_failure()
12089 genlmsg_cancel(msg, hdr); nl80211_michael_mic_failure()
12090 nlmsg_free(msg); nl80211_michael_mic_failure()
12097 struct sk_buff *msg; nl80211_send_beacon_hint_event() local
12101 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); nl80211_send_beacon_hint_event()
12102 if (!msg) nl80211_send_beacon_hint_event()
12105 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_REG_BEACON_HINT); nl80211_send_beacon_hint_event()
12107 nlmsg_free(msg); nl80211_send_beacon_hint_event()
12115 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, get_wiphy_idx(wiphy))) nl80211_send_beacon_hint_event()
12119 nl_freq = nla_nest_start(msg, NL80211_ATTR_FREQ_BEFORE); nl80211_send_beacon_hint_event()
12122 if (nl80211_msg_put_channel(msg, channel_before, false)) nl80211_send_beacon_hint_event()
12124 nla_nest_end(msg, nl_freq); nl80211_send_beacon_hint_event()
12127 nl_freq = nla_nest_start(msg, NL80211_ATTR_FREQ_AFTER); nl80211_send_beacon_hint_event()
12130 if (nl80211_msg_put_channel(msg, channel_after, false)) nl80211_send_beacon_hint_event()
12132 nla_nest_end(msg, nl_freq); nl80211_send_beacon_hint_event()
12134 genlmsg_end(msg, hdr); nl80211_send_beacon_hint_event()
12137 genlmsg_multicast_allns(&nl80211_fam, msg, 0, nl80211_send_beacon_hint_event()
12144 genlmsg_cancel(msg, hdr); nl80211_send_beacon_hint_event()
12145 nlmsg_free(msg); nl80211_send_beacon_hint_event()
12154 struct sk_buff *msg; nl80211_send_remain_on_chan_event() local
12157 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); nl80211_send_remain_on_chan_event()
12158 if (!msg) nl80211_send_remain_on_chan_event()
12161 hdr = nl80211hdr_put(msg, 0, 0, 0, cmd); nl80211_send_remain_on_chan_event()
12163 nlmsg_free(msg); nl80211_send_remain_on_chan_event()
12167 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || nl80211_send_remain_on_chan_event()
12168 (wdev->netdev && nla_put_u32(msg, NL80211_ATTR_IFINDEX, nl80211_send_remain_on_chan_event()
12170 nla_put_u64(msg, NL80211_ATTR_WDEV, wdev_id(wdev)) || nl80211_send_remain_on_chan_event()
12171 nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, chan->center_freq) || nl80211_send_remain_on_chan_event()
12172 nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, nl80211_send_remain_on_chan_event()
12174 nla_put_u64(msg, NL80211_ATTR_COOKIE, cookie)) nl80211_send_remain_on_chan_event()
12178 nla_put_u32(msg, NL80211_ATTR_DURATION, duration)) nl80211_send_remain_on_chan_event()
12181 genlmsg_end(msg, hdr); nl80211_send_remain_on_chan_event()
12183 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, nl80211_send_remain_on_chan_event()
12188 genlmsg_cancel(msg, hdr); nl80211_send_remain_on_chan_event()
12189 nlmsg_free(msg); nl80211_send_remain_on_chan_event()
12224 struct sk_buff *msg; cfg80211_new_sta() local
12228 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); cfg80211_new_sta()
12229 if (!msg) cfg80211_new_sta()
12232 if (nl80211_send_station(msg, NL80211_CMD_NEW_STATION, 0, 0, 0, cfg80211_new_sta()
12234 nlmsg_free(msg); cfg80211_new_sta()
12238 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, cfg80211_new_sta()
12248 struct sk_buff *msg; cfg80211_del_sta_sinfo() local
12256 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); cfg80211_del_sta_sinfo()
12257 if (!msg) cfg80211_del_sta_sinfo()
12260 if (nl80211_send_station(msg, NL80211_CMD_DEL_STATION, 0, 0, 0, cfg80211_del_sta_sinfo()
12262 nlmsg_free(msg); cfg80211_del_sta_sinfo()
12266 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, cfg80211_del_sta_sinfo()
12277 struct sk_buff *msg; cfg80211_conn_failed() local
12280 msg = nlmsg_new(NLMSG_GOODSIZE, gfp); cfg80211_conn_failed()
12281 if (!msg) cfg80211_conn_failed()
12284 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_CONN_FAILED); cfg80211_conn_failed()
12286 nlmsg_free(msg); cfg80211_conn_failed()
12290 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || cfg80211_conn_failed()
12291 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr) || cfg80211_conn_failed()
12292 nla_put_u32(msg, NL80211_ATTR_CONN_FAILED_REASON, reason)) cfg80211_conn_failed()
12295 genlmsg_end(msg, hdr); cfg80211_conn_failed()
12297 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, cfg80211_conn_failed()
12302 genlmsg_cancel(msg, hdr); cfg80211_conn_failed()
12303 nlmsg_free(msg); cfg80211_conn_failed()
12312 struct sk_buff *msg; __nl80211_unexpected_frame() local
12319 msg = nlmsg_new(100, gfp); __nl80211_unexpected_frame()
12320 if (!msg) __nl80211_unexpected_frame()
12323 hdr = nl80211hdr_put(msg, 0, 0, 0, cmd); __nl80211_unexpected_frame()
12325 nlmsg_free(msg); __nl80211_unexpected_frame()
12329 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || __nl80211_unexpected_frame()
12330 nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || __nl80211_unexpected_frame()
12331 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr)) __nl80211_unexpected_frame()
12334 genlmsg_end(msg, hdr); __nl80211_unexpected_frame()
12335 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid); __nl80211_unexpected_frame()
12339 genlmsg_cancel(msg, hdr); __nl80211_unexpected_frame()
12340 nlmsg_free(msg); __nl80211_unexpected_frame()
12392 struct sk_buff *msg; nl80211_send_mgmt() local
12395 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); nl80211_send_mgmt()
12396 if (!msg) nl80211_send_mgmt()
12399 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_FRAME); nl80211_send_mgmt()
12401 nlmsg_free(msg); nl80211_send_mgmt()
12405 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || nl80211_send_mgmt()
12406 (netdev && nla_put_u32(msg, NL80211_ATTR_IFINDEX, nl80211_send_mgmt()
12408 nla_put_u64(msg, NL80211_ATTR_WDEV, wdev_id(wdev)) || nl80211_send_mgmt()
12409 nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, freq) || nl80211_send_mgmt()
12411 nla_put_u32(msg, NL80211_ATTR_RX_SIGNAL_DBM, sig_dbm)) || nl80211_send_mgmt()
12412 nla_put(msg, NL80211_ATTR_FRAME, len, buf) || nl80211_send_mgmt()
12414 nla_put_u32(msg, NL80211_ATTR_RXMGMT_FLAGS, flags))) nl80211_send_mgmt()
12417 genlmsg_end(msg, hdr); nl80211_send_mgmt()
12419 return genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid); nl80211_send_mgmt()
12422 genlmsg_cancel(msg, hdr); nl80211_send_mgmt()
12423 nlmsg_free(msg); nl80211_send_mgmt()
12433 struct sk_buff *msg; cfg80211_mgmt_tx_status() local
12438 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); cfg80211_mgmt_tx_status()
12439 if (!msg) cfg80211_mgmt_tx_status()
12442 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_FRAME_TX_STATUS); cfg80211_mgmt_tx_status()
12444 nlmsg_free(msg); cfg80211_mgmt_tx_status()
12448 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || cfg80211_mgmt_tx_status()
12449 (netdev && nla_put_u32(msg, NL80211_ATTR_IFINDEX, cfg80211_mgmt_tx_status()
12451 nla_put_u64(msg, NL80211_ATTR_WDEV, wdev_id(wdev)) || cfg80211_mgmt_tx_status()
12452 nla_put(msg, NL80211_ATTR_FRAME, len, buf) || cfg80211_mgmt_tx_status()
12453 nla_put_u64(msg, NL80211_ATTR_COOKIE, cookie) || cfg80211_mgmt_tx_status()
12454 (ack && nla_put_flag(msg, NL80211_ATTR_ACK))) cfg80211_mgmt_tx_status()
12457 genlmsg_end(msg, hdr); cfg80211_mgmt_tx_status()
12459 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, cfg80211_mgmt_tx_status()
12464 genlmsg_cancel(msg, hdr); cfg80211_mgmt_tx_status()
12465 nlmsg_free(msg); cfg80211_mgmt_tx_status()
12474 struct sk_buff *msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); cfg80211_prepare_cqm() local
12477 if (!msg) cfg80211_prepare_cqm()
12480 cb = (void **)msg->cb; cfg80211_prepare_cqm()
12482 cb[0] = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_NOTIFY_CQM); cfg80211_prepare_cqm()
12484 nlmsg_free(msg); cfg80211_prepare_cqm()
12488 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || cfg80211_prepare_cqm()
12489 nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex)) cfg80211_prepare_cqm()
12492 if (mac && nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac)) cfg80211_prepare_cqm()
12495 cb[1] = nla_nest_start(msg, NL80211_ATTR_CQM); cfg80211_prepare_cqm()
12501 return msg; cfg80211_prepare_cqm()
12503 nlmsg_free(msg); cfg80211_prepare_cqm()
12507 static void cfg80211_send_cqm(struct sk_buff *msg, gfp_t gfp) cfg80211_send_cqm() argument
12509 void **cb = (void **)msg->cb; cfg80211_send_cqm()
12512 nla_nest_end(msg, cb[1]); cfg80211_send_cqm()
12513 genlmsg_end(msg, cb[0]); cfg80211_send_cqm()
12515 memset(msg->cb, 0, sizeof(msg->cb)); cfg80211_send_cqm()
12517 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, cfg80211_send_cqm()
12525 struct sk_buff *msg; cfg80211_cqm_rssi_notify() local
12533 msg = cfg80211_prepare_cqm(dev, NULL, gfp); cfg80211_cqm_rssi_notify()
12534 if (!msg) cfg80211_cqm_rssi_notify()
12537 if (nla_put_u32(msg, NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT, cfg80211_cqm_rssi_notify()
12541 cfg80211_send_cqm(msg, gfp); cfg80211_cqm_rssi_notify()
12546 nlmsg_free(msg); cfg80211_cqm_rssi_notify()
12554 struct sk_buff *msg; cfg80211_cqm_txe_notify() local
12556 msg = cfg80211_prepare_cqm(dev, peer, gfp); cfg80211_cqm_txe_notify()
12557 if (!msg) cfg80211_cqm_txe_notify()
12560 if (nla_put_u32(msg, NL80211_ATTR_CQM_TXE_PKTS, num_packets)) cfg80211_cqm_txe_notify()
12563 if (nla_put_u32(msg, NL80211_ATTR_CQM_TXE_RATE, rate)) cfg80211_cqm_txe_notify()
12566 if (nla_put_u32(msg, NL80211_ATTR_CQM_TXE_INTVL, intvl)) cfg80211_cqm_txe_notify()
12569 cfg80211_send_cqm(msg, gfp); cfg80211_cqm_txe_notify()
12573 nlmsg_free(msg); cfg80211_cqm_txe_notify()
12580 struct sk_buff *msg; cfg80211_cqm_pktloss_notify() local
12584 msg = cfg80211_prepare_cqm(dev, peer, gfp); cfg80211_cqm_pktloss_notify()
12585 if (!msg) cfg80211_cqm_pktloss_notify()
12588 if (nla_put_u32(msg, NL80211_ATTR_CQM_PKT_LOSS_EVENT, num_packets)) cfg80211_cqm_pktloss_notify()
12591 cfg80211_send_cqm(msg, gfp); cfg80211_cqm_pktloss_notify()
12595 nlmsg_free(msg); cfg80211_cqm_pktloss_notify()
12601 struct sk_buff *msg; cfg80211_cqm_beacon_loss_notify() local
12603 msg = cfg80211_prepare_cqm(dev, NULL, gfp); cfg80211_cqm_beacon_loss_notify()
12604 if (!msg) cfg80211_cqm_beacon_loss_notify()
12607 if (nla_put_flag(msg, NL80211_ATTR_CQM_BEACON_LOSS_EVENT)) cfg80211_cqm_beacon_loss_notify()
12610 cfg80211_send_cqm(msg, gfp); cfg80211_cqm_beacon_loss_notify()
12614 nlmsg_free(msg); cfg80211_cqm_beacon_loss_notify()
12622 struct sk_buff *msg; nl80211_gtk_rekey_notify() local
12626 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); nl80211_gtk_rekey_notify()
12627 if (!msg) nl80211_gtk_rekey_notify()
12630 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_SET_REKEY_OFFLOAD); nl80211_gtk_rekey_notify()
12632 nlmsg_free(msg); nl80211_gtk_rekey_notify()
12636 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || nl80211_gtk_rekey_notify()
12637 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || nl80211_gtk_rekey_notify()
12638 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, bssid)) nl80211_gtk_rekey_notify()
12641 rekey_attr = nla_nest_start(msg, NL80211_ATTR_REKEY_DATA); nl80211_gtk_rekey_notify()
12645 if (nla_put(msg, NL80211_REKEY_DATA_REPLAY_CTR, nl80211_gtk_rekey_notify()
12649 nla_nest_end(msg, rekey_attr); nl80211_gtk_rekey_notify()
12651 genlmsg_end(msg, hdr); nl80211_gtk_rekey_notify()
12653 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, nl80211_gtk_rekey_notify()
12658 genlmsg_cancel(msg, hdr); nl80211_gtk_rekey_notify()
12659 nlmsg_free(msg); nl80211_gtk_rekey_notify()
12679 struct sk_buff *msg; nl80211_pmksa_candidate_notify() local
12683 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); nl80211_pmksa_candidate_notify()
12684 if (!msg) nl80211_pmksa_candidate_notify()
12687 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_PMKSA_CANDIDATE); nl80211_pmksa_candidate_notify()
12689 nlmsg_free(msg); nl80211_pmksa_candidate_notify()
12693 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || nl80211_pmksa_candidate_notify()
12694 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex)) nl80211_pmksa_candidate_notify()
12697 attr = nla_nest_start(msg, NL80211_ATTR_PMKSA_CANDIDATE); nl80211_pmksa_candidate_notify()
12701 if (nla_put_u32(msg, NL80211_PMKSA_CANDIDATE_INDEX, index) || nl80211_pmksa_candidate_notify()
12702 nla_put(msg, NL80211_PMKSA_CANDIDATE_BSSID, ETH_ALEN, bssid) || nl80211_pmksa_candidate_notify()
12704 nla_put_flag(msg, NL80211_PMKSA_CANDIDATE_PREAUTH))) nl80211_pmksa_candidate_notify()
12707 nla_nest_end(msg, attr); nl80211_pmksa_candidate_notify()
12709 genlmsg_end(msg, hdr); nl80211_pmksa_candidate_notify()
12711 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, nl80211_pmksa_candidate_notify()
12716 genlmsg_cancel(msg, hdr); nl80211_pmksa_candidate_notify()
12717 nlmsg_free(msg); nl80211_pmksa_candidate_notify()
12739 struct sk_buff *msg; nl80211_ch_switch_notify() local
12742 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); nl80211_ch_switch_notify()
12743 if (!msg) nl80211_ch_switch_notify()
12746 hdr = nl80211hdr_put(msg, 0, 0, 0, notif); nl80211_ch_switch_notify()
12748 nlmsg_free(msg); nl80211_ch_switch_notify()
12752 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex)) nl80211_ch_switch_notify()
12755 if (nl80211_send_chandef(msg, chandef)) nl80211_ch_switch_notify()
12759 (nla_put_u32(msg, NL80211_ATTR_CH_SWITCH_COUNT, count))) nl80211_ch_switch_notify()
12762 genlmsg_end(msg, hdr); nl80211_ch_switch_notify()
12764 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, nl80211_ch_switch_notify()
12769 genlmsg_cancel(msg, hdr); nl80211_ch_switch_notify()
12770 nlmsg_free(msg); nl80211_ch_switch_notify()
12812 struct sk_buff *msg; nl80211_radar_notify() local
12815 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); nl80211_radar_notify()
12816 if (!msg) nl80211_radar_notify()
12819 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_RADAR_DETECT); nl80211_radar_notify()
12821 nlmsg_free(msg); nl80211_radar_notify()
12825 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx)) nl80211_radar_notify()
12832 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || nl80211_radar_notify()
12833 nla_put_u64(msg, NL80211_ATTR_WDEV, wdev_id(wdev))) nl80211_radar_notify()
12837 if (nla_put_u32(msg, NL80211_ATTR_RADAR_EVENT, event)) nl80211_radar_notify()
12840 if (nl80211_send_chandef(msg, chandef)) nl80211_radar_notify()
12843 genlmsg_end(msg, hdr); nl80211_radar_notify()
12845 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, nl80211_radar_notify()
12850 genlmsg_cancel(msg, hdr); nl80211_radar_notify()
12851 nlmsg_free(msg); nl80211_radar_notify()
12859 struct sk_buff *msg; cfg80211_probe_status() local
12864 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); cfg80211_probe_status()
12866 if (!msg) cfg80211_probe_status()
12869 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_PROBE_CLIENT); cfg80211_probe_status()
12871 nlmsg_free(msg); cfg80211_probe_status()
12875 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || cfg80211_probe_status()
12876 nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || cfg80211_probe_status()
12877 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr) || cfg80211_probe_status()
12878 nla_put_u64(msg, NL80211_ATTR_COOKIE, cookie) || cfg80211_probe_status()
12879 (acked && nla_put_flag(msg, NL80211_ATTR_ACK))) cfg80211_probe_status()
12882 genlmsg_end(msg, hdr); cfg80211_probe_status()
12884 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, cfg80211_probe_status()
12889 genlmsg_cancel(msg, hdr); cfg80211_probe_status()
12890 nlmsg_free(msg); cfg80211_probe_status()
12899 struct sk_buff *msg; cfg80211_report_obss_beacon() local
12907 msg = nlmsg_new(len + 100, GFP_ATOMIC); cfg80211_report_obss_beacon()
12908 if (!msg) { cfg80211_report_obss_beacon()
12913 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_FRAME); cfg80211_report_obss_beacon()
12917 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || cfg80211_report_obss_beacon()
12919 nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, freq)) || cfg80211_report_obss_beacon()
12921 nla_put_u32(msg, NL80211_ATTR_RX_SIGNAL_DBM, sig_dbm)) || cfg80211_report_obss_beacon()
12922 nla_put(msg, NL80211_ATTR_FRAME, len, frame)) cfg80211_report_obss_beacon()
12925 genlmsg_end(msg, hdr); cfg80211_report_obss_beacon()
12927 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, reg->nlportid); cfg80211_report_obss_beacon()
12935 genlmsg_cancel(msg, hdr); cfg80211_report_obss_beacon()
12936 nlmsg_free(msg); cfg80211_report_obss_beacon()
12941 static int cfg80211_net_detect_results(struct sk_buff *msg, cfg80211_net_detect_results() argument
12949 msg, NL80211_WOWLAN_TRIG_NET_DETECT_RESULTS); cfg80211_net_detect_results()
12956 nl_match = nla_nest_start(msg, i); cfg80211_net_detect_results()
12967 if (nla_put(msg, NL80211_ATTR_SSID, match->ssid.ssid_len, cfg80211_net_detect_results()
12969 nla_nest_cancel(msg, nl_match); cfg80211_net_detect_results()
12975 msg, NL80211_ATTR_SCAN_FREQUENCIES); cfg80211_net_detect_results()
12977 nla_nest_cancel(msg, nl_match); cfg80211_net_detect_results()
12982 if (nla_put_u32(msg, j, match->channels[j])) { cfg80211_net_detect_results()
12983 nla_nest_cancel(msg, nl_freqs); cfg80211_net_detect_results()
12984 nla_nest_cancel(msg, nl_match); cfg80211_net_detect_results()
12989 nla_nest_end(msg, nl_freqs); cfg80211_net_detect_results()
12992 nla_nest_end(msg, nl_match); cfg80211_net_detect_results()
12996 nla_nest_end(msg, nl_results); cfg80211_net_detect_results()
13005 struct sk_buff *msg; cfg80211_report_wowlan_wakeup() local
13014 msg = nlmsg_new(size, gfp); cfg80211_report_wowlan_wakeup()
13015 if (!msg) cfg80211_report_wowlan_wakeup()
13018 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_SET_WOWLAN); cfg80211_report_wowlan_wakeup()
13022 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || cfg80211_report_wowlan_wakeup()
13023 nla_put_u64(msg, NL80211_ATTR_WDEV, wdev_id(wdev))) cfg80211_report_wowlan_wakeup()
13026 if (wdev->netdev && nla_put_u32(msg, NL80211_ATTR_IFINDEX, cfg80211_report_wowlan_wakeup()
13033 reasons = nla_nest_start(msg, NL80211_ATTR_WOWLAN_TRIGGERS); cfg80211_report_wowlan_wakeup()
13038 nla_put_flag(msg, NL80211_WOWLAN_TRIG_DISCONNECT)) cfg80211_report_wowlan_wakeup()
13041 nla_put_flag(msg, NL80211_WOWLAN_TRIG_MAGIC_PKT)) cfg80211_report_wowlan_wakeup()
13044 nla_put_flag(msg, NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE)) cfg80211_report_wowlan_wakeup()
13047 nla_put_flag(msg, NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST)) cfg80211_report_wowlan_wakeup()
13050 nla_put_flag(msg, NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE)) cfg80211_report_wowlan_wakeup()
13053 nla_put_flag(msg, NL80211_WOWLAN_TRIG_RFKILL_RELEASE)) cfg80211_report_wowlan_wakeup()
13057 nla_put_u32(msg, NL80211_WOWLAN_TRIG_PKT_PATTERN, cfg80211_report_wowlan_wakeup()
13062 nla_put_flag(msg, NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH)) cfg80211_report_wowlan_wakeup()
13066 nla_put_flag(msg, NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST)) cfg80211_report_wowlan_wakeup()
13070 nla_put_flag(msg, cfg80211_report_wowlan_wakeup()
13086 nla_put_u32(msg, len_attr, wakeup->packet_len)) cfg80211_report_wowlan_wakeup()
13089 if (nla_put(msg, pkt_attr, wakeup->packet_present_len, cfg80211_report_wowlan_wakeup()
13095 cfg80211_net_detect_results(msg, wakeup)) cfg80211_report_wowlan_wakeup()
13098 nla_nest_end(msg, reasons); cfg80211_report_wowlan_wakeup()
13101 genlmsg_end(msg, hdr); cfg80211_report_wowlan_wakeup()
13103 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, cfg80211_report_wowlan_wakeup()
13108 nlmsg_free(msg); cfg80211_report_wowlan_wakeup()
13119 struct sk_buff *msg; cfg80211_tdls_oper_request() local
13125 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); cfg80211_tdls_oper_request()
13126 if (!msg) cfg80211_tdls_oper_request()
13129 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_TDLS_OPER); cfg80211_tdls_oper_request()
13131 nlmsg_free(msg); cfg80211_tdls_oper_request()
13135 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || cfg80211_tdls_oper_request()
13136 nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || cfg80211_tdls_oper_request()
13137 nla_put_u8(msg, NL80211_ATTR_TDLS_OPERATION, oper) || cfg80211_tdls_oper_request()
13138 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, peer) || cfg80211_tdls_oper_request()
13140 nla_put_u16(msg, NL80211_ATTR_REASON_CODE, reason_code))) cfg80211_tdls_oper_request()
13143 genlmsg_end(msg, hdr); cfg80211_tdls_oper_request()
13145 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, cfg80211_tdls_oper_request()
13150 genlmsg_cancel(msg, hdr); cfg80211_tdls_oper_request()
13151 nlmsg_free(msg); cfg80211_tdls_oper_request()
13236 struct sk_buff *msg; cfg80211_ft_event() local
13244 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); cfg80211_ft_event()
13245 if (!msg) cfg80211_ft_event()
13248 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_FT_EVENT); cfg80211_ft_event()
13252 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || cfg80211_ft_event()
13253 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || cfg80211_ft_event()
13254 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, ft_event->target_ap)) cfg80211_ft_event()
13258 nla_put(msg, NL80211_ATTR_IE, ft_event->ies_len, ft_event->ies)) cfg80211_ft_event()
13261 nla_put(msg, NL80211_ATTR_IE_RIC, ft_event->ric_ies_len, cfg80211_ft_event()
13265 genlmsg_end(msg, hdr); cfg80211_ft_event()
13267 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, cfg80211_ft_event()
13271 nlmsg_free(msg); cfg80211_ft_event()
13278 struct sk_buff *msg; cfg80211_crit_proto_stopped() local
13289 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); cfg80211_crit_proto_stopped()
13290 if (!msg) cfg80211_crit_proto_stopped()
13293 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_CRIT_PROTOCOL_STOP); cfg80211_crit_proto_stopped()
13297 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || cfg80211_crit_proto_stopped()
13298 nla_put_u64(msg, NL80211_ATTR_WDEV, wdev_id(wdev))) cfg80211_crit_proto_stopped()
13301 genlmsg_end(msg, hdr); cfg80211_crit_proto_stopped()
13303 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid); cfg80211_crit_proto_stopped()
13308 genlmsg_cancel(msg, hdr); cfg80211_crit_proto_stopped()
13309 nlmsg_free(msg); cfg80211_crit_proto_stopped()
13318 struct sk_buff *msg; nl80211_send_ap_stopped() local
13321 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); nl80211_send_ap_stopped()
13322 if (!msg) nl80211_send_ap_stopped()
13325 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_STOP_AP); nl80211_send_ap_stopped()
13329 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || nl80211_send_ap_stopped()
13330 nla_put_u32(msg, NL80211_ATTR_IFINDEX, wdev->netdev->ifindex) || nl80211_send_ap_stopped()
13331 nla_put_u64(msg, NL80211_ATTR_WDEV, wdev_id(wdev))) nl80211_send_ap_stopped()
13334 genlmsg_end(msg, hdr); nl80211_send_ap_stopped()
13336 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(wiphy), msg, 0, nl80211_send_ap_stopped()
13340 nlmsg_free(msg); nl80211_send_ap_stopped()
948 nl80211_put_iface_combinations(struct wiphy *wiphy, struct sk_buff *msg, bool large) nl80211_put_iface_combinations() argument
1017 nl80211_send_wowlan_tcp_caps(struct cfg80211_registered_device *rdev, struct sk_buff *msg) nl80211_send_wowlan_tcp_caps() argument
1259 nl80211_send_wiphy(struct cfg80211_registered_device *rdev, enum nl80211_commands cmd, struct sk_buff *msg, u32 portid, u32 seq, int flags, struct nl80211_dump_wiphy_state *state) nl80211_send_wiphy() argument
5379 nl80211_put_regdom(const struct ieee80211_regdomain *regdom, struct sk_buff *msg) nl80211_put_regdom() argument
11579 nl80211_send_scan_result(struct cfg80211_registered_device *rdev, struct sk_buff *msg) nl80211_send_scan_result() argument
/linux-4.4.14/drivers/media/pci/ngene/
H A Dngene-i2c.c119 struct i2c_msg msg[], int num) ngene_i2c_master_xfer()
128 if (num == 2 && msg[1].flags & I2C_M_RD && !(msg[0].flags & I2C_M_RD)) ngene_i2c_master_xfer()
129 if (!ngene_command_i2c_read(dev, msg[0].addr, ngene_i2c_master_xfer()
130 msg[0].buf, msg[0].len, ngene_i2c_master_xfer()
131 msg[1].buf, msg[1].len, 0)) ngene_i2c_master_xfer()
134 if (num == 1 && !(msg[0].flags & I2C_M_RD)) ngene_i2c_master_xfer()
135 if (!ngene_command_i2c_write(dev, msg[0].addr, ngene_i2c_master_xfer()
136 msg[0].buf, msg[0].len)) ngene_i2c_master_xfer()
138 if (num == 1 && (msg[0].flags & I2C_M_RD)) ngene_i2c_master_xfer()
139 if (!ngene_command_i2c_read(dev, msg[0].addr, NULL, 0, ngene_i2c_master_xfer()
140 msg[0].buf, msg[0].len, 0)) ngene_i2c_master_xfer()
118 ngene_i2c_master_xfer(struct i2c_adapter *adapter, struct i2c_msg msg[], int num) ngene_i2c_master_xfer() argument
/linux-4.4.14/drivers/gpu/drm/radeon/
H A Dradeon_dp_auxch.c55 radeon_dp_aux_transfer_native(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg) radeon_dp_aux_transfer_native() argument
65 u8 *buf = msg->buffer; radeon_dp_aux_transfer_native()
71 if (WARN_ON(msg->size > 16)) radeon_dp_aux_transfer_native()
74 switch (msg->request & ~DP_AUX_I2C_MOT) { radeon_dp_aux_transfer_native()
89 if (msg->size) { radeon_dp_aux_transfer_native()
90 msize = msg->size - 1; radeon_dp_aux_transfer_native()
93 bytes += msg->size; radeon_dp_aux_transfer_native()
119 /* request, address, msg size */ radeon_dp_aux_transfer_native()
120 byte = (msg->request << 4) | ((msg->address >> 16) & 0xf); radeon_dp_aux_transfer_native()
124 byte = (msg->address >> 8) & 0xff; radeon_dp_aux_transfer_native()
128 byte = msg->address & 0xff; radeon_dp_aux_transfer_native()
136 /* if we are writing - write the msg buffer */ radeon_dp_aux_transfer_native()
138 for (i = 0; i < msg->size; i++) { radeon_dp_aux_transfer_native()
197 ret = msg->size; radeon_dp_aux_transfer_native()
202 msg->reply = ack >> 4; radeon_dp_aux_transfer_native()
H A Dradeon_uvd.c310 static int radeon_uvd_cs_msg_decode(uint32_t *msg, unsigned buf_sizes[]) radeon_uvd_cs_msg_decode() argument
312 unsigned stream_type = msg[4]; radeon_uvd_cs_msg_decode()
313 unsigned width = msg[6]; radeon_uvd_cs_msg_decode()
314 unsigned height = msg[7]; radeon_uvd_cs_msg_decode()
315 unsigned dpb_size = msg[9]; radeon_uvd_cs_msg_decode()
316 unsigned pitch = msg[28]; radeon_uvd_cs_msg_decode()
424 int32_t *msg, msg_type, handle; radeon_uvd_cs_msg() local
451 msg = ptr + offset; radeon_uvd_cs_msg()
453 msg_type = msg[1]; radeon_uvd_cs_msg()
454 handle = msg[2]; radeon_uvd_cs_msg()
463 /* it's a create msg, calc image size (width * height) */ radeon_uvd_cs_msg()
464 img_size = msg[7] * msg[8]; radeon_uvd_cs_msg()
466 r = radeon_uvd_validate_codec(p, msg[4]); radeon_uvd_cs_msg()
489 /* it's a decode msg, validate codec and calc buffer sizes */ radeon_uvd_cs_msg()
490 r = radeon_uvd_validate_codec(p, msg[4]); radeon_uvd_cs_msg()
492 r = radeon_uvd_cs_msg_decode(msg, buf_sizes); radeon_uvd_cs_msg()
512 /* it's a destroy msg, free the handle */ radeon_uvd_cs_msg()
582 DRM_ERROR("msg/fb buffer %LX-%LX out of 256MB segment!\n", radeon_uvd_cs_reloc()
644 /* does the IB has a msg command */ radeon_uvd_cs_parse()
688 DRM_ERROR("UVD-IBs need a msg command!\n"); radeon_uvd_cs_parse()
726 crash the vcpu so just try to emmit a dummy create/destroy msg to
735 uint32_t *msg = rdev->uvd.cpu_addr + offs; radeon_uvd_get_create_msg() local
744 /* stitch together an UVD create msg */ radeon_uvd_get_create_msg()
745 msg[0] = cpu_to_le32(0x00000de4); radeon_uvd_get_create_msg()
746 msg[1] = cpu_to_le32(0x00000000); radeon_uvd_get_create_msg()
747 msg[2] = cpu_to_le32(handle); radeon_uvd_get_create_msg()
748 msg[3] = cpu_to_le32(0x00000000); radeon_uvd_get_create_msg()
749 msg[4] = cpu_to_le32(0x00000000); radeon_uvd_get_create_msg()
750 msg[5] = cpu_to_le32(0x00000000); radeon_uvd_get_create_msg()
751 msg[6] = cpu_to_le32(0x00000000); radeon_uvd_get_create_msg()
752 msg[7] = cpu_to_le32(0x00000780); radeon_uvd_get_create_msg()
753 msg[8] = cpu_to_le32(0x00000440); radeon_uvd_get_create_msg()
754 msg[9] = cpu_to_le32(0x00000000); radeon_uvd_get_create_msg()
755 msg[10] = cpu_to_le32(0x01b37000); radeon_uvd_get_create_msg()
757 msg[i] = cpu_to_le32(0x0); radeon_uvd_get_create_msg()
771 uint32_t *msg = rdev->uvd.cpu_addr + offs; radeon_uvd_get_destroy_msg() local
780 /* stitch together an UVD destroy msg */ radeon_uvd_get_destroy_msg()
781 msg[0] = cpu_to_le32(0x00000de4); radeon_uvd_get_destroy_msg()
782 msg[1] = cpu_to_le32(0x00000002); radeon_uvd_get_destroy_msg()
783 msg[2] = cpu_to_le32(handle); radeon_uvd_get_destroy_msg()
784 msg[3] = cpu_to_le32(0x00000000); radeon_uvd_get_destroy_msg()
786 msg[i] = cpu_to_le32(0x0); radeon_uvd_get_destroy_msg()
/linux-4.4.14/drivers/net/wireless/rsi/
H A Drsi_91x_pkt.c133 __le16 *msg = NULL; rsi_send_mgmt_pkt() local
168 msg = (__le16 *)skb->data; rsi_send_mgmt_pkt()
175 msg[0] = cpu_to_le16((skb->len - FRAME_DESC_SZ) | rsi_send_mgmt_pkt()
177 msg[1] = cpu_to_le16(TX_DOT11_MGMT); rsi_send_mgmt_pkt()
178 msg[2] = cpu_to_le16(MIN_802_11_HDR_LEN << 8); rsi_send_mgmt_pkt()
179 msg[3] = cpu_to_le16(RATE_INFO_ENABLE); rsi_send_mgmt_pkt()
180 msg[6] = cpu_to_le16(le16_to_cpu(wh->seq_ctrl) >> 4); rsi_send_mgmt_pkt()
183 msg[3] |= cpu_to_le16(RSI_BROADCAST_PKT); rsi_send_mgmt_pkt()
186 msg[4] = cpu_to_le16(RSI_11B_MODE); rsi_send_mgmt_pkt()
188 msg[4] = cpu_to_le16((RSI_RATE_6 & 0x0f) | RSI_11G_MODE); rsi_send_mgmt_pkt()
191 msg[4] = cpu_to_le16(0xB | RSI_11G_MODE); rsi_send_mgmt_pkt()
192 msg[5] = cpu_to_le16(0x6); rsi_send_mgmt_pkt()
197 msg[1] |= cpu_to_le16(BIT(10)); rsi_send_mgmt_pkt()
198 msg[7] = cpu_to_le16(PROBEREQ_CONFIRM); rsi_send_mgmt_pkt()
202 msg[7] |= cpu_to_le16(vap_id << 8); rsi_send_mgmt_pkt()
205 (u8 *)msg, rsi_send_mgmt_pkt()
/linux-4.4.14/drivers/net/ethernet/intel/fm10k/
H A Dfm10k_tlv.h115 #define fm10k_tlv_attr_put_u8(msg, attr_id, val) \
116 fm10k_tlv_attr_put_value(msg, attr_id, val, 1)
117 #define fm10k_tlv_attr_put_u16(msg, attr_id, val) \
118 fm10k_tlv_attr_put_value(msg, attr_id, val, 2)
119 #define fm10k_tlv_attr_put_u32(msg, attr_id, val) \
120 fm10k_tlv_attr_put_value(msg, attr_id, val, 4)
121 #define fm10k_tlv_attr_put_u64(msg, attr_id, val) \
122 fm10k_tlv_attr_put_value(msg, attr_id, val, 8)
123 #define fm10k_tlv_attr_put_s8(msg, attr_id, val) \
124 fm10k_tlv_attr_put_value(msg, attr_id, val, 1)
125 #define fm10k_tlv_attr_put_s16(msg, attr_id, val) \
126 fm10k_tlv_attr_put_value(msg, attr_id, val, 2)
127 #define fm10k_tlv_attr_put_s32(msg, attr_id, val) \
128 fm10k_tlv_attr_put_value(msg, attr_id, val, 4)
129 #define fm10k_tlv_attr_put_s64(msg, attr_id, val) \
130 fm10k_tlv_attr_put_value(msg, attr_id, val, 8)
H A Dfm10k_tlv.c25 * @msg: Pointer to message block
30 s32 fm10k_tlv_msg_init(u32 *msg, u16 msg_id) fm10k_tlv_msg_init() argument
33 if (!msg) fm10k_tlv_msg_init()
36 *msg = (FM10K_TLV_FLAGS_MSG << FM10K_TLV_FLAGS_SHIFT) | msg_id; fm10k_tlv_msg_init()
43 * @msg: Pointer to message block
51 s32 fm10k_tlv_attr_put_null_string(u32 *msg, u16 attr_id, fm10k_tlv_attr_put_null_string() argument
58 if (!string || !msg) fm10k_tlv_attr_put_null_string()
61 attr = &msg[FM10K_TLV_DWORD_LEN(*msg)]; fm10k_tlv_attr_put_null_string()
63 /* copy string into local variable and then write to msg */ fm10k_tlv_attr_put_null_string()
87 *msg += FM10K_TLV_LEN_ALIGN(len); fm10k_tlv_attr_put_null_string()
120 * @msg: Pointer to message block
128 s32 fm10k_tlv_attr_put_mac_vlan(u32 *msg, u16 attr_id, fm10k_tlv_attr_put_mac_vlan() argument
135 if (!msg || !mac_addr) fm10k_tlv_attr_put_mac_vlan()
138 attr = &msg[FM10K_TLV_DWORD_LEN(*msg)]; fm10k_tlv_attr_put_mac_vlan()
143 /* copy value into local variable and then write to msg */ fm10k_tlv_attr_put_mac_vlan()
150 *msg += FM10K_TLV_LEN_ALIGN(len); fm10k_tlv_attr_put_mac_vlan()
180 * @msg: Pointer to message block
188 s32 fm10k_tlv_attr_put_bool(u32 *msg, u16 attr_id) fm10k_tlv_attr_put_bool() argument
191 if (!msg) fm10k_tlv_attr_put_bool()
195 msg[FM10K_TLV_DWORD_LEN(*msg)] = attr_id; fm10k_tlv_attr_put_bool()
198 *msg += FM10K_TLV_HDR_LEN << FM10K_TLV_LEN_SHIFT; fm10k_tlv_attr_put_bool()
205 * @msg: Pointer to message block
212 * that msg is a valid pointer, and len is 1, 2, 4, or 8.
214 s32 fm10k_tlv_attr_put_value(u32 *msg, u16 attr_id, s64 value, u32 len) fm10k_tlv_attr_put_value() argument
218 /* verify non-null msg and len is 1, 2, 4, or 8 */ fm10k_tlv_attr_put_value()
219 if (!msg || !len || len > 8 || (len & (len - 1))) fm10k_tlv_attr_put_value()
222 attr = &msg[FM10K_TLV_DWORD_LEN(*msg)]; fm10k_tlv_attr_put_value()
238 *msg += FM10K_TLV_LEN_ALIGN(len); fm10k_tlv_attr_put_value()
277 * @msg: Pointer to message block
286 s32 fm10k_tlv_attr_put_le_struct(u32 *msg, u16 attr_id, fm10k_tlv_attr_put_le_struct() argument
293 /* verify non-null msg and len is in 32 bit words */ fm10k_tlv_attr_put_le_struct()
294 if (!msg || !len || (len % 4)) fm10k_tlv_attr_put_le_struct()
297 attr = &msg[FM10K_TLV_DWORD_LEN(*msg)]; fm10k_tlv_attr_put_le_struct()
309 *msg += FM10K_TLV_LEN_ALIGN(len); fm10k_tlv_attr_put_le_struct()
347 * @msg: Pointer to message block
356 u32 *fm10k_tlv_attr_nest_start(u32 *msg, u16 attr_id) fm10k_tlv_attr_nest_start() argument
361 if (!msg) fm10k_tlv_attr_nest_start()
364 attr = &msg[FM10K_TLV_DWORD_LEN(*msg)]; fm10k_tlv_attr_nest_start()
374 * @msg: Pointer to message block
381 s32 fm10k_tlv_attr_nest_stop(u32 *msg) fm10k_tlv_attr_nest_stop() argument
387 if (!msg) fm10k_tlv_attr_nest_stop()
391 attr = &msg[FM10K_TLV_DWORD_LEN(*msg)]; fm10k_tlv_attr_nest_stop()
397 *msg += len; fm10k_tlv_attr_nest_stop()
548 * @msg: Pointer to message
558 s32 fm10k_tlv_msg_parse(struct fm10k_hw *hw, u32 *msg, fm10k_tlv_msg_parse() argument
567 if (!msg || !data) fm10k_tlv_msg_parse()
571 if (!(*msg & (FM10K_TLV_FLAGS_MSG << FM10K_TLV_FLAGS_SHIFT))) fm10k_tlv_msg_parse()
575 msg_id = *msg & FM10K_TLV_ID_MASK; fm10k_tlv_msg_parse()
587 err = fm10k_tlv_attr_parse(msg, results, data->attr); fm10k_tlv_msg_parse()
648 * @msg: Pointer to message
653 static void fm10k_tlv_msg_test_generate_data(u32 *msg, u32 attr_flags) fm10k_tlv_msg_test_generate_data() argument
656 fm10k_tlv_attr_put_null_string(msg, FM10K_TEST_MSG_STRING, fm10k_tlv_msg_test_generate_data()
659 fm10k_tlv_attr_put_mac_vlan(msg, FM10K_TEST_MSG_MAC_ADDR, fm10k_tlv_msg_test_generate_data()
662 fm10k_tlv_attr_put_u8(msg, FM10K_TEST_MSG_U8, test_u8); fm10k_tlv_msg_test_generate_data()
664 fm10k_tlv_attr_put_u16(msg, FM10K_TEST_MSG_U16, test_u16); fm10k_tlv_msg_test_generate_data()
666 fm10k_tlv_attr_put_u32(msg, FM10K_TEST_MSG_U32, test_u32); fm10k_tlv_msg_test_generate_data()
668 fm10k_tlv_attr_put_u64(msg, FM10K_TEST_MSG_U64, test_u64); fm10k_tlv_msg_test_generate_data()
670 fm10k_tlv_attr_put_s8(msg, FM10K_TEST_MSG_S8, test_s8); fm10k_tlv_msg_test_generate_data()
672 fm10k_tlv_attr_put_s16(msg, FM10K_TEST_MSG_S16, test_s16); fm10k_tlv_msg_test_generate_data()
674 fm10k_tlv_attr_put_s32(msg, FM10K_TEST_MSG_S32, test_s32); fm10k_tlv_msg_test_generate_data()
676 fm10k_tlv_attr_put_s64(msg, FM10K_TEST_MSG_S64, test_s64); fm10k_tlv_msg_test_generate_data()
678 fm10k_tlv_attr_put_le_struct(msg, FM10K_TEST_MSG_LE_STRUCT, fm10k_tlv_msg_test_generate_data()
684 * @msg: Pointer to message
690 void fm10k_tlv_msg_test_create(u32 *msg, u32 attr_flags) fm10k_tlv_msg_test_create() argument
694 fm10k_tlv_msg_init(msg, FM10K_TLV_MSG_ID_TEST); fm10k_tlv_msg_test_create()
696 fm10k_tlv_msg_test_generate_data(msg, attr_flags); fm10k_tlv_msg_test_create()
702 nest = fm10k_tlv_attr_nest_start(msg, FM10K_TEST_MSG_NESTED); fm10k_tlv_msg_test_create()
706 fm10k_tlv_attr_nest_stop(msg); fm10k_tlv_msg_test_create()
/linux-4.4.14/arch/arc/kernel/
H A Dsmp.c210 * In arches with IRQ for each msg type (above), receiver can use IRQ-id to
211 * figure out what msg was sent. For those which don't (ARC has dedicated IPI
212 * IRQ), the msg-type needs to be conveyed via per-cpu data
217 static void ipi_send_msg_one(int cpu, enum ipi_msg_type msg) ipi_send_msg_one() argument
223 pr_debug("%d Sending msg [%d] to %d\n", smp_processor_id(), msg, cpu); ipi_send_msg_one()
228 * Atomically write new msg bit (in case others are writing too), ipi_send_msg_one()
233 new |= 1U << msg; ipi_send_msg_one()
238 * Only do so if there's no pending msg from other concurrent sender(s). ipi_send_msg_one()
239 * Otherwise, recevier will see this msg as well when it takes the ipi_send_msg_one()
240 * IPI corresponding to that msg. This is true, even if it is already in ipi_send_msg_one()
241 * IPI handler, because !@old means it has not yet dequeued the msg(s) ipi_send_msg_one()
242 * so @new msg can be a free-loader ipi_send_msg_one()
250 static void ipi_send_msg(const struct cpumask *callmap, enum ipi_msg_type msg) ipi_send_msg() argument
255 ipi_send_msg_one(cpu, msg); ipi_send_msg()
289 static inline int __do_IPI(unsigned long msg) __do_IPI() argument
293 switch (msg) { __do_IPI()
329 * "dequeue" the msg corresponding to this IPI (and possibly other do_IPI()
330 * piggybacked msg from elided IPIs: see ipi_send_msg_one() above) do_IPI()
335 unsigned long msg = __ffs(pending); do_IPI() local
338 rc = __do_IPI(msg); do_IPI()
340 /* IPI received but no valid @msg */ do_IPI()
342 pr_info("IPI with bogus msg %ld in %ld\n", msg, copy); do_IPI()
344 pending &= ~(1U << msg); do_IPI()
/linux-4.4.14/arch/parisc/include/asm/
H A Dtraps.h8 void parisc_terminate(char *msg, struct pt_regs *regs,
/linux-4.4.14/include/linux/
H A Dhtirq.h13 struct ht_irq_msg *msg);
21 struct ht_irq_msg msg; member in struct:ht_irq_cfg
25 void fetch_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg);
26 void write_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg);
/linux-4.4.14/drivers/nfc/st21nfca/
H A Dvendor_cmds.c101 struct sk_buff *msg, *skb; st21nfca_hci_dm_get_info() local
111 msg = nfc_vendor_cmd_alloc_reply_skb(dev, ST21NFCA_VENDOR_OUI, st21nfca_hci_dm_get_info()
113 if (!msg) { st21nfca_hci_dm_get_info()
118 if (nla_put(msg, NFC_ATTR_VENDOR_DATA, skb->len, skb->data)) { st21nfca_hci_dm_get_info()
119 kfree_skb(msg); st21nfca_hci_dm_get_info()
124 r = nfc_vendor_cmd_reply(msg); st21nfca_hci_dm_get_info()
136 struct sk_buff *msg, *skb; st21nfca_hci_dm_get_data() local
146 msg = nfc_vendor_cmd_alloc_reply_skb(dev, ST21NFCA_VENDOR_OUI, st21nfca_hci_dm_get_data()
148 if (!msg) { st21nfca_hci_dm_get_data()
153 if (nla_put(msg, NFC_ATTR_VENDOR_DATA, skb->len, skb->data)) { st21nfca_hci_dm_get_data()
154 kfree_skb(msg); st21nfca_hci_dm_get_data()
159 r = nfc_vendor_cmd_reply(msg); st21nfca_hci_dm_get_data()
198 struct sk_buff *msg, *skb; st21nfca_hci_get_param() local
209 msg = nfc_vendor_cmd_alloc_reply_skb(dev, ST21NFCA_VENDOR_OUI, st21nfca_hci_get_param()
211 if (!msg) { st21nfca_hci_get_param()
216 if (nla_put(msg, NFC_ATTR_VENDOR_DATA, skb->len, skb->data)) { st21nfca_hci_get_param()
217 kfree_skb(msg); st21nfca_hci_get_param()
222 r = nfc_vendor_cmd_reply(msg); st21nfca_hci_get_param()
262 struct sk_buff *msg; st21nfca_hci_loopback() local
286 msg = nfc_vendor_cmd_alloc_reply_skb(hdev->ndev, st21nfca_hci_loopback()
290 if (!msg) { st21nfca_hci_loopback()
295 if (nla_put(msg, NFC_ATTR_VENDOR_DATA, info->vendor_info.rx_skb->len, st21nfca_hci_loopback()
297 kfree_skb(msg); st21nfca_hci_loopback()
302 r = nfc_vendor_cmd_reply(msg); st21nfca_hci_loopback()
/linux-4.4.14/drivers/acpi/
H A Dacpi_ipmi.c108 static void ipmi_msg_handler(struct ipmi_recv_msg *msg, void *user_msg_data);
257 struct kernel_ipmi_msg *msg; acpi_format_ipmi_request() local
262 msg = &tx_msg->tx_message; acpi_format_ipmi_request()
268 msg->netfn = IPMI_OP_RGN_NETFN(address); acpi_format_ipmi_request()
269 msg->cmd = IPMI_OP_RGN_CMD(address); acpi_format_ipmi_request()
270 msg->data = tx_msg->data; acpi_format_ipmi_request()
281 "Unexpected request (msg len %d).\n", acpi_format_ipmi_request()
285 msg->data_len = buffer->length; acpi_format_ipmi_request()
286 memcpy(tx_msg->data, buffer->data, msg->data_len); acpi_format_ipmi_request()
310 static void acpi_format_ipmi_response(struct acpi_ipmi_msg *msg, acpi_format_ipmi_response() argument
325 buffer->status = msg->msg_done; acpi_format_ipmi_response()
326 if (msg->msg_done != ACPI_IPMI_OK) acpi_format_ipmi_response()
333 buffer->length = msg->rx_len; acpi_format_ipmi_response()
334 memcpy(buffer->data, msg->data, msg->rx_len); acpi_format_ipmi_response()
358 /* wake up the sleep thread on the Tx msg */ ipmi_flush_tx_msg()
367 struct acpi_ipmi_msg *msg) ipmi_cancel_tx_msg()
375 if (msg == tx_msg) { ipmi_cancel_tx_msg()
387 static void ipmi_msg_handler(struct ipmi_recv_msg *msg, void *user_msg_data) ipmi_msg_handler() argument
395 if (msg->user != ipmi_device->user_interface) { ipmi_msg_handler()
398 msg->user, ipmi_device->user_interface); ipmi_msg_handler()
404 if (msg->msgid == tx_msg->tx_msgid) { ipmi_msg_handler()
414 "Unexpected response (msg id %ld) is returned.\n", ipmi_msg_handler()
415 msg->msgid); ipmi_msg_handler()
420 if (msg->msg.data_len > ACPI_IPMI_MAX_MSG_LENGTH) { ipmi_msg_handler()
422 "Unexpected response (msg len %d).\n", ipmi_msg_handler()
423 msg->msg.data_len); ipmi_msg_handler()
427 /* response msg is an error msg */ ipmi_msg_handler()
428 msg->recv_type = IPMI_RESPONSE_RECV_TYPE; ipmi_msg_handler()
429 if (msg->recv_type == IPMI_RESPONSE_RECV_TYPE && ipmi_msg_handler()
430 msg->msg.data_len == 1) { ipmi_msg_handler()
431 if (msg->msg.data[0] == IPMI_TIMEOUT_COMPLETION_CODE) { ipmi_msg_handler()
439 tx_msg->rx_len = msg->msg.data_len; ipmi_msg_handler()
440 memcpy(tx_msg->data, msg->msg.data, tx_msg->rx_len); ipmi_msg_handler()
447 ipmi_free_recv_msg(msg); ipmi_msg_handler()
366 ipmi_cancel_tx_msg(struct acpi_ipmi_device *ipmi, struct acpi_ipmi_msg *msg) ipmi_cancel_tx_msg() argument
/linux-4.4.14/drivers/misc/sgi-xp/
H A Dxpc_uv.c333 xpc_send_gru_msg(struct gru_message_queue_desc *gru_mq_desc, void *msg, xpc_send_gru_msg() argument
340 ret = gru_send_message_gpa(gru_mq_desc, msg, msg_size); xpc_send_gru_msg()
437 struct xpc_activate_mq_msg_activate_req_uv *msg; xpc_handle_activate_mq_msg_uv() local
444 msg = container_of(msg_hdr, struct xpc_handle_activate_mq_msg_uv()
451 part->remote_rp_pa = msg->rp_gpa; /* !!! _pa is _gpa */ xpc_handle_activate_mq_msg_uv()
453 part_uv->heartbeat_gpa = msg->heartbeat_gpa; xpc_handle_activate_mq_msg_uv()
455 if (msg->activate_gru_mq_desc_gpa != xpc_handle_activate_mq_msg_uv()
461 msg->activate_gru_mq_desc_gpa; xpc_handle_activate_mq_msg_uv()
469 struct xpc_activate_mq_msg_deactivate_req_uv *msg; xpc_handle_activate_mq_msg_uv() local
471 msg = container_of(msg_hdr, struct xpc_handle_activate_mq_msg_uv()
478 part_uv->reason = msg->reason; xpc_handle_activate_mq_msg_uv()
485 struct xpc_activate_mq_msg_chctl_closerequest_uv *msg; xpc_handle_activate_mq_msg_uv() local
490 msg = container_of(msg_hdr, struct xpc_handle_activate_mq_msg_uv()
493 args = &part->remote_openclose_args[msg->ch_number]; xpc_handle_activate_mq_msg_uv()
494 args->reason = msg->reason; xpc_handle_activate_mq_msg_uv()
497 part->chctl.flags[msg->ch_number] |= XPC_CHCTL_CLOSEREQUEST; xpc_handle_activate_mq_msg_uv()
504 struct xpc_activate_mq_msg_chctl_closereply_uv *msg; xpc_handle_activate_mq_msg_uv() local
509 msg = container_of(msg_hdr, struct xpc_handle_activate_mq_msg_uv()
514 part->chctl.flags[msg->ch_number] |= XPC_CHCTL_CLOSEREPLY; xpc_handle_activate_mq_msg_uv()
521 struct xpc_activate_mq_msg_chctl_openrequest_uv *msg; xpc_handle_activate_mq_msg_uv() local
526 msg = container_of(msg_hdr, struct xpc_handle_activate_mq_msg_uv()
529 args = &part->remote_openclose_args[msg->ch_number]; xpc_handle_activate_mq_msg_uv()
530 args->entry_size = msg->entry_size; xpc_handle_activate_mq_msg_uv()
531 args->local_nentries = msg->local_nentries; xpc_handle_activate_mq_msg_uv()
534 part->chctl.flags[msg->ch_number] |= XPC_CHCTL_OPENREQUEST; xpc_handle_activate_mq_msg_uv()
541 struct xpc_activate_mq_msg_chctl_openreply_uv *msg; xpc_handle_activate_mq_msg_uv() local
546 msg = container_of(msg_hdr, struct xpc_handle_activate_mq_msg_uv()
548 args = &part->remote_openclose_args[msg->ch_number]; xpc_handle_activate_mq_msg_uv()
549 args->remote_nentries = msg->remote_nentries; xpc_handle_activate_mq_msg_uv()
550 args->local_nentries = msg->local_nentries; xpc_handle_activate_mq_msg_uv()
551 args->local_msgqueue_pa = msg->notify_gru_mq_desc_gpa; xpc_handle_activate_mq_msg_uv()
554 part->chctl.flags[msg->ch_number] |= XPC_CHCTL_OPENREPLY; xpc_handle_activate_mq_msg_uv()
561 struct xpc_activate_mq_msg_chctl_opencomplete_uv *msg; xpc_handle_activate_mq_msg_uv() local
566 msg = container_of(msg_hdr, struct xpc_handle_activate_mq_msg_uv()
569 part->chctl.flags[msg->ch_number] |= XPC_CHCTL_OPENCOMPLETE; xpc_handle_activate_mq_msg_uv()
587 dev_err(xpc_part, "received unknown activate_mq msg type=%d " xpc_handle_activate_mq_msg_uv()
672 xpc_send_activate_IRQ_uv(struct xpc_partition *part, void *msg, size_t msg_size, xpc_send_activate_IRQ_uv() argument
675 struct xpc_activate_mq_msghdr_uv *msg_hdr = msg; xpc_send_activate_IRQ_uv()
715 ret = xpc_send_gru_msg(part_uv->cached_activate_gru_mq_desc, msg, xpc_send_activate_IRQ_uv()
728 xpc_send_activate_IRQ_part_uv(struct xpc_partition *part, void *msg, xpc_send_activate_IRQ_part_uv() argument
733 ret = xpc_send_activate_IRQ_uv(part, msg, msg_size, msg_type); xpc_send_activate_IRQ_part_uv()
740 void *msg, size_t msg_size, int msg_type) xpc_send_activate_IRQ_ch_uv()
745 ret = xpc_send_activate_IRQ_uv(part, msg, msg_size, msg_type); xpc_send_activate_IRQ_ch_uv()
898 struct xpc_activate_mq_msg_activate_req_uv msg; xpc_request_partition_activation_uv() local
911 msg.rp_gpa = uv_gpa(xpc_rsvd_page); xpc_request_partition_activation_uv()
912 msg.heartbeat_gpa = xpc_rsvd_page->sn.uv.heartbeat_gpa; xpc_request_partition_activation_uv()
913 msg.activate_gru_mq_desc_gpa = xpc_request_partition_activation_uv()
915 xpc_send_activate_IRQ_part_uv(part, &msg, sizeof(msg), xpc_request_partition_activation_uv()
932 struct xpc_activate_mq_msg_deactivate_req_uv msg; xpc_request_partition_deactivation_uv() local
941 msg.reason = part->reason; xpc_request_partition_deactivation_uv()
942 xpc_send_activate_IRQ_part_uv(part, &msg, sizeof(msg), xpc_request_partition_deactivation_uv()
1040 struct xpc_activate_mq_msg_uv msg; xpc_make_first_contact_uv() local
1043 * We send a sync msg to get the remote partition's remote_act_state xpc_make_first_contact_uv()
1047 xpc_send_activate_IRQ_part_uv(part, &msg, sizeof(msg), xpc_make_first_contact_uv()
1202 struct xpc_activate_mq_msg_chctl_closerequest_uv msg; xpc_send_chctl_closerequest_uv() local
1204 msg.ch_number = ch->number; xpc_send_chctl_closerequest_uv()
1205 msg.reason = ch->reason; xpc_send_chctl_closerequest_uv()
1206 xpc_send_activate_IRQ_ch_uv(ch, irq_flags, &msg, sizeof(msg), xpc_send_chctl_closerequest_uv()
1213 struct xpc_activate_mq_msg_chctl_closereply_uv msg; xpc_send_chctl_closereply_uv() local
1215 msg.ch_number = ch->number; xpc_send_chctl_closereply_uv()
1216 xpc_send_activate_IRQ_ch_uv(ch, irq_flags, &msg, sizeof(msg), xpc_send_chctl_closereply_uv()
1223 struct xpc_activate_mq_msg_chctl_openrequest_uv msg; xpc_send_chctl_openrequest_uv() local
1225 msg.ch_number = ch->number; xpc_send_chctl_openrequest_uv()
1226 msg.entry_size = ch->entry_size; xpc_send_chctl_openrequest_uv()
1227 msg.local_nentries = ch->local_nentries; xpc_send_chctl_openrequest_uv()
1228 xpc_send_activate_IRQ_ch_uv(ch, irq_flags, &msg, sizeof(msg), xpc_send_chctl_openrequest_uv()
1235 struct xpc_activate_mq_msg_chctl_openreply_uv msg; xpc_send_chctl_openreply_uv() local
1237 msg.ch_number = ch->number; xpc_send_chctl_openreply_uv()
1238 msg.local_nentries = ch->local_nentries; xpc_send_chctl_openreply_uv()
1239 msg.remote_nentries = ch->remote_nentries; xpc_send_chctl_openreply_uv()
1240 msg.notify_gru_mq_desc_gpa = uv_gpa(xpc_notify_mq_uv->gru_mq_desc); xpc_send_chctl_openreply_uv()
1241 xpc_send_activate_IRQ_ch_uv(ch, irq_flags, &msg, sizeof(msg), xpc_send_chctl_openreply_uv()
1248 struct xpc_activate_mq_msg_chctl_opencomplete_uv msg; xpc_send_chctl_opencomplete_uv() local
1250 msg.ch_number = ch->number; xpc_send_chctl_opencomplete_uv()
1251 xpc_send_activate_IRQ_ch_uv(ch, irq_flags, &msg, sizeof(msg), xpc_send_chctl_opencomplete_uv()
1281 struct xpc_activate_mq_msg_uv msg; xpc_indicate_partition_engaged_uv() local
1283 xpc_send_activate_IRQ_part_uv(part, &msg, sizeof(msg), xpc_indicate_partition_engaged_uv()
1290 struct xpc_activate_mq_msg_uv msg; xpc_indicate_partition_disengaged_uv() local
1292 xpc_send_activate_IRQ_part_uv(part, &msg, sizeof(msg), xpc_indicate_partition_disengaged_uv()
1359 /* wakeup anyone waiting for a free msg slot */ xpc_free_msg_slot_uv()
1389 struct xpc_notify_mq_msg_uv *msg) xpc_handle_notify_mq_ack_uv()
1392 int entry = msg->hdr.msg_slot_number % ch->local_nentries; xpc_handle_notify_mq_ack_uv()
1396 BUG_ON(msg_slot->msg_slot_number != msg->hdr.msg_slot_number); xpc_handle_notify_mq_ack_uv()
1407 struct xpc_notify_mq_msg_uv *msg) xpc_handle_notify_mq_msg_uv()
1414 int ch_number = msg->hdr.ch_number; xpc_handle_notify_mq_msg_uv()
1441 /* see if we're really dealing with an ACK for a previously sent msg */ xpc_handle_notify_mq_msg_uv()
1442 if (msg->hdr.size == 0) { xpc_handle_notify_mq_msg_uv()
1443 xpc_handle_notify_mq_ack_uv(ch, msg); xpc_handle_notify_mq_msg_uv()
1452 (msg->hdr.msg_slot_number % ch->remote_nentries) * ch->entry_size; xpc_handle_notify_mq_msg_uv()
1456 memcpy(msg_slot, msg, msg->hdr.size); xpc_handle_notify_mq_msg_uv()
1477 struct xpc_notify_mq_msg_uv *msg; xpc_handle_notify_IRQ_uv() local
1481 while ((msg = gru_get_next_message(xpc_notify_mq_uv->gru_mq_desc)) != xpc_handle_notify_IRQ_uv()
1484 partid = msg->hdr.partid; xpc_handle_notify_IRQ_uv()
1492 xpc_handle_notify_mq_msg_uv(part, msg); xpc_handle_notify_IRQ_uv()
1497 gru_free_message(xpc_notify_mq_uv->gru_mq_desc, msg); xpc_handle_notify_IRQ_uv()
1536 struct xpc_notify_mq_msg_uv *msg; xpc_send_payload_uv() local
1574 msg = (struct xpc_notify_mq_msg_uv *)&msg_buffer; xpc_send_payload_uv()
1575 msg->hdr.partid = xp_partition_id; xpc_send_payload_uv()
1576 msg->hdr.ch_number = ch->number; xpc_send_payload_uv()
1577 msg->hdr.size = msg_size; xpc_send_payload_uv()
1578 msg->hdr.msg_slot_number = msg_slot->msg_slot_number; xpc_send_payload_uv()
1579 memcpy(&msg->payload, payload, payload_size); xpc_send_payload_uv()
1581 ret = xpc_send_gru_msg(ch->sn.uv.cached_notify_gru_mq_desc, msg, xpc_send_payload_uv()
1646 struct xpc_notify_mq_msg_uv *msg; xpc_get_deliverable_payload_uv() local
1652 msg = container_of(entry, struct xpc_notify_mq_msg_uv, xpc_get_deliverable_payload_uv()
1654 payload = &msg->payload; xpc_get_deliverable_payload_uv()
1663 struct xpc_notify_mq_msg_uv *msg; xpc_received_payload_uv() local
1666 msg = container_of(payload, struct xpc_notify_mq_msg_uv, payload); xpc_received_payload_uv()
1670 msg->hdr.partid = xp_partition_id; xpc_received_payload_uv()
1671 msg->hdr.size = 0; /* size of zero indicates this is an ACK */ xpc_received_payload_uv()
1673 ret = xpc_send_gru_msg(ch->sn.uv.cached_notify_gru_mq_desc, msg, xpc_received_payload_uv()
739 xpc_send_activate_IRQ_ch_uv(struct xpc_channel *ch, unsigned long *irq_flags, void *msg, size_t msg_size, int msg_type) xpc_send_activate_IRQ_ch_uv() argument
1388 xpc_handle_notify_mq_ack_uv(struct xpc_channel *ch, struct xpc_notify_mq_msg_uv *msg) xpc_handle_notify_mq_ack_uv() argument
1406 xpc_handle_notify_mq_msg_uv(struct xpc_partition *part, struct xpc_notify_mq_msg_uv *msg) xpc_handle_notify_mq_msg_uv() argument
H A Dxpnet.c83 && (msg->magic == XPNET_MAGIC))
147 xpnet_receive(short partid, int channel, struct xpnet_message *msg) xpnet_receive() argument
153 if (!XPNET_VALID_MSG(msg)) { xpnet_receive()
157 xpc_received(partid, channel, (void *)msg); xpnet_receive()
163 dev_dbg(xpnet, "received 0x%lx, %d, %d, %d\n", msg->buf_pa, msg->size, xpnet_receive()
164 msg->leadin_ignore, msg->tailout_ignore); xpnet_receive()
167 skb = dev_alloc_skb(msg->size + L1_CACHE_BYTES); xpnet_receive()
170 msg->size + L1_CACHE_BYTES); xpnet_receive()
172 xpc_received(partid, channel, (void *)msg); xpnet_receive()
186 msg->leadin_ignore)); xpnet_receive()
192 skb_put(skb, (msg->size - msg->leadin_ignore - msg->tailout_ignore)); xpnet_receive()
197 if ((XPNET_VERSION_MINOR(msg->version) == 1) && xpnet_receive()
198 (msg->embedded_bytes != 0)) { xpnet_receive()
200 "%lu)\n", skb->data, &msg->data, xpnet_receive()
201 (size_t)msg->embedded_bytes); xpnet_receive()
203 skb_copy_to_linear_data(skb, &msg->data, xpnet_receive()
204 (size_t)msg->embedded_bytes); xpnet_receive()
209 (void *)msg->buf_pa, msg->size); xpnet_receive()
211 ret = xp_remote_memcpy(xp_pa(dst), msg->buf_pa, msg->size); xpnet_receive()
220 (void *)msg->buf_pa, msg->size, ret); xpnet_receive()
222 xpc_received(partid, channel, (void *)msg); xpnet_receive()
248 xpc_received(partid, channel, (void *)msg); xpnet_receive()
380 struct xpnet_message *msg = (struct xpnet_message *)&msg_buffer; xpnet_send() local
384 msg->embedded_bytes = embedded_bytes; xpnet_send()
386 msg->version = XPNET_VERSION_EMBED; xpnet_send()
388 &msg->data, skb->data, (size_t)embedded_bytes); xpnet_send()
389 skb_copy_from_linear_data(skb, &msg->data, xpnet_send()
393 msg->version = XPNET_VERSION; xpnet_send()
395 msg->magic = XPNET_MAGIC; xpnet_send()
396 msg->size = end_addr - start_addr; xpnet_send()
397 msg->leadin_ignore = (u64)skb->data - start_addr; xpnet_send()
398 msg->tailout_ignore = end_addr - (u64)skb_tail_pointer(skb); xpnet_send()
399 msg->buf_pa = xp_pa((void *)start_addr); xpnet_send()
402 "msg->buf_pa=0x%lx, msg->size=%u, " xpnet_send()
403 "msg->leadin_ignore=%u, msg->tailout_ignore=%u\n", xpnet_send()
404 dest_partid, XPC_NET_CHANNEL, msg->buf_pa, msg->size, xpnet_send()
405 msg->leadin_ignore, msg->tailout_ignore); xpnet_send()
409 ret = xpc_send_notify(dest_partid, XPC_NET_CHANNEL, XPC_NOWAIT, msg, xpnet_send()
/linux-4.4.14/sound/oss/
H A Dmidi_synth.c44 do_midi_msg(int synthno, unsigned char *msg, int mlen) do_midi_msg() argument
46 switch (msg[0] & 0xf0) do_midi_msg()
49 if (msg[2] != 0) do_midi_msg()
51 STORE(SEQ_START_NOTE(synthno, msg[0] & 0x0f, msg[1], msg[2])); do_midi_msg()
54 msg[2] = 64; do_midi_msg()
57 STORE(SEQ_STOP_NOTE(synthno, msg[0] & 0x0f, msg[1], msg[2])); do_midi_msg()
61 STORE(SEQ_KEY_PRESSURE(synthno, msg[0] & 0x0f, msg[1], msg[2])); do_midi_msg()
65 STORE(SEQ_CONTROL(synthno, msg[0] & 0x0f, do_midi_msg()
66 msg[1], msg[2])); do_midi_msg()
70 STORE(SEQ_SET_PATCH(synthno, msg[0] & 0x0f, msg[1])); do_midi_msg()
74 STORE(SEQ_CHN_PRESSURE(synthno, msg[0] & 0x0f, msg[1])); do_midi_msg()
78 STORE(SEQ_BENDER(synthno, msg[0] & 0x0f, do_midi_msg()
79 (msg[1] & 0x7f) | ((msg[2] & 0x7f) << 7))); do_midi_msg()
83 /* printk( "MPU: Unknown midi channel message %02x\n", msg[0]); */ do_midi_msg()
286 int msg, chn; midi_synth_kill_note() local
299 msg = prev_out_status[orig_dev] & 0xf0; midi_synth_kill_note()
302 if (chn == channel && ((msg == 0x90 && velocity == 64) || msg == 0x80)) midi_synth_kill_note()
311 if (msg == 0x90) /* midi_synth_kill_note()
376 int msg, chn; midi_synth_start_note() local
389 msg = prev_out_status[orig_dev] & 0xf0; midi_synth_start_note()
392 if (chn == channel && msg == 0x90) midi_synth_start_note()
562 int msg, chn; midi_synth_aftertouch() local
571 msg = prev_out_status[orig_dev] & 0xf0; midi_synth_aftertouch()
574 if (msg != 0xd0 || chn != channel) /* midi_synth_aftertouch()
594 int chn, msg; midi_synth_controller() local
603 msg = prev_out_status[orig_dev] & 0xf0; midi_synth_controller()
606 if (msg != 0xb0 || chn != channel) midi_synth_controller()
623 int msg, prev_chn; midi_synth_bender() local
633 msg = prev_out_status[orig_dev] & 0xf0; midi_synth_bender()
636 if (msg != 0xd0 || prev_chn != channel) /* midi_synth_bender()
/linux-4.4.14/fs/nfs/
H A Dnfs3proc.c31 nfs3_rpc_wrapper(struct rpc_clnt *clnt, struct rpc_message *msg, int flags) nfs3_rpc_wrapper() argument
35 res = rpc_call_sync(clnt, msg, flags); nfs3_rpc_wrapper()
44 #define rpc_call_sync(clnt, msg, flags) nfs3_rpc_wrapper(clnt, msg, flags)
63 struct rpc_message msg = { do_proc_get_root() local
72 status = rpc_call_sync(client, &msg, 0); do_proc_get_root()
75 msg.rpc_proc = &nfs3_procedures[NFS3PROC_GETATTR]; do_proc_get_root()
76 msg.rpc_resp = info->fattr; do_proc_get_root()
77 status = rpc_call_sync(client, &msg, 0); do_proc_get_root()
105 struct rpc_message msg = { nfs3_proc_getattr() local
114 status = rpc_call_sync(server->client, &msg, 0); nfs3_proc_getattr()
128 struct rpc_message msg = { nfs3_proc_setattr() local
137 msg.rpc_cred = nfs_file_cred(sattr->ia_file); nfs3_proc_setattr()
139 status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); nfs3_proc_setattr()
160 struct rpc_message msg = { nfs3_proc_lookup() local
173 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs3_proc_lookup()
176 msg.rpc_proc = &nfs3_procedures[NFS3PROC_GETATTR]; nfs3_proc_lookup()
177 msg.rpc_argp = fhandle; nfs3_proc_lookup()
178 msg.rpc_resp = fattr; nfs3_proc_lookup()
179 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs3_proc_lookup()
192 struct rpc_message msg = { nfs3_proc_access() local
221 status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); nfs3_proc_access()
248 struct rpc_message msg = { nfs3_proc_readlink() local
258 msg.rpc_resp = fattr; nfs3_proc_readlink()
260 status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); nfs3_proc_readlink()
269 struct rpc_message msg; member in struct:nfs3_createdata
288 data->msg.rpc_argp = &data->arg; nfs3_alloc_createdata()
289 data->msg.rpc_resp = &data->res; nfs3_alloc_createdata()
303 status = rpc_call_sync(NFS_CLIENT(dir), &data->msg, 0); nfs3_do_create()
332 data->msg.rpc_proc = &nfs3_procedures[NFS3PROC_CREATE]; nfs3_proc_create()
414 struct rpc_message msg = { nfs3_proc_remove() local
426 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs3_proc_remove()
435 nfs3_proc_unlink_setup(struct rpc_message *msg, struct inode *dir) nfs3_proc_unlink_setup() argument
437 msg->rpc_proc = &nfs3_procedures[NFS3PROC_REMOVE]; nfs3_proc_unlink_setup()
457 nfs3_proc_rename_setup(struct rpc_message *msg, struct inode *dir) nfs3_proc_rename_setup() argument
459 msg->rpc_proc = &nfs3_procedures[NFS3PROC_RENAME]; nfs3_proc_rename_setup()
492 struct rpc_message msg = { nfs3_proc_link() local
505 status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); nfs3_proc_link()
530 data->msg.rpc_proc = &nfs3_procedures[NFS3PROC_SYMLINK]; nfs3_proc_symlink()
563 data->msg.rpc_proc = &nfs3_procedures[NFS3PROC_MKDIR]; nfs3_proc_mkdir()
593 struct rpc_message msg = { nfs3_proc_rmdir() local
604 msg.rpc_resp = dir_attr; nfs3_proc_rmdir()
605 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs3_proc_rmdir()
640 struct rpc_message msg = { nfs3_proc_readdir() local
649 msg.rpc_proc = &nfs3_procedures[NFS3PROC_READDIRPLUS]; nfs3_proc_readdir()
658 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs3_proc_readdir()
689 data->msg.rpc_proc = &nfs3_procedures[NFS3PROC_MKNOD]; nfs3_proc_mknod()
733 struct rpc_message msg = { nfs3_proc_statfs() local
742 status = rpc_call_sync(server->client, &msg, 0); nfs3_proc_statfs()
751 struct rpc_message msg = { do_proc_fsinfo() local
760 status = rpc_call_sync(client, &msg, 0); do_proc_fsinfo()
785 struct rpc_message msg = { nfs3_proc_pathconf() local
794 status = rpc_call_sync(server->client, &msg, 0); nfs3_proc_pathconf()
815 struct rpc_message *msg) nfs3_proc_read_setup()
817 msg->rpc_proc = &nfs3_procedures[NFS3PROC_READ]; nfs3_proc_read_setup()
842 struct rpc_message *msg) nfs3_proc_write_setup()
844 msg->rpc_proc = &nfs3_procedures[NFS3PROC_WRITE]; nfs3_proc_write_setup()
863 static void nfs3_proc_commit_setup(struct nfs_commit_data *data, struct rpc_message *msg) nfs3_proc_commit_setup() argument
865 msg->rpc_proc = &nfs3_procedures[NFS3PROC_COMMIT]; nfs3_proc_commit_setup()
814 nfs3_proc_read_setup(struct nfs_pgio_header *hdr, struct rpc_message *msg) nfs3_proc_read_setup() argument
841 nfs3_proc_write_setup(struct nfs_pgio_header *hdr, struct rpc_message *msg) nfs3_proc_write_setup() argument
H A Dproc.c58 struct rpc_message msg = { nfs_proc_get_root() local
67 status = rpc_call_sync(server->client, &msg, 0); nfs_proc_get_root()
70 status = rpc_call_sync(server->nfs_client->cl_rpcclient, &msg, 0); nfs_proc_get_root()
75 msg.rpc_proc = &nfs_procedures[NFSPROC_STATFS]; nfs_proc_get_root()
76 msg.rpc_resp = &fsinfo; nfs_proc_get_root()
77 status = rpc_call_sync(server->client, &msg, 0); nfs_proc_get_root()
80 status = rpc_call_sync(server->nfs_client->cl_rpcclient, &msg, 0); nfs_proc_get_root()
103 struct rpc_message msg = { nfs_proc_getattr() local
112 status = rpc_call_sync(server->client, &msg, 0); nfs_proc_getattr()
126 struct rpc_message msg = { nfs_proc_setattr() local
138 msg.rpc_cred = nfs_file_cred(sattr->ia_file); nfs_proc_setattr()
140 status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); nfs_proc_setattr()
161 struct rpc_message msg = { nfs_proc_lookup() local
170 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_proc_lookup()
184 struct rpc_message msg = { nfs_proc_readlink() local
191 status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); nfs_proc_readlink()
233 struct rpc_message msg = { nfs_proc_create() local
242 msg.rpc_argp = &data->arg; nfs_proc_create()
243 msg.rpc_resp = &data->res; nfs_proc_create()
244 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_proc_create()
262 struct rpc_message msg = { nfs_proc_mknod() local
282 msg.rpc_argp = &data->arg; nfs_proc_mknod()
283 msg.rpc_resp = &data->res; nfs_proc_mknod()
285 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_proc_mknod()
291 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_proc_mknod()
308 struct rpc_message msg = { nfs_proc_remove() local
315 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_proc_remove()
323 nfs_proc_unlink_setup(struct rpc_message *msg, struct inode *dir) nfs_proc_unlink_setup() argument
325 msg->rpc_proc = &nfs_procedures[NFSPROC_REMOVE]; nfs_proc_unlink_setup()
340 nfs_proc_rename_setup(struct rpc_message *msg, struct inode *dir) nfs_proc_rename_setup() argument
342 msg->rpc_proc = &nfs_procedures[NFSPROC_RENAME]; nfs_proc_rename_setup()
368 struct rpc_message msg = { nfs_proc_link() local
375 status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); nfs_proc_link()
396 struct rpc_message msg = { nfs_proc_symlink() local
413 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_proc_symlink()
436 struct rpc_message msg = { nfs_proc_mkdir() local
445 msg.rpc_argp = &data->arg; nfs_proc_mkdir()
446 msg.rpc_resp = &data->res; nfs_proc_mkdir()
448 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_proc_mkdir()
466 struct rpc_message msg = { nfs_proc_rmdir() local
473 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_proc_rmdir()
497 struct rpc_message msg = { nfs_proc_readdir() local
505 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_proc_readdir()
518 struct rpc_message msg = { nfs_proc_statfs() local
527 status = rpc_call_sync(server->client, &msg, 0); nfs_proc_statfs()
546 struct rpc_message msg = { nfs_proc_fsinfo() local
555 status = rpc_call_sync(server->client, &msg, 0); nfs_proc_fsinfo()
598 struct rpc_message *msg) nfs_proc_read_setup()
600 msg->rpc_proc = &nfs_procedures[NFSPROC_READ]; nfs_proc_read_setup()
618 struct rpc_message *msg) nfs_proc_write_setup()
622 msg->rpc_proc = &nfs_procedures[NFSPROC_WRITE]; nfs_proc_write_setup()
631 nfs_proc_commit_setup(struct nfs_commit_data *data, struct rpc_message *msg) nfs_proc_commit_setup() argument
597 nfs_proc_read_setup(struct nfs_pgio_header *hdr, struct rpc_message *msg) nfs_proc_read_setup() argument
617 nfs_proc_write_setup(struct nfs_pgio_header *hdr, struct rpc_message *msg) nfs_proc_write_setup() argument
H A Dnfs42proc.c40 static int _nfs42_proc_fallocate(struct rpc_message *msg, struct file *filep, _nfs42_proc_fallocate() argument
56 msg->rpc_argp = &args; _nfs42_proc_fallocate()
57 msg->rpc_resp = &res; _nfs42_proc_fallocate()
67 status = nfs4_call_sync(server->client, server, msg, _nfs42_proc_fallocate()
76 static int nfs42_proc_fallocate(struct rpc_message *msg, struct file *filep, nfs42_proc_fallocate() argument
84 err = _nfs42_proc_fallocate(msg, filep, offset, len); nfs42_proc_fallocate()
95 struct rpc_message msg = { nfs42_proc_allocate() local
106 err = nfs42_proc_fallocate(&msg, filep, offset, len); nfs42_proc_allocate()
116 struct rpc_message msg = { nfs42_proc_deallocate() local
128 err = nfs42_proc_fallocate(&msg, filep, offset, len); nfs42_proc_deallocate()
148 struct rpc_message msg = { _nfs42_proc_llseek() local
164 status = nfs4_call_sync(server->client, server, &msg, _nfs42_proc_llseek()
249 struct rpc_message msg = { nfs42_proc_layoutstats_generic() local
256 .rpc_message = &msg, nfs42_proc_layoutstats_generic()
275 static int _nfs42_proc_clone(struct rpc_message *msg, struct file *src_f, _nfs42_proc_clone() argument
295 msg->rpc_argp = &args; _nfs42_proc_clone()
296 msg->rpc_resp = &res; _nfs42_proc_clone()
310 status = nfs4_call_sync(server->client, server, msg, _nfs42_proc_clone()
322 struct rpc_message msg = { nfs42_proc_clone() local
334 err = _nfs42_proc_clone(&msg, src_f, dst_f, src_offset, nfs42_proc_clone()
/linux-4.4.14/drivers/net/can/
H A Djanz-ican3.c295 static int ican3_old_recv_msg(struct ican3_dev *mod, struct ican3_msg *msg) ican3_old_recv_msg() argument
320 memcpy_fromio(msg, mod->dpm, sizeof(*msg)); ican3_old_recv_msg()
340 static int ican3_old_send_msg(struct ican3_dev *mod, struct ican3_msg *msg) ican3_old_send_msg() argument
362 memcpy_toio(mod->dpm, msg, sizeof(*msg)); ican3_old_send_msg()
544 static int ican3_new_send_msg(struct ican3_dev *mod, struct ican3_msg *msg) ican3_new_send_msg() argument
560 memcpy_toio(mod->dpm, msg, sizeof(*msg)); ican3_new_send_msg()
575 static int ican3_new_recv_msg(struct ican3_dev *mod, struct ican3_msg *msg) ican3_new_recv_msg() argument
591 memcpy_fromio(msg, mod->dpm, sizeof(*msg)); ican3_new_recv_msg()
607 static int ican3_send_msg(struct ican3_dev *mod, struct ican3_msg *msg) ican3_send_msg() argument
615 ret = ican3_old_send_msg(mod, msg); ican3_send_msg()
617 ret = ican3_new_send_msg(mod, msg); ican3_send_msg()
623 static int ican3_recv_msg(struct ican3_dev *mod, struct ican3_msg *msg) ican3_recv_msg() argument
631 ret = ican3_old_recv_msg(mod, msg); ican3_recv_msg()
633 ret = ican3_new_recv_msg(mod, msg); ican3_recv_msg()
645 struct ican3_msg msg; ican3_msg_connect() local
647 memset(&msg, 0, sizeof(msg)); ican3_msg_connect()
648 msg.spec = MSG_CONNECTI; ican3_msg_connect()
649 msg.len = cpu_to_le16(0); ican3_msg_connect()
651 return ican3_send_msg(mod, &msg); ican3_msg_connect()
656 struct ican3_msg msg; ican3_msg_disconnect() local
658 memset(&msg, 0, sizeof(msg)); ican3_msg_disconnect()
659 msg.spec = MSG_DISCONNECT; ican3_msg_disconnect()
660 msg.len = cpu_to_le16(0); ican3_msg_disconnect()
662 return ican3_send_msg(mod, &msg); ican3_msg_disconnect()
667 struct ican3_msg msg; ican3_msg_newhostif() local
670 memset(&msg, 0, sizeof(msg)); ican3_msg_newhostif()
671 msg.spec = MSG_NEWHOSTIF; ican3_msg_newhostif()
672 msg.len = cpu_to_le16(0); ican3_msg_newhostif()
677 ret = ican3_send_msg(mod, &msg); ican3_msg_newhostif()
688 struct ican3_msg msg; ican3_msg_fasthostif() local
691 memset(&msg, 0, sizeof(msg)); ican3_msg_fasthostif()
692 msg.spec = MSG_INITFDPMQUEUE; ican3_msg_fasthostif()
693 msg.len = cpu_to_le16(8); ican3_msg_fasthostif()
697 msg.data[0] = addr & 0xff; ican3_msg_fasthostif()
698 msg.data[1] = (addr >> 8) & 0xff; ican3_msg_fasthostif()
699 msg.data[2] = (addr >> 16) & 0xff; ican3_msg_fasthostif()
700 msg.data[3] = (addr >> 24) & 0xff; ican3_msg_fasthostif()
704 msg.data[4] = addr & 0xff; ican3_msg_fasthostif()
705 msg.data[5] = (addr >> 8) & 0xff; ican3_msg_fasthostif()
706 msg.data[6] = (addr >> 16) & 0xff; ican3_msg_fasthostif()
707 msg.data[7] = (addr >> 24) & 0xff; ican3_msg_fasthostif()
712 return ican3_send_msg(mod, &msg); ican3_msg_fasthostif()
721 struct ican3_msg msg; ican3_set_id_filter() local
725 memset(&msg, 0, sizeof(msg)); ican3_set_id_filter()
726 msg.spec = MSG_SETAFILMASK; ican3_set_id_filter()
727 msg.len = cpu_to_le16(5); ican3_set_id_filter()
728 msg.data[0] = 0x00; /* IDLo LSB */ ican3_set_id_filter()
729 msg.data[1] = 0x00; /* IDLo MSB */ ican3_set_id_filter()
730 msg.data[2] = 0xff; /* IDHi LSB */ ican3_set_id_filter()
731 msg.data[3] = 0x07; /* IDHi MSB */ ican3_set_id_filter()
734 msg.data[4] = accept ? SETAFILMASK_FASTIF : SETAFILMASK_REJECT; ican3_set_id_filter()
736 ret = ican3_send_msg(mod, &msg); ican3_set_id_filter()
741 memset(&msg, 0, sizeof(msg)); ican3_set_id_filter()
742 msg.spec = MSG_SETAFILMASK; ican3_set_id_filter()
743 msg.len = cpu_to_le16(13); ican3_set_id_filter()
744 msg.data[0] = 0; /* MUX = 0 */ ican3_set_id_filter()
745 msg.data[1] = 0x00; /* IDLo LSB */ ican3_set_id_filter()
746 msg.data[2] = 0x00; ican3_set_id_filter()
747 msg.data[3] = 0x00; ican3_set_id_filter()
748 msg.data[4] = 0x20; /* IDLo MSB */ ican3_set_id_filter()
749 msg.data[5] = 0xff; /* IDHi LSB */ ican3_set_id_filter()
750 msg.data[6] = 0xff; ican3_set_id_filter()
751 msg.data[7] = 0xff; ican3_set_id_filter()
752 msg.data[8] = 0x3f; /* IDHi MSB */ ican3_set_id_filter()
755 msg.data[9] = accept ? SETAFILMASK_FASTIF : SETAFILMASK_REJECT; ican3_set_id_filter()
757 return ican3_send_msg(mod, &msg); ican3_set_id_filter()
766 struct ican3_msg msg; ican3_set_bus_state() local
782 memset(&msg, 0, sizeof(msg)); ican3_set_bus_state()
783 msg.spec = MSG_CBTRREQ; ican3_set_bus_state()
784 msg.len = cpu_to_le16(4); ican3_set_bus_state()
785 msg.data[0] = 0x00; ican3_set_bus_state()
786 msg.data[1] = 0x00; ican3_set_bus_state()
787 msg.data[2] = btr0; ican3_set_bus_state()
788 msg.data[3] = btr1; ican3_set_bus_state()
790 res = ican3_send_msg(mod, &msg); ican3_set_bus_state()
796 memset(&msg, 0, sizeof(msg)); ican3_set_bus_state()
797 msg.spec = on ? MSG_CONREQ : MSG_COFFREQ; ican3_set_bus_state()
798 msg.len = cpu_to_le16(0); ican3_set_bus_state()
800 return ican3_send_msg(mod, &msg); ican3_set_bus_state()
803 memset(&msg, 0, sizeof(msg)); ican3_set_bus_state()
804 msg.spec = MSG_LMTS; ican3_set_bus_state()
806 msg.len = cpu_to_le16(4); ican3_set_bus_state()
807 msg.data[0] = 0; ican3_set_bus_state()
808 msg.data[1] = 0; ican3_set_bus_state()
809 msg.data[2] = btr0; ican3_set_bus_state()
810 msg.data[3] = btr1; ican3_set_bus_state()
812 msg.len = cpu_to_le16(2); ican3_set_bus_state()
813 msg.data[0] = 1; ican3_set_bus_state()
814 msg.data[1] = 0; ican3_set_bus_state()
817 return ican3_send_msg(mod, &msg); ican3_set_bus_state()
824 struct ican3_msg msg; ican3_set_termination() local
826 memset(&msg, 0, sizeof(msg)); ican3_set_termination()
827 msg.spec = MSG_HWCONF; ican3_set_termination()
828 msg.len = cpu_to_le16(2); ican3_set_termination()
829 msg.data[0] = 0x00; ican3_set_termination()
830 msg.data[1] = on ? HWCONF_TERMINATE_ON : HWCONF_TERMINATE_OFF; ican3_set_termination()
832 return ican3_send_msg(mod, &msg); ican3_set_termination()
837 struct ican3_msg msg; ican3_send_inquiry() local
839 memset(&msg, 0, sizeof(msg)); ican3_send_inquiry()
840 msg.spec = MSG_INQUIRY; ican3_send_inquiry()
841 msg.len = cpu_to_le16(2); ican3_send_inquiry()
842 msg.data[0] = subspec; ican3_send_inquiry()
843 msg.data[1] = 0x00; ican3_send_inquiry()
845 return ican3_send_msg(mod, &msg); ican3_send_inquiry()
850 struct ican3_msg msg; ican3_set_buserror() local
852 memset(&msg, 0, sizeof(msg)); ican3_set_buserror()
853 msg.spec = MSG_CCONFREQ; ican3_set_buserror()
854 msg.len = cpu_to_le16(2); ican3_set_buserror()
855 msg.data[0] = 0x00; ican3_set_buserror()
856 msg.data[1] = quota; ican3_set_buserror()
858 return ican3_send_msg(mod, &msg); ican3_set_buserror()
941 static void ican3_handle_idvers(struct ican3_dev *mod, struct ican3_msg *msg) ican3_handle_idvers() argument
943 netdev_dbg(mod->ndev, "IDVERS response: %s\n", msg->data); ican3_handle_idvers()
946 static void ican3_handle_msglost(struct ican3_dev *mod, struct ican3_msg *msg) ican3_handle_msglost() argument
958 if (msg->spec == MSG_MSGLOST) { ican3_handle_msglost()
959 netdev_err(mod->ndev, "lost %d control messages\n", msg->data[0]); ican3_handle_msglost()
988 static int ican3_handle_cevtind(struct ican3_dev *mod, struct ican3_msg *msg) ican3_handle_cevtind() argument
998 if (msg->data[1] != CEVTIND_CHIP_SJA1000) { ican3_handle_cevtind()
1004 if (le16_to_cpu(msg->len) < 6) { ican3_handle_cevtind()
1009 isrc = msg->data[0]; ican3_handle_cevtind()
1010 ecc = msg->data[2]; ican3_handle_cevtind()
1011 status = msg->data[3]; ican3_handle_cevtind()
1012 rxerr = msg->data[4]; ican3_handle_cevtind()
1013 txerr = msg->data[5]; ican3_handle_cevtind()
1134 static void ican3_handle_inquiry(struct ican3_dev *mod, struct ican3_msg *msg) ican3_handle_inquiry() argument
1136 switch (msg->data[0]) { ican3_handle_inquiry()
1139 mod->bec.rxerr = msg->data[5]; ican3_handle_inquiry()
1140 mod->bec.txerr = msg->data[6]; ican3_handle_inquiry()
1144 mod->termination_enabled = msg->data[6] & HWCONF_TERMINATE_ON; ican3_handle_inquiry()
1154 struct ican3_msg *msg) ican3_handle_unknown_message()
1157 msg->spec, le16_to_cpu(msg->len)); ican3_handle_unknown_message()
1163 static void ican3_handle_message(struct ican3_dev *mod, struct ican3_msg *msg) ican3_handle_message() argument
1166 mod->num, msg->spec, le16_to_cpu(msg->len)); ican3_handle_message()
1168 switch (msg->spec) { ican3_handle_message()
1170 ican3_handle_idvers(mod, msg); ican3_handle_message()
1174 ican3_handle_msglost(mod, msg); ican3_handle_message()
1177 ican3_handle_cevtind(mod, msg); ican3_handle_message()
1180 ican3_handle_inquiry(mod, msg); ican3_handle_message()
1183 ican3_handle_unknown_message(mod, msg); ican3_handle_message()
1372 struct ican3_msg uninitialized_var(msg); ican3_napi()
1373 ret = ican3_recv_msg(mod, &msg); ican3_napi()
1377 ican3_handle_message(mod, &msg); ican3_napi()
1153 ican3_handle_unknown_message(struct ican3_dev *mod, struct ican3_msg *msg) ican3_handle_unknown_message() argument
/linux-4.4.14/drivers/media/usb/dvb-usb-v2/
H A Dgl861.c53 static int gl861_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], gl861_i2c_xfer() argument
67 if (i+1 < num && (msg[i+1].flags & I2C_M_RD)) { gl861_i2c_xfer()
68 if (gl861_i2c_msg(d, msg[i].addr, msg[i].buf, gl861_i2c_xfer()
69 msg[i].len, msg[i+1].buf, msg[i+1].len) < 0) gl861_i2c_xfer()
73 if (gl861_i2c_msg(d, msg[i].addr, msg[i].buf, gl861_i2c_xfer()
74 msg[i].len, NULL, 0) < 0) gl861_i2c_xfer()
H A Dmxl111sf-i2c.c239 struct i2c_msg *msg) mxl111sf_i2c_sw_xfer_msg()
245 if (msg->flags & I2C_M_RD) { mxl111sf_i2c_sw_xfer_msg()
252 (msg->addr << 1) | 0x01); mxl111sf_i2c_sw_xfer_msg()
258 for (i = 0; i < msg->len; i++) { mxl111sf_i2c_sw_xfer_msg()
260 &msg->buf[i]); mxl111sf_i2c_sw_xfer_msg()
266 if (i < msg->len - 1) mxl111sf_i2c_sw_xfer_msg()
283 (msg->addr << 1) & 0xfe); mxl111sf_i2c_sw_xfer_msg()
289 for (i = 0; i < msg->len; i++) { mxl111sf_i2c_sw_xfer_msg()
291 msg->buf[i]); mxl111sf_i2c_sw_xfer_msg()
441 struct i2c_msg *msg) mxl111sf_i2c_hw_xfer_msg()
454 msg->addr, (msg->flags & I2C_M_RD) ? msg->len : 0, mxl111sf_i2c_hw_xfer_msg()
455 (!(msg->flags & I2C_M_RD)) ? msg->len : 0); mxl111sf_i2c_hw_xfer_msg()
491 if (!(msg->flags & I2C_M_RD) && (msg->len > 0)) { mxl111sf_i2c_hw_xfer_msg()
492 mxl_i2c("%d\t%02x", msg->len, msg->buf[0]); mxl111sf_i2c_hw_xfer_msg()
501 buf[6] = (msg->addr); mxl111sf_i2c_hw_xfer_msg()
509 msg->addr); mxl111sf_i2c_hw_xfer_msg()
521 block_len = (msg->len / 8); mxl111sf_i2c_hw_xfer_msg()
522 left_over_len = (msg->len % 8); mxl111sf_i2c_hw_xfer_msg()
532 buf[3+(i*3)] = msg->buf[(index*8)+i]; mxl111sf_i2c_hw_xfer_msg()
541 msg->addr); mxl111sf_i2c_hw_xfer_msg()
562 buf[3+(i*3)] = msg->buf[(index*8)+i]; mxl111sf_i2c_hw_xfer_msg()
564 index, i, msg->buf[(index*8)+i]); mxl111sf_i2c_hw_xfer_msg()
572 msg->addr); mxl111sf_i2c_hw_xfer_msg()
592 if ((msg->flags & I2C_M_RD) && (msg->len > 0)) { mxl111sf_i2c_hw_xfer_msg()
593 mxl_i2c("read buf len %d", msg->len); mxl111sf_i2c_hw_xfer_msg()
603 buf[6] = (msg->len & 0xFF); mxl111sf_i2c_hw_xfer_msg()
608 buf[9] = msg->addr; mxl111sf_i2c_hw_xfer_msg()
616 msg->addr); mxl111sf_i2c_hw_xfer_msg()
629 block_len = ((msg->len) / 8); mxl111sf_i2c_hw_xfer_msg()
630 left_over_len = ((msg->len) % 8); mxl111sf_i2c_hw_xfer_msg()
653 msg->addr); mxl111sf_i2c_hw_xfer_msg()
671 msg->buf[(index*8)+i] = mxl111sf_i2c_hw_xfer_msg()
683 msg->buf[(index*8)+(k+i+1)] = mxl111sf_i2c_hw_xfer_msg()
686 msg->buf[(index*8)+(k+i)], mxl111sf_i2c_hw_xfer_msg()
689 msg->buf[(index*8)+(k+i+1)], mxl111sf_i2c_hw_xfer_msg()
699 msg->buf[(index*8)+i] = mxl111sf_i2c_hw_xfer_msg()
703 msg->buf[(index*8)+i] = mxl111sf_i2c_hw_xfer_msg()
730 msg->addr); mxl111sf_i2c_hw_xfer_msg()
741 msg->buf[(block_len*8)+i] = mxl111sf_i2c_hw_xfer_msg()
815 struct i2c_msg msg[], int num) mxl111sf_i2c_xfer()
827 mxl111sf_i2c_hw_xfer_msg(state, &msg[i]) : mxl111sf_i2c_xfer()
828 mxl111sf_i2c_sw_xfer_msg(state, &msg[i]); mxl111sf_i2c_xfer()
833 (msg[i].flags & I2C_M_RD) ? mxl111sf_i2c_xfer()
835 msg[i].len, msg[i].addr); mxl111sf_i2c_xfer()
238 mxl111sf_i2c_sw_xfer_msg(struct mxl111sf_state *state, struct i2c_msg *msg) mxl111sf_i2c_sw_xfer_msg() argument
440 mxl111sf_i2c_hw_xfer_msg(struct mxl111sf_state *state, struct i2c_msg *msg) mxl111sf_i2c_hw_xfer_msg() argument
814 mxl111sf_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num) mxl111sf_i2c_xfer() argument
H A Dau6610.c96 static int au6610_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], au6610_i2c_xfer() argument
110 if (i+1 < num && (msg[i+1].flags & I2C_M_RD)) { au6610_i2c_xfer()
111 if (au6610_i2c_msg(d, msg[i].addr, msg[i].buf, au6610_i2c_xfer()
112 msg[i].len, msg[i+1].buf, au6610_i2c_xfer()
113 msg[i+1].len) < 0) au6610_i2c_xfer()
116 } else if (au6610_i2c_msg(d, msg[i].addr, msg[i].buf, au6610_i2c_xfer()
117 msg[i].len, NULL, 0) < 0) au6610_i2c_xfer()
H A Dce6230.c100 struct i2c_msg msg[], int num) ce6230_i2c_master_xfer()
115 if (num > i + 1 && (msg[i+1].flags & I2C_M_RD)) { ce6230_i2c_master_xfer()
116 if (msg[i].addr == ce6230_i2c_master_xfer()
119 req.value = msg[i].addr >> 1; ce6230_i2c_master_xfer()
120 req.index = msg[i].buf[0]; ce6230_i2c_master_xfer()
121 req.data_len = msg[i+1].len; ce6230_i2c_master_xfer()
122 req.data = &msg[i+1].buf[0]; ce6230_i2c_master_xfer()
132 if (msg[i].addr == ce6230_i2c_master_xfer()
135 req.value = msg[i].addr >> 1; ce6230_i2c_master_xfer()
136 req.index = msg[i].buf[0]; ce6230_i2c_master_xfer()
137 req.data_len = msg[i].len-1; ce6230_i2c_master_xfer()
138 req.data = &msg[i].buf[1]; ce6230_i2c_master_xfer()
142 req.value = 0x2000 + (msg[i].addr >> 1); ce6230_i2c_master_xfer()
144 req.data_len = msg[i].len; ce6230_i2c_master_xfer()
145 req.data = &msg[i].buf[0]; ce6230_i2c_master_xfer()
99 ce6230_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num) ce6230_i2c_master_xfer() argument
/linux-4.4.14/include/linux/mfd/
H A Dipaq-micro.h101 * @msg: current message
116 struct ipaq_micro_msg *msg; member in struct:ipaq_micro
125 ipaq_micro_tx_msg(struct ipaq_micro *micro, struct ipaq_micro_msg *msg);
129 struct ipaq_micro_msg *msg) ipaq_micro_tx_msg_sync()
133 init_completion(&msg->ack); ipaq_micro_tx_msg_sync()
134 ret = ipaq_micro_tx_msg(micro, msg); ipaq_micro_tx_msg_sync()
135 wait_for_completion(&msg->ack); ipaq_micro_tx_msg_sync()
142 struct ipaq_micro_msg *msg) ipaq_micro_tx_msg_async()
144 init_completion(&msg->ack); ipaq_micro_tx_msg_async()
145 return ipaq_micro_tx_msg(micro, msg); ipaq_micro_tx_msg_async()
128 ipaq_micro_tx_msg_sync(struct ipaq_micro *micro, struct ipaq_micro_msg *msg) ipaq_micro_tx_msg_sync() argument
141 ipaq_micro_tx_msg_async(struct ipaq_micro *micro, struct ipaq_micro_msg *msg) ipaq_micro_tx_msg_async() argument
/linux-4.4.14/drivers/nfc/s3fwrn5/
H A Dfirmware.c36 struct sk_buff *msg, struct sk_buff **rsp) s3fwrn5_fw_send_msg()
44 ret = s3fwrn5_write(info, msg); s3fwrn5_fw_send_msg()
65 struct sk_buff **msg, u8 type, u8 code, const void *data, u16 len) s3fwrn5_fw_prep_msg()
83 *msg = skb; s3fwrn5_fw_prep_msg()
91 struct sk_buff *msg, *rsp = NULL; s3fwrn5_fw_get_bootinfo() local
97 ret = s3fwrn5_fw_prep_msg(fw_info, &msg, S3FWRN5_FW_MSG_CMD, s3fwrn5_fw_get_bootinfo()
102 ret = s3fwrn5_fw_send_msg(fw_info, msg, &rsp); s3fwrn5_fw_get_bootinfo()
103 kfree_skb(msg); s3fwrn5_fw_get_bootinfo()
125 struct sk_buff *msg, *rsp = NULL; s3fwrn5_fw_enter_update_mode() local
134 ret = s3fwrn5_fw_prep_msg(fw_info, &msg, S3FWRN5_FW_MSG_CMD, s3fwrn5_fw_enter_update_mode()
139 ret = s3fwrn5_fw_send_msg(fw_info, msg, &rsp); s3fwrn5_fw_enter_update_mode()
140 kfree_skb(msg); s3fwrn5_fw_enter_update_mode()
154 ret = s3fwrn5_fw_prep_msg(fw_info, &msg, S3FWRN5_FW_MSG_DATA, 0, s3fwrn5_fw_enter_update_mode()
159 ret = s3fwrn5_fw_send_msg(fw_info, msg, &rsp); s3fwrn5_fw_enter_update_mode()
160 kfree_skb(msg); s3fwrn5_fw_enter_update_mode()
174 ret = s3fwrn5_fw_prep_msg(fw_info, &msg, S3FWRN5_FW_MSG_DATA, 0, s3fwrn5_fw_enter_update_mode()
179 ret = s3fwrn5_fw_send_msg(fw_info, msg, &rsp); s3fwrn5_fw_enter_update_mode()
180 kfree_skb(msg); s3fwrn5_fw_enter_update_mode()
197 struct sk_buff *msg, *rsp = NULL; s3fwrn5_fw_update_sector() local
205 ret = s3fwrn5_fw_prep_msg(fw_info, &msg, S3FWRN5_FW_MSG_CMD, s3fwrn5_fw_update_sector()
210 ret = s3fwrn5_fw_send_msg(fw_info, msg, &rsp); s3fwrn5_fw_update_sector()
211 kfree_skb(msg); s3fwrn5_fw_update_sector()
226 ret = s3fwrn5_fw_prep_msg(fw_info, &msg, s3fwrn5_fw_update_sector()
231 ret = s3fwrn5_fw_send_msg(fw_info, msg, &rsp); s3fwrn5_fw_update_sector()
232 kfree_skb(msg); s3fwrn5_fw_update_sector()
254 struct sk_buff *msg, *rsp = NULL; s3fwrn5_fw_complete_update_mode() local
260 ret = s3fwrn5_fw_prep_msg(fw_info, &msg, S3FWRN5_FW_MSG_CMD, s3fwrn5_fw_complete_update_mode()
265 ret = s3fwrn5_fw_send_msg(fw_info, msg, &rsp); s3fwrn5_fw_complete_update_mode()
266 kfree_skb(msg); s3fwrn5_fw_complete_update_mode()
35 s3fwrn5_fw_send_msg(struct s3fwrn5_fw_info *fw_info, struct sk_buff *msg, struct sk_buff **rsp) s3fwrn5_fw_send_msg() argument
64 s3fwrn5_fw_prep_msg(struct s3fwrn5_fw_info *fw_info, struct sk_buff **msg, u8 type, u8 code, const void *data, u16 len) s3fwrn5_fw_prep_msg() argument
/linux-4.4.14/drivers/atm/
H A Datmtcp.c43 const struct atmtcp_control *msg,int flag) atmtcp_send_control()
54 skb = alloc_skb(sizeof(*msg),GFP_KERNEL); atmtcp_send_control()
64 *new_msg = *msg; atmtcp_send_control()
88 static int atmtcp_recv_control(const struct atmtcp_control *msg) atmtcp_recv_control() argument
90 struct atm_vcc *vcc = *(struct atm_vcc **) &msg->vcc; atmtcp_recv_control()
92 vcc->vpi = msg->addr.sap_addr.vpi; atmtcp_recv_control()
93 vcc->vci = msg->addr.sap_addr.vci; atmtcp_recv_control()
94 vcc->qos = msg->qos; atmtcp_recv_control()
95 sk_atm(vcc)->sk_err = -msg->result; atmtcp_recv_control()
96 switch (msg->type) { atmtcp_recv_control()
105 msg->type); atmtcp_recv_control()
121 struct atmtcp_control msg; atmtcp_v_open() local
126 memset(&msg,0,sizeof(msg)); atmtcp_v_open()
127 msg.addr.sap_family = AF_ATMPVC; atmtcp_v_open()
128 msg.hdr.vpi = htons(vpi); atmtcp_v_open()
129 msg.addr.sap_addr.vpi = vpi; atmtcp_v_open()
130 msg.hdr.vci = htons(vci); atmtcp_v_open()
131 msg.addr.sap_addr.vci = vci; atmtcp_v_open()
133 msg.type = ATMTCP_CTRL_OPEN; atmtcp_v_open()
134 msg.qos = vcc->qos; atmtcp_v_open()
137 error = atmtcp_send_control(vcc,ATMTCP_CTRL_OPEN,&msg,ATM_VF_READY); atmtcp_v_open()
145 struct atmtcp_control msg; atmtcp_v_close() local
147 memset(&msg,0,sizeof(msg)); atmtcp_v_close()
148 msg.addr.sap_family = AF_ATMPVC; atmtcp_v_close()
149 msg.addr.sap_addr.vpi = vcc->vpi; atmtcp_v_close()
150 msg.addr.sap_addr.vci = vcc->vci; atmtcp_v_close()
152 (void) atmtcp_send_control(vcc,ATMTCP_CTRL_CLOSE,&msg,ATM_VF_ADDR); atmtcp_v_close()
42 atmtcp_send_control(struct atm_vcc *vcc,int type, const struct atmtcp_control *msg,int flag) atmtcp_send_control() argument
/linux-4.4.14/drivers/isdn/pcbit/
H A Dlayer2.h93 #define SET_MSG_SCMD(msg, ch) (msg = (msg & 0xffffff00) | (((ch) & 0xff)))
94 #define SET_MSG_CMD(msg, ch) (msg = (msg & 0xffff00ff) | (((ch) & 0xff) << 8))
95 #define SET_MSG_PROC(msg, ch) (msg = (msg & 0xff00ffff) | (((ch) & 0xff) << 16))
96 #define SET_MSG_CPU(msg, ch) (msg = (msg & 0x00ffffff) | (((ch) & 0xff) << 24))
98 #define GET_MSG_SCMD(msg) ((msg) & 0xFF)
99 #define GET_MSG_CMD(msg) ((msg) >> 8 & 0xFF)
100 #define GET_MSG_PROC(msg) ((msg) >> 16 & 0xFF)
101 #define GET_MSG_CPU(msg) ((msg) >> 24)
115 ulong msg; member in struct:frame_buf
124 extern int pcbit_l2_write(struct pcbit_dev *dev, ulong msg, ushort refnum,
/linux-4.4.14/drivers/md/
H A Ddm-log-userspace-transfer.c59 struct cn_msg *msg = prealloced_cn_msg; dm_ulog_sendto_server() local
61 memset(msg, 0, sizeof(struct cn_msg)); dm_ulog_sendto_server()
63 msg->id.idx = ulog_cn_id.idx; dm_ulog_sendto_server()
64 msg->id.val = ulog_cn_id.val; dm_ulog_sendto_server()
65 msg->ack = 0; dm_ulog_sendto_server()
66 msg->seq = tfr->seq; dm_ulog_sendto_server()
67 msg->len = sizeof(struct dm_ulog_request) + tfr->data_size; dm_ulog_sendto_server()
69 r = cn_netlink_send(msg, 0, 0, gfp_any()); dm_ulog_sendto_server()
75 * Parameters for this function can be either msg or tfr, but not
77 * If just msg is given, then the reply is simply an ACK from userspace
82 static int fill_pkg(struct cn_msg *msg, struct dm_ulog_request *tfr) fill_pkg() argument
84 uint32_t rtn_seq = (msg) ? msg->seq : (tfr) ? tfr->seq : 0; fill_pkg()
101 if (msg) { fill_pkg()
102 pkg->error = -msg->ack; fill_pkg()
133 static void cn_ulog_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp) cn_ulog_callback() argument
135 struct dm_ulog_request *tfr = (struct dm_ulog_request *)(msg + 1); cn_ulog_callback()
141 if (msg->len == 0) cn_ulog_callback()
142 fill_pkg(msg, NULL); cn_ulog_callback()
143 else if (msg->len < sizeof(*tfr)) cn_ulog_callback()
145 (unsigned)sizeof(*tfr), msg->len, msg->seq); cn_ulog_callback()
/linux-4.4.14/drivers/i2c/busses/
H A Di2c-axxia.c90 * @msg: pointer to current message
91 * @msg_xfrd: number of bytes transferred in msg
101 struct i2c_msg *msg; member in struct:axxia_i2c_dev
210 static int i2c_m_rd(const struct i2c_msg *msg) i2c_m_rd() argument
212 return (msg->flags & I2C_M_RD) != 0; i2c_m_rd()
215 static int i2c_m_ten(const struct i2c_msg *msg) i2c_m_ten() argument
217 return (msg->flags & I2C_M_TEN) != 0; i2c_m_ten()
220 static int i2c_m_recv_len(const struct i2c_msg *msg) i2c_m_recv_len() argument
222 return (msg->flags & I2C_M_RECV_LEN) != 0; i2c_m_recv_len()
231 struct i2c_msg *msg = idev->msg; axxia_i2c_empty_rx_fifo() local
233 int bytes_to_transfer = min(rx_fifo_avail, msg->len - idev->msg_xfrd); axxia_i2c_empty_rx_fifo()
238 if (idev->msg_xfrd == 0 && i2c_m_recv_len(msg)) { axxia_i2c_empty_rx_fifo()
248 msg->len = 1 + c; axxia_i2c_empty_rx_fifo()
249 writel(msg->len, idev->base + MST_RX_XFER); axxia_i2c_empty_rx_fifo()
251 msg->buf[idev->msg_xfrd++] = c; axxia_i2c_empty_rx_fifo()
263 struct i2c_msg *msg = idev->msg; axxia_i2c_fill_tx_fifo() local
265 int bytes_to_transfer = min(tx_fifo_avail, msg->len - idev->msg_xfrd); axxia_i2c_fill_tx_fifo()
266 int ret = msg->len - idev->msg_xfrd - bytes_to_transfer; axxia_i2c_fill_tx_fifo()
269 writel(msg->buf[idev->msg_xfrd++], idev->base + MST_DATA); axxia_i2c_fill_tx_fifo()
285 if (!idev->msg) { axxia_i2c_isr()
291 if (i2c_m_rd(idev->msg) && (status & MST_STATUS_RFL)) axxia_i2c_isr()
295 if (!i2c_m_rd(idev->msg) && (status & MST_STATUS_TFL)) { axxia_i2c_isr()
307 if (i2c_m_rd(idev->msg) && idev->msg_xfrd < idev->msg->len) axxia_i2c_isr()
321 idev->msg->addr, axxia_i2c_isr()
336 static int axxia_i2c_xfer_msg(struct axxia_i2c_dev *idev, struct i2c_msg *msg) axxia_i2c_xfer_msg() argument
343 idev->msg = msg; axxia_i2c_xfer_msg()
348 if (i2c_m_ten(msg)) { axxia_i2c_xfer_msg()
353 addr_1 = 0xF0 | ((msg->addr >> 7) & 0x06); axxia_i2c_xfer_msg()
354 addr_2 = msg->addr & 0xFF; axxia_i2c_xfer_msg()
360 addr_1 = (msg->addr << 1) & 0xFF; axxia_i2c_xfer_msg()
364 if (i2c_m_rd(msg)) { axxia_i2c_xfer_msg()
366 rx_xfer = i2c_m_recv_len(msg) ? I2C_SMBUS_BLOCK_MAX : msg->len; axxia_i2c_xfer_msg()
372 tx_xfer = msg->len; axxia_i2c_xfer_msg()
380 if (i2c_m_rd(msg)) axxia_i2c_xfer_msg()
H A Di2c-cros-ec-tunnel.c93 struct ec_params_i2c_passthru_msg *msg = &params->msg[i]; ec_i2c_construct_message() local
95 msg->len = i2c_msg->len; ec_i2c_construct_message()
96 msg->addr_flags = i2c_msg->addr; ec_i2c_construct_message()
102 msg->addr_flags |= EC_I2C_FLAG_READ; ec_i2c_construct_message()
104 memcpy(out_data, i2c_msg->buf, msg->len); ec_i2c_construct_message()
105 out_data += msg->len; ec_i2c_construct_message()
187 struct cros_ec_command *msg; ec_i2c_xfer() local
203 msg = kmalloc(sizeof(*msg) + alloc_size, GFP_KERNEL); ec_i2c_xfer()
204 if (!msg) ec_i2c_xfer()
207 result = ec_i2c_construct_message(msg->data, i2c_msgs, num, bus_num); ec_i2c_xfer()
213 msg->version = 0; ec_i2c_xfer()
214 msg->command = EC_CMD_I2C_PASSTHRU; ec_i2c_xfer()
215 msg->outsize = request_len; ec_i2c_xfer()
216 msg->insize = response_len; ec_i2c_xfer()
218 result = cros_ec_cmd_xfer(bus->ec, msg); ec_i2c_xfer()
224 result = ec_i2c_parse_response(msg->data, i2c_msgs, &num); ec_i2c_xfer()
233 kfree(msg); ec_i2c_xfer()
H A Di2c-kempld.c67 struct i2c_msg *msg; member in struct:kempld_i2c_data
94 struct i2c_msg *msg = i2c->msg; kempld_i2c_process() local
125 if (i2c->msg->flags & I2C_M_TEN) { kempld_i2c_process()
126 addr = 0xf0 | ((i2c->msg->addr >> 7) & 0x6); kempld_i2c_process()
129 addr = (i2c->msg->addr << 1); kempld_i2c_process()
134 addr |= (i2c->msg->flags & I2C_M_RD) ? 1 : 0; kempld_i2c_process()
144 kempld_write8(pld, KEMPLD_I2C_DATA, i2c->msg->addr & 0xff); kempld_i2c_process()
152 i2c->state = (msg->flags & I2C_M_RD) ? STATE_READ : STATE_WRITE; kempld_i2c_process()
160 msg->buf[i2c->pos++] = kempld_read8(pld, KEMPLD_I2C_DATA); kempld_i2c_process()
163 if (i2c->pos >= msg->len) { kempld_i2c_process()
165 i2c->msg++; kempld_i2c_process()
167 msg = i2c->msg; kempld_i2c_process()
170 if (!(msg->flags & I2C_M_NOSTART)) { kempld_i2c_process()
174 i2c->state = (msg->flags & I2C_M_RD) kempld_i2c_process()
185 kempld_write8(pld, KEMPLD_I2C_CMD, i2c->pos == (msg->len - 1) ? kempld_i2c_process()
188 kempld_write8(pld, KEMPLD_I2C_DATA, msg->buf[i2c->pos++]); kempld_i2c_process()
203 i2c->msg = msgs; kempld_i2c_xfer()
H A Di2c-digicolor.c57 struct i2c_msg *msg; member in struct:dc_i2c
80 static u8 dc_i2c_addr_cmd(struct i2c_msg *msg) dc_i2c_addr_cmd() argument
82 u8 addr = (msg->addr & 0x7f) << 1; dc_i2c_addr_cmd()
84 if (msg->flags & I2C_M_RD) dc_i2c_addr_cmd()
103 dc_i2c_write_byte(i2c, i2c->msg->buf[i2c->msgbuf_ptr++]); dc_i2c_write_buf()
108 bool last = (i2c->msgbuf_ptr + 1 == i2c->msg->len); dc_i2c_next_read()
129 i2c->msg->buf[i2c->msgbuf_ptr++] = dc_i2c_read_byte(i2c); dc_i2c_read_buf()
149 struct i2c_msg *msg = i2c->msg; dc_i2c_start_msg() local
151 if (!(msg->flags & I2C_M_NOSTART)) { dc_i2c_start_msg()
154 } else if (msg->flags & I2C_M_RD) { dc_i2c_start_msg()
183 addr_cmd = dc_i2c_addr_cmd(i2c->msg); dc_i2c_irq()
188 if (i2c->msg->flags & I2C_M_RD) { dc_i2c_irq()
196 if (i2c->msgbuf_ptr < i2c->msg->len) dc_i2c_irq()
202 if (i2c->msgbuf_ptr < i2c->msg->len) dc_i2c_irq()
218 static int dc_i2c_xfer_msg(struct dc_i2c *i2c, struct i2c_msg *msg, int first, dc_i2c_xfer_msg() argument
225 i2c->msg = msg; dc_i2c_xfer_msg()
H A Di2c-xgene-slimpro.c151 u32 msg[3]; slimpro_i2c_rd() local
154 msg[0] = SLIMPRO_IIC_ENCODE_MSG(SLIMPRO_IIC_BUS, chip, slimpro_i2c_rd()
156 msg[1] = SLIMPRO_IIC_ENCODE_ADDR(addr); slimpro_i2c_rd()
157 msg[2] = 0; slimpro_i2c_rd()
159 rc = mbox_send_message(ctx->mbox_chan, &msg); slimpro_i2c_rd()
173 u32 msg[3]; slimpro_i2c_wr() local
176 msg[0] = SLIMPRO_IIC_ENCODE_MSG(SLIMPRO_IIC_BUS, chip, slimpro_i2c_wr()
178 msg[1] = SLIMPRO_IIC_ENCODE_ADDR(addr); slimpro_i2c_wr()
179 msg[2] = data; slimpro_i2c_wr()
180 ctx->resp_msg = msg; slimpro_i2c_wr()
182 rc = mbox_send_message(ctx->mbox_chan, &msg); slimpro_i2c_wr()
197 u32 msg[3]; slimpro_i2c_blkrd() local
208 msg[0] = SLIMPRO_IIC_ENCODE_MSG(SLIMPRO_IIC_BUS, chip, SLIMPRO_IIC_READ, slimpro_i2c_blkrd()
210 msg[1] = SLIMPRO_IIC_ENCODE_FLAG_BUFADDR | slimpro_i2c_blkrd()
214 msg[2] = (u32)paddr; slimpro_i2c_blkrd()
215 ctx->resp_msg = msg; slimpro_i2c_blkrd()
217 rc = mbox_send_message(ctx->mbox_chan, &msg); slimpro_i2c_blkrd()
238 u32 msg[3]; slimpro_i2c_blkwr() local
251 msg[0] = SLIMPRO_IIC_ENCODE_MSG(SLIMPRO_IIC_BUS, chip, SLIMPRO_IIC_WRITE, slimpro_i2c_blkwr()
253 msg[1] = SLIMPRO_IIC_ENCODE_FLAG_BUFADDR | slimpro_i2c_blkwr()
256 msg[2] = (u32)paddr; slimpro_i2c_blkwr()
257 ctx->resp_msg = msg; slimpro_i2c_blkwr()
262 rc = mbox_send_message(ctx->mbox_chan, &msg); slimpro_i2c_blkwr()
H A Di2c-sh7760.c86 struct i2c_msg *msg; member in struct:cami2c
115 struct i2c_msg *msg = id->msg; sh7760_i2c_irq() local
116 char *data = msg->buf; sh7760_i2c_irq()
165 if (msg->len <= len) { sh7760_i2c_irq()
181 while (msg->len && len) { sh7760_i2c_irq()
183 msg->len--; sh7760_i2c_irq()
187 if (msg->len) { sh7760_i2c_irq()
188 len = (msg->len >= FIFO_SIZE) ? FIFO_SIZE - 1 sh7760_i2c_irq()
189 : msg->len - 1; sh7760_i2c_irq()
195 if ((fsr & FSR_TEND) && (msg->len < 1)) { sh7760_i2c_irq()
208 while (msg->len && (IN32(id, I2CTFDR) < FIFO_SIZE)) { sh7760_i2c_irq()
210 msg->len--; sh7760_i2c_irq()
213 if (msg->len < 1) { sh7760_i2c_irq()
217 len = (msg->len >= FIFO_SIZE) ? 2 : 0; sh7760_i2c_irq()
227 id->msg = NULL; sh7760_i2c_irq()
248 OUT32(id, I2CMAR, (id->msg->addr << 1) | 1); sh7760_i2c_mrecv()
251 if (id->msg->len >= FIFO_SIZE) sh7760_i2c_mrecv()
254 len = id->msg->len - 1; /* trigger before all received */ sh7760_i2c_mrecv()
274 OUT32(id, I2CMAR, (id->msg->addr << 1) | 0); sh7760_i2c_msend()
277 if (id->msg->len >= FIFO_SIZE) sh7760_i2c_msend()
285 while (id->msg->len && IN32(id, I2CTFDR) < FIFO_SIZE) { sh7760_i2c_msend()
286 OUT32(id, I2CRXTX, *(id->msg->buf)); sh7760_i2c_msend()
287 (id->msg->len)--; sh7760_i2c_msend()
288 (id->msg->buf)++; sh7760_i2c_msend()
295 OUT32(id, I2CFIER, FIER_TEIE | (id->msg->len ? FIER_TXIE : 0)); sh7760_i2c_msend()
321 id->msg = msgs; sh7760_i2c_master_xfer()
356 id->msg = NULL; sh7760_i2c_master_xfer()
/linux-4.4.14/drivers/scsi/libfc/
H A Dfc_elsct.c93 const char *msg; fc_els_resp_type() local
100 msg = "response no error"; fc_els_resp_type()
103 msg = "response timeout"; fc_els_resp_type()
106 msg = "response closed"; fc_els_resp_type()
109 msg = "response unknown error"; fc_els_resp_type()
118 msg = "accept"; fc_els_resp_type()
121 msg = "reject"; fc_els_resp_type()
124 msg = "response unknown ELS"; fc_els_resp_type()
133 msg = "CT accept"; fc_els_resp_type()
136 msg = "CT reject"; fc_els_resp_type()
139 msg = "response unknown CT"; fc_els_resp_type()
143 msg = "short CT response"; fc_els_resp_type()
147 msg = "response not ELS or CT"; fc_els_resp_type()
151 return msg; fc_els_resp_type()
/linux-4.4.14/drivers/media/pci/mantis/
H A Dmantis_i2c.c38 static int mantis_i2c_read(struct mantis_pci *mantis, const struct i2c_msg *msg) mantis_i2c_read() argument
43 __func__, msg->addr); mantis_i2c_read()
45 for (i = 0; i < msg->len; i++) { mantis_i2c_read()
46 rxd = (msg->addr << 25) | (1 << 24) mantis_i2c_read()
51 if (i == (msg->len - 1)) mantis_i2c_read()
76 msg->buf[i] = (u8)((rxd >> 8) & 0xFF); mantis_i2c_read()
77 dprintk(MANTIS_INFO, 0, "%02x ", msg->buf[i]); mantis_i2c_read()
84 static int mantis_i2c_write(struct mantis_pci *mantis, const struct i2c_msg *msg) mantis_i2c_write() argument
90 __func__, msg->addr); mantis_i2c_write()
92 for (i = 0; i < msg->len; i++) { mantis_i2c_write()
93 dprintk(MANTIS_INFO, 0, "%02x ", msg->buf[i]); mantis_i2c_write()
94 txd = (msg->addr << 25) | (msg->buf[i] << 8) mantis_i2c_write()
99 if (i == (msg->len - 1)) mantis_i2c_write()
H A Dmantis_vp2033.c56 struct i2c_msg msg[] = { read_pwm() local
61 if ((i2c_transfer(adapter, msg, 2) != 2) read_pwm()
75 struct i2c_msg msg = {.addr = 0x60, .flags = 0, .buf = buf, .len = sizeof(buf)}; tda1002x_cu1216_tuner_set() local
94 if (i2c_transfer(adapter, &msg, 1) != 1) tda1002x_cu1216_tuner_set()
98 msg.flags = I2C_M_RD; tda1002x_cu1216_tuner_set()
99 msg.len = 1; tda1002x_cu1216_tuner_set()
104 if (i2c_transfer(adapter, &msg, 1) == 1 && (buf[0] & 0x40)) tda1002x_cu1216_tuner_set()
111 msg.flags = 0; tda1002x_cu1216_tuner_set()
112 msg.len = 2; tda1002x_cu1216_tuner_set()
113 msg.buf = &buf[2]; tda1002x_cu1216_tuner_set()
118 if (i2c_transfer(adapter, &msg, 1) != 1) tda1002x_cu1216_tuner_set()
H A Dmantis_vp2040.c57 struct i2c_msg msg = {.addr = 0x60, .flags = 0, .buf = buf, .len = sizeof(buf)}; tda1002x_cu1216_tuner_set() local
76 if (i2c_transfer(adapter, &msg, 1) != 1) tda1002x_cu1216_tuner_set()
80 msg.flags = I2C_M_RD; tda1002x_cu1216_tuner_set()
81 msg.len = 1; tda1002x_cu1216_tuner_set()
86 if (i2c_transfer(adapter, &msg, 1) == 1 && (buf[0] & 0x40)) tda1002x_cu1216_tuner_set()
93 msg.flags = 0; tda1002x_cu1216_tuner_set()
94 msg.len = 2; tda1002x_cu1216_tuner_set()
95 msg.buf = &buf[2]; tda1002x_cu1216_tuner_set()
100 if (i2c_transfer(adapter, &msg, 1) != 1) tda1002x_cu1216_tuner_set()
112 struct i2c_msg msg[] = { read_pwm() local
117 if ((i2c_transfer(adapter, msg, 2) != 2) read_pwm()
/linux-4.4.14/arch/m68k/mac/
H A Diop.c222 static void iop_free_msg(struct iop_msg *msg) iop_free_msg() argument
224 msg->status = IOP_MSGSTATUS_UNUSED; iop_free_msg()
346 void iop_complete_message(struct iop_msg *msg) iop_complete_message() argument
348 int iop_num = msg->iop_num; iop_complete_message()
349 int chan = msg->channel; iop_complete_message()
353 printk("iop_complete(%p): iop %d chan %d\n", msg, msg->iop_num, msg->channel); iop_complete_message()
356 offset = IOP_ADDR_RECV_MSG + (msg->channel * IOP_MSG_LEN); iop_complete_message()
359 iop_writeb(iop_base[iop_num], offset, msg->reply[i]); iop_complete_message()
364 iop_interrupt(iop_base[msg->iop_num]); iop_complete_message()
366 iop_free_msg(msg); iop_complete_message()
373 static void iop_do_send(struct iop_msg *msg) iop_do_send() argument
375 volatile struct mac_iop *iop = iop_base[msg->iop_num]; iop_do_send()
378 offset = IOP_ADDR_SEND_MSG + (msg->channel * IOP_MSG_LEN); iop_do_send()
381 iop_writeb(iop, offset, msg->message[i]); iop_do_send()
384 iop_writeb(iop, IOP_ADDR_SEND_STATE + msg->channel, IOP_MSG_NEW); iop_do_send()
397 struct iop_msg *msg,*msg2; iop_handle_send() local
406 if (!(msg = iop_send_queue[iop_num][chan])) return; iop_handle_send()
408 msg->status = IOP_MSGSTATUS_COMPLETE; iop_handle_send()
411 msg->reply[i] = iop_readb(iop, offset); iop_handle_send()
413 if (msg->handler) (*msg->handler)(msg); iop_handle_send()
414 msg2 = msg; iop_handle_send()
415 msg = msg->next; iop_handle_send()
418 iop_send_queue[iop_num][chan] = msg; iop_handle_send()
419 if (msg) iop_do_send(msg); iop_handle_send()
431 struct iop_msg *msg; iop_handle_recv() local
437 msg = iop_alloc_msg(); iop_handle_recv()
438 msg->iop_num = iop_num; iop_handle_recv()
439 msg->channel = chan; iop_handle_recv()
440 msg->status = IOP_MSGSTATUS_UNSOL; iop_handle_recv()
441 msg->handler = iop_listeners[iop_num][chan].handler; iop_handle_recv()
446 msg->message[i] = iop_readb(iop, offset); iop_handle_recv()
454 if (msg->handler) { iop_handle_recv()
455 (*msg->handler)(msg); iop_handle_recv()
461 printk(" %02X", (uint) msg->message[i]); iop_handle_recv()
465 iop_complete_message(msg); iop_handle_recv()
481 struct iop_msg *msg, *q; iop_send_message() local
487 msg = iop_alloc_msg(); iop_send_message()
488 if (!msg) return -ENOMEM; iop_send_message()
490 msg->next = NULL; iop_send_message()
491 msg->status = IOP_MSGSTATUS_WAITING; iop_send_message()
492 msg->iop_num = iop_num; iop_send_message()
493 msg->channel = chan; iop_send_message()
494 msg->caller_priv = privdata; iop_send_message()
495 memcpy(msg->message, msg_data, msg_len); iop_send_message()
496 msg->handler = handler; iop_send_message()
499 iop_send_queue[iop_num][chan] = msg; iop_send_message()
502 q->next = msg; iop_send_message()
507 iop_do_send(msg); iop_send_message()
/linux-4.4.14/drivers/net/wireless/iwlwifi/
H A Diwl-devtrace-msg.h41 __dynamic_array(char, msg, MAX_MSG_LEN)
44 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
48 TP_printk("%s", __get_str(msg))
79 __dynamic_array(char, msg, MAX_MSG_LEN)
85 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
89 TP_printk("%s", __get_str(msg))
96 #define TRACE_INCLUDE_FILE iwl-devtrace-msg
/linux-4.4.14/drivers/media/usb/au0828/
H A Dau0828-i2c.c141 const struct i2c_msg *msg, int joined_rlen) i2c_sendbytes()
153 (dev->board.tuner_addr == msg->addr)) { i2c_sendbytes()
159 if (msg->len == 64) i2c_sendbytes()
168 au0828_write(dev, AU0828_I2C_DEST_ADDR_203, msg->addr << 1); i2c_sendbytes()
170 dprintk(4, "SEND: %02x\n", msg->addr); i2c_sendbytes()
173 if (msg->len == 0) { i2c_sendbytes()
192 for (i = 0; i < msg->len;) { i2c_sendbytes()
194 dprintk(4, " %02x\n", msg->buf[i]); i2c_sendbytes()
196 au0828_write(dev, AU0828_I2C_WRITE_FIFO_205, msg->buf[i]); i2c_sendbytes()
201 if ((strobe >= 4) || (i >= msg->len)) { i2c_sendbytes()
204 if (i < msg->len) i2c_sendbytes()
226 return msg->len; i2c_sendbytes()
231 const struct i2c_msg *msg, int joined) i2c_readbytes()
247 (dev->board.tuner_addr == msg->addr)) i2c_readbytes()
254 au0828_write(dev, AU0828_I2C_DEST_ADDR_203, msg->addr << 1); i2c_readbytes()
259 if (msg->len == 0) { i2c_readbytes()
268 for (i = 0; i < msg->len;) { i2c_readbytes()
272 if (i < msg->len) i2c_readbytes()
283 msg->buf[i-1] = au0828_read(dev, AU0828_I2C_READ_FIFO_209) & i2c_readbytes()
286 dprintk(4, " %02x\n", msg->buf[i-1]); i2c_readbytes()
293 return msg->len; i2c_readbytes()
140 i2c_sendbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg, int joined_rlen) i2c_sendbytes() argument
230 i2c_readbytes(struct i2c_adapter *i2c_adap, const struct i2c_msg *msg, int joined) i2c_readbytes() argument
/linux-4.4.14/drivers/staging/nvec/
H A Dnvec_ps2.c81 unsigned char *msg = (unsigned char *)data; nvec_ps2_notifier() local
85 for (i = 0; i < msg[1]; i++) nvec_ps2_notifier()
86 serio_interrupt(ps2_dev.ser_dev, msg[2 + i], 0); nvec_ps2_notifier()
87 NVEC_PHD("ps/2 mouse event: ", &msg[2], msg[1]); nvec_ps2_notifier()
91 if (msg[2] == 1) { nvec_ps2_notifier()
92 for (i = 0; i < (msg[1] - 2); i++) nvec_ps2_notifier()
93 serio_interrupt(ps2_dev.ser_dev, msg[i + 4], 0); nvec_ps2_notifier()
94 NVEC_PHD("ps/2 mouse reply: ", &msg[4], msg[1] - 2); nvec_ps2_notifier()
97 else if (msg[1] != 2) /* !ack */ nvec_ps2_notifier()
98 NVEC_PHD("unhandled mouse event: ", msg, msg[1] + 2); nvec_ps2_notifier()
H A Dnvec.c146 unsigned char *msg = (unsigned char *)data; nvec_status_notifier() local
151 dev_warn(nvec->dev, "unhandled msg type %ld\n", event_type); nvec_status_notifier()
153 msg, msg[1] + 2, true); nvec_status_notifier()
193 * @msg: A message (must be allocated by nvec_msg_alloc() and belong to @nvec)
197 void nvec_msg_free(struct nvec_chip *nvec, struct nvec_msg *msg) nvec_msg_free() argument
199 if (msg != &nvec->tx_scratch) nvec_msg_free()
200 dev_vdbg(nvec->dev, "INFO: Free %ti\n", msg - nvec->msg_pool); nvec_msg_free()
201 atomic_set(&msg->used, 0); nvec_msg_free()
206 * nvec_msg_is_event - Return %true if @msg is an event
207 * @msg: A message
209 static bool nvec_msg_is_event(struct nvec_msg *msg) nvec_msg_is_event() argument
211 return msg->data[0] >> 7; nvec_msg_is_event()
216 * @msg: The message to get the size for
220 static size_t nvec_msg_size(struct nvec_msg *msg) nvec_msg_size() argument
222 bool is_event = nvec_msg_is_event(msg); nvec_msg_size()
223 int event_length = (msg->data[0] & 0x60) >> 5; nvec_msg_size()
227 return (msg->pos || msg->size) ? (msg->data[1] + 2) : 0; nvec_msg_size()
264 struct nvec_msg *msg; nvec_write_async() local
267 msg = nvec_msg_alloc(nvec, NVEC_MSG_TX); nvec_write_async()
269 if (msg == NULL) nvec_write_async()
272 msg->data[0] = size; nvec_write_async()
273 memcpy(msg->data + 1, data, size); nvec_write_async()
274 msg->size = size + 1; nvec_write_async()
277 list_add_tail(&msg->node, &nvec->tx_data); nvec_write_async()
304 struct nvec_msg *msg; nvec_write_sync() local
326 msg = nvec->last_sync_msg; nvec_write_sync()
330 return msg; nvec_write_sync()
382 struct nvec_msg *msg; nvec_request_master() local
386 msg = list_first_entry(&nvec->tx_data, struct nvec_msg, node); nvec_request_master()
395 msg->pos = 0; nvec_request_master()
401 list_del_init(&msg->node); nvec_request_master()
402 nvec_msg_free(nvec, msg); nvec_request_master()
411 * @msg: A message received by @nvec
416 static int parse_msg(struct nvec_chip *nvec, struct nvec_msg *msg) parse_msg() argument
418 if ((msg->data[0] & 1 << 7) == 0 && msg->data[3]) { parse_msg()
419 dev_err(nvec->dev, "ec responded %*ph\n", 4, msg->data); parse_msg()
423 if ((msg->data[0] >> 7) == 1 && (msg->data[0] & 0x0f) == 5) parse_msg()
425 DUMP_PREFIX_NONE, 16, 1, msg->data, parse_msg()
426 msg->data[1] + 2, true); parse_msg()
428 atomic_notifier_call_chain(&nvec->notifier_list, msg->data[0] & 0x8f, parse_msg()
429 msg->data); parse_msg()
445 struct nvec_msg *msg; nvec_dispatch() local
449 msg = list_first_entry(&nvec->rx_data, struct nvec_msg, node); nvec_dispatch()
450 list_del_init(&msg->node); nvec_dispatch()
454 (msg->data[2] << 8) + msg->data[0]) { nvec_dispatch()
457 nvec->last_sync_msg = msg; nvec_dispatch()
460 parse_msg(nvec, msg); nvec_dispatch()
461 nvec_msg_free(nvec, msg); nvec_dispatch()
792 struct nvec_msg *msg; tegra_nvec_probe() local
881 msg = nvec_write_sync(nvec, get_firmware_version, 2); tegra_nvec_probe()
883 if (msg) { tegra_nvec_probe()
885 msg->data[4], msg->data[5], msg->data[6], msg->data[7]); tegra_nvec_probe()
887 nvec_msg_free(nvec, msg); tegra_nvec_probe()
929 struct nvec_msg *msg; nvec_suspend() local
937 msg = nvec_write_sync(nvec, ap_suspend, sizeof(ap_suspend)); nvec_suspend()
938 nvec_msg_free(nvec, msg); nvec_suspend()
/linux-4.4.14/drivers/s390/net/
H A Dsmsgiucv_app.c37 #define ENV_TEXT_LEN(msg) (strlen(ENV_TEXT_STR) + strlen((msg)) + 1)
67 const char *msg) smsg_app_event_alloc()
76 ENV_TEXT_LEN(msg), GFP_ATOMIC); smsg_app_event_alloc()
91 snprintf(ev->envp[2], ENV_TEXT_LEN(msg), ENV_TEXT_STR "%s", msg); smsg_app_event_alloc()
120 static void smsg_app_callback(const char *from, char *msg) smsg_app_callback() argument
130 msg += strlen(SMSG_PREFIX); smsg_app_callback()
131 while (*msg && isspace(*msg)) smsg_app_callback()
132 msg++; smsg_app_callback()
133 if (*msg == '\0') smsg_app_callback()
137 se = smsg_app_event_alloc(from, msg); smsg_app_callback()
66 smsg_app_event_alloc(const char *from, const char *msg) smsg_app_event_alloc() argument
/linux-4.4.14/drivers/scsi/bfa/
H A Dbfi_ms.h116 struct bfi_mhdr_s mh; /* Common msg header */
127 struct bfi_mhdr_s mh; /* common msg header */
139 struct bfi_mhdr_s mh; /* common msg header */
151 struct bfi_mhdr_s mh; /* common msg header */
182 struct bfi_mhdr_s mh; /* common msg header */
186 struct bfi_mhdr_s mh; /* common msg header */
196 struct bfi_mhdr_s mh; /* common msg header */
207 struct bfi_mhdr_s mh; /* common msg header */
243 struct bfi_mhdr_s mh; /* msg header */
251 struct bfi_mhdr_s mh; /* common msg header */
262 struct bfi_mhdr_s mh; /* msg header */
277 struct bfi_mhdr_s mh; /* msg header */
286 struct bfi_mhdr_s mh; /* common msg header */
327 struct bfi_msg_s *msg; member in union:bfi_fcport_i2h_msg_u
351 struct bfi_mhdr_s mh; /* Common msg header */
371 struct bfi_mhdr_s mh; /* Common msg header */
391 struct bfi_mhdr_s mh; /* Common msg header */
398 struct bfi_mhdr_s mh; /* Common msg header */
418 struct bfi_mhdr_s mh; /* common msg header */
432 struct bfi_mhdr_s mh; /* common msg header */
453 struct bfi_mhdr_s mh; /* common msg header */
460 struct bfi_mhdr_s mh; /* common msg header */
467 struct bfi_mhdr_s mh; /* common msg header */
473 struct bfi_mhdr_s mh; /* common msg header */
479 struct bfi_mhdr_s *msg; member in union:bfi_lps_h2i_msg_u
486 struct bfi_msg_s *msg; member in union:bfi_lps_i2h_msg_u
508 struct bfi_mhdr_s mh; /* common msg header */
521 struct bfi_mhdr_s mh; /* common msg header */
530 struct bfi_mhdr_s mh; /* common msg header */
537 struct bfi_mhdr_s mh; /* common msg header */
543 struct bfi_mhdr_s mh; /* common msg header */
550 struct bfi_mhdr_s mh; /* common msg header */
558 struct bfi_mhdr_s mh; /*!< common msg header */
566 struct bfi_msg_s *msg; member in union:bfi_rport_h2i_msg_u
573 struct bfi_msg_s *msg; member in union:bfi_rport_i2h_msg_u
596 struct bfi_mhdr_s mh; /* common msg header */
600 u8 msg_no; /* seq id of the msg */
605 struct bfi_mhdr_s mh; /* common msg header */
608 u8 seq_id; /* seq id of the msg */
612 struct bfi_mhdr_s mh; /* common msg header */
614 u8 seq_id; /* seq id of the msg */
619 struct bfi_mhdr_s mh; /* common msg header */
622 u8 seq_id; /* seq id of the msg */
626 struct bfi_mhdr_s mh; /* common msg header */
634 struct bfi_msg_s *msg; member in union:bfi_itn_h2i_msg_u
641 struct bfi_msg_s *msg; member in union:bfi_itn_i2h_msg_u
675 struct bfi_mhdr_s mh; /* Common msg header */
780 struct bfi_mhdr_s mh; /* common msg header */
795 struct bfi_mhdr_s mh; /* Common msg header */
814 struct bfi_mhdr_s mh; /* Common msg header */
824 struct bfi_mhdr_s mh; /* Common msg header */
847 struct bfi_mhdr_s mh; /* Common msg header */
/linux-4.4.14/net/irda/
H A Dirnetlink.c83 struct sk_buff *msg; irda_nl_get_mode() local
91 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); irda_nl_get_mode()
92 if (!msg) { irda_nl_get_mode()
103 hdr = genlmsg_put(msg, info->snd_portid, info->snd_seq, irda_nl_get_mode()
110 if(nla_put_string(msg, IRDA_NL_ATTR_IFNAME, irda_nl_get_mode()
114 if(nla_put_u32(msg, IRDA_NL_ATTR_MODE, irlap->mode)) irda_nl_get_mode()
117 genlmsg_end(msg, hdr); irda_nl_get_mode()
119 return genlmsg_reply(msg, info); irda_nl_get_mode()
122 nlmsg_free(msg); irda_nl_get_mode()
/linux-4.4.14/drivers/video/backlight/
H A Dipaq_micro_bl.c22 struct ipaq_micro_msg msg = { micro_bl_update_status() local
38 msg.tx_data[0] = 0x01; micro_bl_update_status()
39 msg.tx_data[1] = intensity > 0 ? 1 : 0; micro_bl_update_status()
40 msg.tx_data[2] = intensity; micro_bl_update_status()
41 return ipaq_micro_tx_msg_sync(micro, &msg); micro_bl_update_status()
/linux-4.4.14/arch/um/os-Linux/drivers/
H A Dtuntap_user.c70 struct msghdr msg; tuntap_open_tramp() local
87 msg.msg_name = NULL; tuntap_open_tramp()
88 msg.msg_namelen = 0; tuntap_open_tramp()
91 msg.msg_iov = &iov; tuntap_open_tramp()
92 msg.msg_iovlen = 1; tuntap_open_tramp()
95 msg.msg_iov = NULL; tuntap_open_tramp()
96 msg.msg_iovlen = 0; tuntap_open_tramp()
98 msg.msg_control = buf; tuntap_open_tramp()
99 msg.msg_controllen = sizeof(buf); tuntap_open_tramp()
100 msg.msg_flags = 0; tuntap_open_tramp()
101 n = recvmsg(me, &msg, 0); tuntap_open_tramp()
111 cmsg = CMSG_FIRSTHDR(&msg); tuntap_open_tramp()
/linux-4.4.14/scripts/kconfig/
H A Dkxgettext.c84 const char *msg; member in struct:message
92 static struct message *message__new(const char *msg, char *option, message__new() argument
104 self->msg = strdup(msg); message__new()
105 if (self->msg == NULL) message__new()
120 static struct message *mesage__find(const char *msg) mesage__find() argument
125 if (strcmp(m->msg, msg) == 0) mesage__find()
149 static int message__add(const char *msg, char *option, const char *file, message__add() argument
154 char *escaped = escape(msg, bf, sizeof(bf)); message__add()
213 "msgstr \"\"\n", self->msg); message__print_gettext_msgid_msgstr()
222 if (strlen(m->msg) > sizeof("\"\"")) menu__xgettext()
/linux-4.4.14/arch/ia64/sn/kernel/
H A Dmsi_sn.c68 struct msi_msg msg; sn_setup_msi_irq() local
138 msg.address_hi = (u32)(bus_addr >> 32); sn_setup_msi_irq()
139 msg.address_lo = (u32)(bus_addr & 0x00000000ffffffff); sn_setup_msi_irq()
145 msg.data = 0x100 + irq; sn_setup_msi_irq()
148 pci_write_msi_msg(irq, &msg); sn_setup_msi_irq()
158 struct msi_msg msg; sn_set_msi_irq_affinity() local
178 __get_cached_msi_msg(irq_data_get_msi_desc(data), &msg); sn_set_msi_irq_affinity()
183 bus_addr = (u64)(msg.address_hi) << 32 | (u64)(msg.address_lo); sn_set_msi_irq_affinity()
205 msg.address_hi = (u32)(bus_addr >> 32); sn_set_msi_irq_affinity()
206 msg.address_lo = (u32)(bus_addr & 0x00000000ffffffff); sn_set_msi_irq_affinity()
208 pci_write_msi_msg(irq, &msg); sn_set_msi_irq_affinity()
/linux-4.4.14/arch/arm/mach-ixp4xx/include/mach/
H A Dnpe.h32 int npe_send_message(struct npe *npe, const void *msg, const char *what);
33 int npe_recv_message(struct npe *npe, void *msg, const char *what);
34 int npe_send_recv_message(struct npe *npe, void *msg, const char *what);
/linux-4.4.14/drivers/net/wireless/brcm80211/brcmsmac/
H A Dbrcms_trace_brcmsmac_msg.h31 __dynamic_array(char, msg, MAX_MSG_LEN)
34 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
38 TP_printk("%s", __get_str(msg))
67 __dynamic_array(char, msg, MAX_MSG_LEN)
72 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
76 TP_printk("%s: %s", __get_str(func), __get_str(msg))
/linux-4.4.14/security/selinux/
H A Dnetlink.c50 struct selnl_msg_setenforce *msg = nlmsg_data(nlh); selnl_add_payload() local
52 memset(msg, 0, len); selnl_add_payload()
53 msg->val = *((int *)data); selnl_add_payload()
58 struct selnl_msg_policyload *msg = nlmsg_data(nlh); selnl_add_payload() local
60 memset(msg, 0, len); selnl_add_payload()
61 msg->seqno = *((u32 *)data); selnl_add_payload()
/linux-4.4.14/arch/powerpc/platforms/ps3/
H A Dsmp.c42 static void ps3_smp_message_pass(int cpu, int msg) ps3_smp_message_pass() argument
47 if (msg >= MSG_COUNT) { ps3_smp_message_pass()
48 DBG("%s:%d: bad msg: %d\n", __func__, __LINE__, msg); ps3_smp_message_pass()
52 virq = per_cpu(ps3_ipi_virqs, cpu)[msg]; ps3_smp_message_pass()
57 " (%d)\n", __func__, __LINE__, cpu, msg, result); ps3_smp_message_pass()
/linux-4.4.14/arch/x86/include/asm/
H A Dvirtext.h79 * You can use the 'msg' arg to get a message describing the problem,
84 static inline int cpu_has_svm(const char **msg) cpu_has_svm() argument
89 if (msg) cpu_has_svm()
90 *msg = "not amd"; cpu_has_svm()
96 if (msg) cpu_has_svm()
97 *msg = "can't execute cpuid_8000000a"; cpu_has_svm()
103 if (msg) cpu_has_svm()
104 *msg = "svm not available"; cpu_has_svm()
/linux-4.4.14/arch/sh/boards/mach-kfr2r09/
H A Dsetup.c412 struct i2c_msg msg; kfr2r09_usb0_gadget_i2c_setup() local
422 msg.addr = 0x09; kfr2r09_usb0_gadget_i2c_setup()
423 msg.buf = buf; kfr2r09_usb0_gadget_i2c_setup()
424 msg.len = 1; kfr2r09_usb0_gadget_i2c_setup()
425 msg.flags = 0; kfr2r09_usb0_gadget_i2c_setup()
426 ret = i2c_transfer(a, &msg, 1); kfr2r09_usb0_gadget_i2c_setup()
431 msg.addr = 0x09; kfr2r09_usb0_gadget_i2c_setup()
432 msg.buf = buf; kfr2r09_usb0_gadget_i2c_setup()
433 msg.len = 1; kfr2r09_usb0_gadget_i2c_setup()
434 msg.flags = I2C_M_RD; kfr2r09_usb0_gadget_i2c_setup()
435 ret = i2c_transfer(a, &msg, 1); kfr2r09_usb0_gadget_i2c_setup()
441 msg.addr = 0x09; kfr2r09_usb0_gadget_i2c_setup()
442 msg.buf = buf; kfr2r09_usb0_gadget_i2c_setup()
443 msg.len = 2; kfr2r09_usb0_gadget_i2c_setup()
444 msg.flags = 0; kfr2r09_usb0_gadget_i2c_setup()
445 ret = i2c_transfer(a, &msg, 1); kfr2r09_usb0_gadget_i2c_setup()
455 struct i2c_msg msg; kfr2r09_serial_i2c_setup() local
465 msg.addr = 0x09; kfr2r09_serial_i2c_setup()
466 msg.buf = buf; kfr2r09_serial_i2c_setup()
467 msg.len = 1; kfr2r09_serial_i2c_setup()
468 msg.flags = 0; kfr2r09_serial_i2c_setup()
469 ret = i2c_transfer(a, &msg, 1); kfr2r09_serial_i2c_setup()
474 msg.addr = 0x09; kfr2r09_serial_i2c_setup()
475 msg.buf = buf; kfr2r09_serial_i2c_setup()
476 msg.len = 1; kfr2r09_serial_i2c_setup()
477 msg.flags = I2C_M_RD; kfr2r09_serial_i2c_setup()
478 ret = i2c_transfer(a, &msg, 1); kfr2r09_serial_i2c_setup()
484 msg.addr = 0x09; kfr2r09_serial_i2c_setup()
485 msg.buf = buf; kfr2r09_serial_i2c_setup()
486 msg.len = 2; kfr2r09_serial_i2c_setup()
487 msg.flags = 0; kfr2r09_serial_i2c_setup()
488 ret = i2c_transfer(a, &msg, 1); kfr2r09_serial_i2c_setup()
/linux-4.4.14/drivers/net/wireless/brcm80211/brcmfmac/
H A Dbcdc.c104 struct brcmf_proto_bcdc_dcmd msg; member in struct:brcmf_bcdc
114 struct brcmf_proto_bcdc_dcmd *msg = &bcdc->msg; brcmf_proto_bcdc_msg() local
119 memset(msg, 0, sizeof(struct brcmf_proto_bcdc_dcmd)); brcmf_proto_bcdc_msg()
121 msg->cmd = cpu_to_le32(cmd); brcmf_proto_bcdc_msg()
122 msg->len = cpu_to_le32(len); brcmf_proto_bcdc_msg()
128 msg->flags = cpu_to_le32(flags); brcmf_proto_bcdc_msg()
133 len += sizeof(*msg); brcmf_proto_bcdc_msg()
138 return brcmf_bus_txctl(drvr->bus_if, (unsigned char *)&bcdc->msg, len); brcmf_proto_bcdc_msg()
149 ret = brcmf_bus_rxctl(drvr->bus_if, (unsigned char *)&bcdc->msg, brcmf_proto_bcdc_cmplt()
153 } while (BCDC_DCMD_ID(le32_to_cpu(bcdc->msg.flags)) != id); brcmf_proto_bcdc_cmplt()
163 struct brcmf_proto_bcdc_dcmd *msg = &bcdc->msg; brcmf_proto_bcdc_query_dcmd() local
183 flags = le32_to_cpu(msg->flags); brcmf_proto_bcdc_query_dcmd()
196 info = (void *)&msg[1]; brcmf_proto_bcdc_query_dcmd()
207 ret = le32_to_cpu(msg->status); brcmf_proto_bcdc_query_dcmd()
218 struct brcmf_proto_bcdc_dcmd *msg = &bcdc->msg; brcmf_proto_bcdc_set_dcmd() local
232 flags = le32_to_cpu(msg->flags); brcmf_proto_bcdc_set_dcmd()
244 ret = le32_to_cpu(msg->status); brcmf_proto_bcdc_set_dcmd()
360 /* ensure that the msg buf directly follows the cdc msg struct */ brcmf_proto_bcdc_attach()
361 if ((unsigned long)(&bcdc->msg + 1) != (unsigned long)bcdc->buf) { brcmf_proto_bcdc_attach()
/linux-4.4.14/crypto/asymmetric_keys/
H A Dpkcs7_parser.c23 struct pkcs7_message *msg; /* Message being constructed */ member in struct:pkcs7_parse_context
87 static int pkcs7_check_authattrs(struct pkcs7_message *msg) pkcs7_check_authattrs() argument
92 sinfo = msg->signed_infos; pkcs7_check_authattrs()
95 msg->have_authattrs = true; pkcs7_check_authattrs()
116 struct pkcs7_message *msg = ERR_PTR(-ENOMEM); pkcs7_parse_message() local
122 ctx->msg = kzalloc(sizeof(struct pkcs7_message), GFP_KERNEL); pkcs7_parse_message()
123 if (!ctx->msg) pkcs7_parse_message()
131 ctx->ppsinfo = &ctx->msg->signed_infos; pkcs7_parse_message()
136 msg = ERR_PTR(ret); pkcs7_parse_message()
140 ret = pkcs7_check_authattrs(ctx->msg); pkcs7_parse_message()
144 msg = ctx->msg; pkcs7_parse_message()
145 ctx->msg = NULL; pkcs7_parse_message()
155 pkcs7_free_message(ctx->msg); pkcs7_parse_message()
159 return msg; pkcs7_parse_message()
297 ctx->msg->version = version = *(const u8 *)value; pkcs7_note_signeddata_version()
337 if (ctx->msg->version != 1) pkcs7_note_signerinfo_version()
343 if (ctx->msg->version == 1) pkcs7_note_signerinfo_version()
412 *ctx->ppcerts = ctx->msg->certs; pkcs7_note_certificate_list()
413 ctx->msg->certs = ctx->certs; pkcs7_note_certificate_list()
434 ctx->msg->data_type = ctx->last_oid; pkcs7_note_content()
450 ctx->msg->data = value; pkcs7_note_data()
451 ctx->msg->data_len = vlen; pkcs7_note_data()
452 ctx->msg->data_hdrlen = hdrlen; pkcs7_note_data()
474 if (content_type != ctx->msg->data_type) { pkcs7_sig_note_authenticated_attr()
476 ctx->msg->data_type, sinfo->index, pkcs7_sig_note_authenticated_attr()
503 if (ctx->msg->data_type != OID_msIndirectData) { pkcs7_sig_note_authenticated_attr()
523 if (ctx->msg->data_type != OID_msIndirectData) { pkcs7_sig_note_authenticated_attr()
551 (ctx->msg->data_type == OID_msIndirectData && pkcs7_sig_note_set_of_authattrs()
557 if (ctx->msg->data_type != OID_msIndirectData && pkcs7_sig_note_set_of_authattrs()
643 if (ctx->msg->data_type == OID_msIndirectData && !sinfo->authattrs) { pkcs7_note_signed_info()
/linux-4.4.14/sound/pci/mixart/
H A Dmixart_core.c146 struct mixart_msg *msg, send_msg()
155 if (snd_BUG_ON(msg->size % 4)) send_msg()
184 writel_be( msg->size + MSG_DESCRIPTOR_SIZE, MIXART_MEM(mgr, msg_frame_address) ); /* size of descriptor + request */ send_msg()
185 writel_be( msg->message_id , MIXART_MEM(mgr, msg_frame_address + 4) ); /* dwMessageID */ send_msg()
186 writel_be( msg->uid.object_id, MIXART_MEM(mgr, msg_frame_address + 8) ); /* uidDest */ send_msg()
187 writel_be( msg->uid.desc, MIXART_MEM(mgr, msg_frame_address + 12) ); /* */ send_msg()
190 writel_be( msg->size, MIXART_MEM(mgr, msg_frame_address + 24) ); /* SizeDLL_T16 */ send_msg()
196 for( i=0; i < msg->size; i+=4 ) { send_msg()
197 writel_be( *(u32*)(msg->data + i), MIXART_MEM(mgr, MSG_HEADER_SIZE + msg_frame_address + i) ); send_msg()
264 "error: no response on msg %x\n", msg_frame); snd_mixart_send_msg()
348 u32 msg, addr, type; snd_mixart_process_msg() local
352 msg = mgr->msg_fifo[mgr->msg_fifo_readptr]; snd_mixart_process_msg()
357 addr = msg & ~MSG_TYPE_MASK; snd_mixart_process_msg()
358 type = msg & MSG_TYPE_MASK; snd_mixart_process_msg()
370 err, msg); snd_mixart_process_msg()
387 msg, resp.message_id, resp.uid.object_id, resp.uid.desc, resp.size); snd_mixart_process_msg()
392 /* msg contains no address ! do not get_msg() ! */ snd_mixart_process_msg()
398 msg); snd_mixart_process_msg()
404 } /* while there is a msg in fifo */ snd_mixart_process_msg()
437 u32 msg; snd_mixart_threaded_irq() local
441 while (retrieve_msg_frame(mgr, &msg)) { snd_mixart_threaded_irq()
443 switch (msg & MSG_TYPE_MASK) { snd_mixart_threaded_irq()
448 err = get_msg(mgr, &resp, msg & ~MSG_TYPE_MASK); snd_mixart_threaded_irq()
452 err, msg); snd_mixart_threaded_irq()
538 if(msg & MSG_CANCEL_NOTIFY_MASK) { snd_mixart_threaded_irq()
539 msg &= ~MSG_CANCEL_NOTIFY_MASK; snd_mixart_threaded_irq()
541 "canceled notification %x !\n", msg); snd_mixart_threaded_irq()
547 if( (msg & ~MSG_TYPE_MASK) == mgr->pending_event ) { snd_mixart_threaded_irq()
553 mgr->msg_fifo[mgr->msg_fifo_writeptr] = msg; snd_mixart_threaded_irq()
563 "interrupt received request %x\n", msg); snd_mixart_threaded_irq()
566 } /* switch on msg type */ snd_mixart_threaded_irq()
145 send_msg( struct mixart_mgr *mgr, struct mixart_msg *msg, int max_answersize, int mark_pending, u32 *msg_event) send_msg() argument
/linux-4.4.14/drivers/scsi/
H A Ddpt_i2o.c317 u32 msg[17]; adpt_inquiry() local
329 memset(msg, 0, sizeof(msg)); adpt_inquiry()
346 msg[0] = reqlen<<16 | SGL_OFFSET_12; adpt_inquiry()
347 msg[1] = (0xff<<24|HOST_TID<<12|ADAPTER_TID); adpt_inquiry()
348 msg[2] = 0; adpt_inquiry()
349 msg[3] = 0; adpt_inquiry()
351 msg[4] = I2O_CMD_SCSI_EXEC|DPT_ORGANIZATION_ID<<16; adpt_inquiry()
352 msg[5] = ADAPTER_TID | 1<<16 /* Interpret*/; adpt_inquiry()
357 msg[6] = scsidir|0x20a00000| 6 /* cmd len*/; adpt_inquiry()
359 mptr=msg+7; adpt_inquiry()
389 rcode = adpt_i2o_post_wait(pHba, msg, reqlen<<2, 120); adpt_inquiry()
685 u32 msg[5]; adpt_abort() local
698 memset(msg, 0, sizeof(msg)); adpt_abort()
699 msg[0] = FIVE_WORD_MSG_SIZE|SGL_OFFSET_0; adpt_abort()
700 msg[1] = I2O_CMD_SCSI_ABORT<<24|HOST_TID<<12|dptdevice->tid; adpt_abort()
701 msg[2] = 0; adpt_abort()
702 msg[3]= 0; adpt_abort()
703 msg[4] = adpt_cmd_to_context(cmd); adpt_abort()
706 rcode = adpt_i2o_post_wait(pHba, msg, sizeof(msg), FOREVER); adpt_abort()
729 u32 msg[4]; adpt_device_reset() local
740 memset(msg, 0, sizeof(msg)); adpt_device_reset()
741 msg[0] = FOUR_WORD_MSG_SIZE|SGL_OFFSET_0; adpt_device_reset()
742 msg[1] = (I2O_DEVICE_RESET<<24|HOST_TID<<12|d->tid); adpt_device_reset()
743 msg[2] = 0; adpt_device_reset()
744 msg[3] = 0; adpt_device_reset()
750 rcode = adpt_i2o_post_wait(pHba, msg,sizeof(msg), FOREVER); adpt_device_reset()
773 u32 msg[4]; adpt_bus_reset() local
777 memset(msg, 0, sizeof(msg)); adpt_bus_reset()
779 msg[0] = FOUR_WORD_MSG_SIZE|SGL_OFFSET_0; adpt_bus_reset()
780 msg[1] = (I2O_HBA_BUS_RESET<<24|HOST_TID<<12|pHba->channel[cmd->device->channel].tid); adpt_bus_reset()
781 msg[2] = 0; adpt_bus_reset()
782 msg[3] = 0; adpt_bus_reset()
785 rcode = adpt_i2o_post_wait(pHba, msg,sizeof(msg), FOREVER); adpt_bus_reset()
1195 static int adpt_i2o_post_wait(adpt_hba* pHba, u32* msg, int len, int timeout) adpt_i2o_post_wait() argument
1230 msg[2] |= 0x80000000 | ((u32)wait_data->id); adpt_i2o_post_wait()
1232 if((status = adpt_i2o_post_this(pHba, msg, len)) == 0){ adpt_i2o_post_wait()
1286 u32 __iomem *msg; adpt_i2o_post_this() local
1301 msg = pHba->msg_addr_virt + m; adpt_i2o_post_this()
1302 memcpy_toio(msg, data, len); adpt_i2o_post_this()
1352 u32 msg[8]; adpt_i2o_reset_hba() local
1385 msg[0]=EIGHT_WORD_MSG_SIZE|SGL_OFFSET_0; adpt_i2o_reset_hba()
1386 msg[1]=I2O_CMD_ADAPTER_RESET<<24|HOST_TID<<12|ADAPTER_TID; adpt_i2o_reset_hba()
1387 msg[2]=0; adpt_i2o_reset_hba()
1388 msg[3]=0; adpt_i2o_reset_hba()
1389 msg[4]=0; adpt_i2o_reset_hba()
1390 msg[5]=0; adpt_i2o_reset_hba()
1391 msg[6]=dma_low(addr); adpt_i2o_reset_hba()
1392 msg[7]=dma_high(addr); adpt_i2o_reset_hba()
1394 memcpy_toio(pHba->msg_addr_virt+m, msg, sizeof(msg)); adpt_i2o_reset_hba()
1707 u32 msg[MAX_MESSAGE_SIZE]; adpt_i2o_passthru() local
1723 memset(&msg, 0, MAX_MESSAGE_SIZE*4); adpt_i2o_passthru()
1724 // get user msg size in u32s adpt_i2o_passthru()
1737 if(copy_from_user(msg, user_msg, size)) { adpt_i2o_passthru()
1751 sg_offset = (msg[0]>>4)&0xf; adpt_i2o_passthru()
1752 msg[2] = 0x40000000; // IOCTL context adpt_i2o_passthru()
1753 msg[3] = adpt_ioctl_to_context(pHba, reply); adpt_i2o_passthru()
1754 if (msg[3] == (u32)-1) adpt_i2o_passthru()
1760 struct sg_simple_element *sg = (struct sg_simple_element*) (msg+sg_offset); adpt_i2o_passthru()
1809 rcode = adpt_i2o_post_wait(pHba, msg, size, FOREVER); adpt_i2o_passthru()
1831 memset(&msg, 0, MAX_MESSAGE_SIZE*4); adpt_i2o_passthru()
1832 // get user msg size in u32s adpt_i2o_passthru()
1844 if (copy_from_user (msg, user_msg, size)) { adpt_i2o_passthru()
1851 sg = (struct sg_simple_element*)(msg + sg_offset); adpt_i2o_passthru()
1883 (struct sg_simple_element*) (msg +sg_offset); adpt_i2o_passthru()
2163 void __iomem *msg; adpt_isr() local
2172 msg = pHba->msg_addr_virt + old_m; adpt_isr()
2173 old_context = readl(msg+12); adpt_isr()
2222 u32 msg[MAX_MESSAGE_SIZE]; adpt_scsi_to_i2o() local
2234 memset(msg, 0 , sizeof(msg)); adpt_scsi_to_i2o()
2268 // msg[0] is set later adpt_scsi_to_i2o()
2270 msg[1] = ((0xff<<24)|(HOST_TID<<12)|d->tid); adpt_scsi_to_i2o()
2271 msg[2] = 0; adpt_scsi_to_i2o()
2272 msg[3] = adpt_cmd_to_context(cmd); /* Want SCSI control block back */ adpt_scsi_to_i2o()
2275 msg[4] = I2O_CMD_SCSI_EXEC|(DPT_ORGANIZATION_ID<<16); adpt_scsi_to_i2o()
2276 msg[5] = d->tid; adpt_scsi_to_i2o()
2281 msg[6] = scsidir|0x20a00000|cmd->cmd_len; adpt_scsi_to_i2o()
2283 mptr=msg+7; adpt_scsi_to_i2o()
2317 reqlen = mptr - msg;
2330 msg[0] = reqlen<<16 | ((reqlen > 12) ? SGL_OFFSET_12 : SGL_OFFSET_0);
2333 rcode = adpt_i2o_post_this(pHba, msg, reqlen<<2);
2784 u32 __iomem *msg; adpt_send_nop() local
2799 msg = (u32 __iomem *)(pHba->msg_addr_virt + m); adpt_send_nop()
2800 writel( THREE_WORD_MSG_SIZE | SGL_OFFSET_0,&msg[0]); adpt_send_nop()
2801 writel( I2O_CMD_UTIL_NOP << 24 | HOST_TID << 12 | 0,&msg[1]); adpt_send_nop()
2802 writel( 0,&msg[2]); adpt_send_nop()
2814 u32 __iomem *msg = NULL; adpt_i2o_init_outbound_q() local
2833 msg=(u32 __iomem *)(pHba->msg_addr_virt+m); adpt_i2o_init_outbound_q()
2844 writel(EIGHT_WORD_MSG_SIZE| SGL_OFFSET_6, &msg[0]); adpt_i2o_init_outbound_q()
2845 writel(I2O_CMD_OUTBOUND_INIT<<24 | HOST_TID<<12 | ADAPTER_TID, &msg[1]); adpt_i2o_init_outbound_q()
2846 writel(0, &msg[2]); adpt_i2o_init_outbound_q()
2847 writel(0x0106, &msg[3]); /* Transaction context */ adpt_i2o_init_outbound_q()
2848 writel(4096, &msg[4]); /* Host page frame size */ adpt_i2o_init_outbound_q()
2849 writel((REPLY_FRAME_SIZE)<<16|0x80, &msg[5]); /* Outbound msg frame size and Initcode */ adpt_i2o_init_outbound_q()
2850 writel(0xD0000004, &msg[6]); /* Simple SG LE, EOB */ adpt_i2o_init_outbound_q()
2851 writel((u32)addr, &msg[7]); adpt_i2o_init_outbound_q()
2923 u32 __iomem *msg; adpt_i2o_status_get() local
2955 msg=(u32 __iomem *)(pHba->msg_addr_virt+m); adpt_i2o_status_get()
2957 writel(NINE_WORD_MSG_SIZE|SGL_OFFSET_0, &msg[0]); adpt_i2o_status_get()
2958 writel(I2O_CMD_STATUS_GET<<24|HOST_TID<<12|ADAPTER_TID, &msg[1]); adpt_i2o_status_get()
2959 writel(1, &msg[2]); adpt_i2o_status_get()
2960 writel(0, &msg[3]); adpt_i2o_status_get()
2961 writel(0, &msg[4]); adpt_i2o_status_get()
2962 writel(0, &msg[5]); adpt_i2o_status_get()
2963 writel( dma_low(pHba->status_block_pa), &msg[6]); adpt_i2o_status_get()
2964 writel( dma_high(pHba->status_block_pa), &msg[7]); adpt_i2o_status_get()
2965 writel(sizeof(i2o_status_block), &msg[8]); // 88 bytes adpt_i2o_status_get() local
3045 u32 msg[8]; adpt_i2o_lct_get() local
3065 msg[0] = EIGHT_WORD_MSG_SIZE|SGL_OFFSET_6; adpt_i2o_lct_get()
3066 msg[1] = I2O_CMD_LCT_NOTIFY<<24 | HOST_TID<<12 | ADAPTER_TID; adpt_i2o_lct_get()
3067 msg[2] = 0; adpt_i2o_lct_get()
3068 msg[3] = 0; adpt_i2o_lct_get()
3069 msg[4] = 0xFFFFFFFF; /* All devices */ adpt_i2o_lct_get()
3070 msg[5] = 0x00000000; /* Report now */ adpt_i2o_lct_get()
3071 msg[6] = 0xD0000000|pHba->lct_size; adpt_i2o_lct_get()
3072 msg[7] = (u32)pHba->lct_pa; adpt_i2o_lct_get()
3074 if ((ret=adpt_i2o_post_wait(pHba, msg, sizeof(msg), 360))) { adpt_i2o_lct_get()
3287 u32 msg[6]; adpt_i2o_hrt_get() local
3300 msg[0]= SIX_WORD_MSG_SIZE| SGL_OFFSET_4; adpt_i2o_hrt_get()
3301 msg[1]= I2O_CMD_HRT_GET<<24 | HOST_TID<<12 | ADAPTER_TID; adpt_i2o_hrt_get()
3302 msg[2]= 0; adpt_i2o_hrt_get()
3303 msg[3]= 0; adpt_i2o_hrt_get()
3304 msg[4]= (0xD0000000 | size); /* Simple transaction */ adpt_i2o_hrt_get()
3305 msg[5]= (u32)pHba->hrt_pa; /* Dump it here */ adpt_i2o_hrt_get()
3307 if ((ret = adpt_i2o_post_wait(pHba, msg, sizeof(msg),20))) { adpt_i2o_hrt_get()
3397 u32 msg[9]; adpt_i2o_issue_params() local
3401 msg[0] = NINE_WORD_MSG_SIZE | SGL_OFFSET_5; adpt_i2o_issue_params()
3402 msg[1] = cmd << 24 | HOST_TID << 12 | tid; adpt_i2o_issue_params()
3403 msg[2] = 0; adpt_i2o_issue_params()
3404 msg[3] = 0; adpt_i2o_issue_params()
3405 msg[4] = 0; adpt_i2o_issue_params()
3406 msg[5] = 0x54000000 | oplen; /* OperationBlock */ adpt_i2o_issue_params()
3407 msg[6] = (u32)opblk_pa; adpt_i2o_issue_params()
3408 msg[7] = 0xD0000000 | reslen; /* ResultBlock */ adpt_i2o_issue_params()
3409 msg[8] = (u32)resblk_pa; adpt_i2o_issue_params()
3411 if ((wait_status = adpt_i2o_post_wait(pHba, msg, sizeof(msg), 20))) { adpt_i2o_issue_params()
3432 u32 msg[4]; adpt_i2o_quiesce_hba() local
3444 msg[0] = FOUR_WORD_MSG_SIZE|SGL_OFFSET_0; adpt_i2o_quiesce_hba()
3445 msg[1] = I2O_CMD_SYS_QUIESCE<<24|HOST_TID<<12|ADAPTER_TID; adpt_i2o_quiesce_hba()
3446 msg[2] = 0; adpt_i2o_quiesce_hba()
3447 msg[3] = 0; adpt_i2o_quiesce_hba()
3449 if((ret = adpt_i2o_post_wait(pHba, msg, sizeof(msg), 240))) { adpt_i2o_quiesce_hba()
3466 u32 msg[4]; adpt_i2o_enable_hba() local
3480 msg[0]=FOUR_WORD_MSG_SIZE|SGL_OFFSET_0; adpt_i2o_enable_hba()
3481 msg[1]=I2O_CMD_SYS_ENABLE<<24|HOST_TID<<12|ADAPTER_TID; adpt_i2o_enable_hba()
3482 msg[2]= 0; adpt_i2o_enable_hba()
3483 msg[3]= 0; adpt_i2o_enable_hba()
3485 if ((ret = adpt_i2o_post_wait(pHba, msg, sizeof(msg), 240))) { adpt_i2o_enable_hba()
3499 u32 msg[12]; adpt_i2o_systab_send() local
3502 msg[0] = I2O_MESSAGE_SIZE(12) | SGL_OFFSET_6; adpt_i2o_systab_send()
3503 msg[1] = I2O_CMD_SYS_TAB_SET<<24 | HOST_TID<<12 | ADAPTER_TID; adpt_i2o_systab_send()
3504 msg[2] = 0; adpt_i2o_systab_send()
3505 msg[3] = 0; adpt_i2o_systab_send()
3506 msg[4] = (0<<16) | ((pHba->unit+2) << 12); /* Host 0 IOP ID (unit + 2) */ adpt_i2o_systab_send()
3507 msg[5] = 0; /* Segment 0 */ adpt_i2o_systab_send()
3514 msg[6] = 0x54000000 | sys_tbl_len; adpt_i2o_systab_send()
3515 msg[7] = (u32)sys_tbl_pa; adpt_i2o_systab_send()
3516 msg[8] = 0x54000000 | 0; adpt_i2o_systab_send()
3517 msg[9] = 0; adpt_i2o_systab_send()
3518 msg[10] = 0xD4000000 | 0; adpt_i2o_systab_send()
3519 msg[11] = 0; adpt_i2o_systab_send()
3521 if ((ret=adpt_i2o_post_wait(pHba, msg, sizeof(msg), 120))) { adpt_i2o_systab_send()
/linux-4.4.14/drivers/media/usb/pvrusb2/
H A Dpvrusb2-eeprom.c47 struct i2c_msg msg[2]; pvr2_eeprom_fetch() local
81 msg[0].addr = addr; pvr2_eeprom_fetch()
82 msg[0].flags = 0; pvr2_eeprom_fetch()
83 msg[0].len = mode16 ? 2 : 1; pvr2_eeprom_fetch()
84 msg[0].buf = iadd; pvr2_eeprom_fetch()
85 msg[1].addr = addr; pvr2_eeprom_fetch()
86 msg[1].flags = I2C_M_RD; pvr2_eeprom_fetch()
103 msg[1].len = pcnt; pvr2_eeprom_fetch()
104 msg[1].buf = eeprom+tcnt; pvr2_eeprom_fetch()
106 msg,ARRAY_SIZE(msg))) != 2) { pvr2_eeprom_fetch()
/linux-4.4.14/drivers/gpu/drm/amd/amdgpu/
H A Damdgpu_uvd.c70 /* does the IB has a msg command */
372 * @msg: pointer to message structure
377 static int amdgpu_uvd_cs_msg_decode(uint32_t *msg, unsigned buf_sizes[]) amdgpu_uvd_cs_msg_decode() argument
379 unsigned stream_type = msg[4]; amdgpu_uvd_cs_msg_decode()
380 unsigned width = msg[6]; amdgpu_uvd_cs_msg_decode()
381 unsigned height = msg[7]; amdgpu_uvd_cs_msg_decode()
382 unsigned dpb_size = msg[9]; amdgpu_uvd_cs_msg_decode()
383 unsigned pitch = msg[28]; amdgpu_uvd_cs_msg_decode()
384 unsigned level = msg[57]; amdgpu_uvd_cs_msg_decode()
481 num_dpb_buffer = (le32_to_cpu(msg[59]) & 0xff) + 2; amdgpu_uvd_cs_msg_decode()
523 int32_t *msg, msg_type, handle; amdgpu_uvd_cs_msg() local
546 msg = ptr + offset; amdgpu_uvd_cs_msg()
548 msg_type = msg[1]; amdgpu_uvd_cs_msg()
549 handle = msg[2]; amdgpu_uvd_cs_msg()
558 /* it's a create msg, calc image size (width * height) */ amdgpu_uvd_cs_msg()
578 /* it's a decode msg, calc buffer sizes */ amdgpu_uvd_cs_msg()
579 r = amdgpu_uvd_cs_msg_decode(msg, ctx->buf_sizes); amdgpu_uvd_cs_msg()
599 /* it's a destroy msg, free the handle */ amdgpu_uvd_cs_msg()
680 DRM_ERROR("msg/fb buffer %LX-%LX out of 256MB segment!\n", amdgpu_uvd_cs_pass2()
822 DRM_ERROR("UVD-IBs need a msg command!\n"); amdgpu_uvd_ring_parse_cs()
919 crash the vcpu so just try to emmit a dummy create/destroy msg to
926 uint32_t *msg; amdgpu_uvd_get_create_msg() local
942 r = amdgpu_bo_kmap(bo, (void **)&msg); amdgpu_uvd_get_create_msg()
949 /* stitch together an UVD create msg */ amdgpu_uvd_get_create_msg()
950 msg[0] = cpu_to_le32(0x00000de4); amdgpu_uvd_get_create_msg()
951 msg[1] = cpu_to_le32(0x00000000); amdgpu_uvd_get_create_msg()
952 msg[2] = cpu_to_le32(handle); amdgpu_uvd_get_create_msg()
953 msg[3] = cpu_to_le32(0x00000000); amdgpu_uvd_get_create_msg()
954 msg[4] = cpu_to_le32(0x00000000); amdgpu_uvd_get_create_msg()
955 msg[5] = cpu_to_le32(0x00000000); amdgpu_uvd_get_create_msg()
956 msg[6] = cpu_to_le32(0x00000000); amdgpu_uvd_get_create_msg()
957 msg[7] = cpu_to_le32(0x00000780); amdgpu_uvd_get_create_msg()
958 msg[8] = cpu_to_le32(0x00000440); amdgpu_uvd_get_create_msg()
959 msg[9] = cpu_to_le32(0x00000000); amdgpu_uvd_get_create_msg()
960 msg[10] = cpu_to_le32(0x01b37000); amdgpu_uvd_get_create_msg()
962 msg[i] = cpu_to_le32(0x0); amdgpu_uvd_get_create_msg()
975 uint32_t *msg; amdgpu_uvd_get_destroy_msg() local
991 r = amdgpu_bo_kmap(bo, (void **)&msg); amdgpu_uvd_get_destroy_msg()
998 /* stitch together an UVD destroy msg */ amdgpu_uvd_get_destroy_msg()
999 msg[0] = cpu_to_le32(0x00000de4); amdgpu_uvd_get_destroy_msg()
1000 msg[1] = cpu_to_le32(0x00000002); amdgpu_uvd_get_destroy_msg()
1001 msg[2] = cpu_to_le32(handle); amdgpu_uvd_get_destroy_msg()
1002 msg[3] = cpu_to_le32(0x00000000); amdgpu_uvd_get_destroy_msg()
1004 msg[i] = cpu_to_le32(0x0); amdgpu_uvd_get_destroy_msg()
/linux-4.4.14/net/phonet/
H A Ddatagram.c86 static int pn_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) pn_sendmsg() argument
88 DECLARE_SOCKADDR(struct sockaddr_pn *, target, msg->msg_name); pn_sendmsg()
92 if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_NOSIGNAL| pn_sendmsg()
99 if (msg->msg_namelen < sizeof(struct sockaddr_pn)) pn_sendmsg()
106 msg->msg_flags & MSG_DONTWAIT, &err); pn_sendmsg()
111 err = memcpy_from_msg((void *)skb_put(skb, len), msg, len); pn_sendmsg()
127 static int pn_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, pn_recvmsg() argument
147 msg->msg_flags |= MSG_TRUNC; pn_recvmsg()
151 rval = skb_copy_datagram_msg(skb, 0, msg, copylen); pn_recvmsg()
159 if (msg->msg_name != NULL) { pn_recvmsg()
161 memcpy(msg->msg_name, &sa, sizeof(sa)); pn_recvmsg()
/linux-4.4.14/drivers/misc/mic/cosm_client/
H A Dcosm_scif_client.c41 struct cosm_msg msg = { .id = COSM_MSG_SHUTDOWN_STATUS }; cosm_reboot_event() local
48 msg.shutdown_status = event; cosm_reboot_event()
49 rc = scif_send(client_epd, &msg, sizeof(msg), SCIF_SEND_BLOCK); cosm_reboot_event()
62 static void cosm_set_time(struct cosm_msg *msg) cosm_set_time() argument
64 int rc = do_settimeofday64(&msg->timespec); cosm_set_time()
74 struct cosm_msg msg; cosm_client_recv() local
78 rc = scif_recv(client_epd, &msg, sizeof(msg), 0); cosm_client_recv()
88 __func__, __LINE__, rc, msg.id); cosm_client_recv()
90 switch (msg.id) { cosm_client_recv()
92 cosm_set_time(&msg); cosm_client_recv()
99 __func__, __LINE__, msg.id); cosm_client_recv()
153 struct cosm_msg msg = { .id = COSM_MSG_HEARTBEAT }; cosm_scif_client() local
175 msg.id = COSM_MSG_HEARTBEAT; cosm_scif_client()
176 rc = scif_send(client_epd, &msg, sizeof(msg), SCIF_SEND_BLOCK); cosm_scif_client()
/linux-4.4.14/kernel/irq/
H A Dmsi.c38 void __get_cached_msi_msg(struct msi_desc *entry, struct msi_msg *msg) __get_cached_msi_msg() argument
40 *msg = entry->msg; __get_cached_msi_msg()
43 void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg) get_cached_msi_msg() argument
47 __get_cached_msi_msg(entry, msg); get_cached_msi_msg()
53 struct msi_msg *msg) irq_chip_write_msi_msg()
55 data->chip->irq_write_msi_msg(data, msg); irq_chip_write_msi_msg()
71 struct msi_msg msg; msi_domain_set_affinity() local
76 BUG_ON(irq_chip_compose_msi_msg(irq_data, &msg)); msi_domain_set_affinity()
77 irq_chip_write_msi_msg(irq_data, &msg); msi_domain_set_affinity()
86 struct msi_msg msg; msi_domain_activate() local
88 BUG_ON(irq_chip_compose_msi_msg(irq_data, &msg)); msi_domain_activate()
89 irq_chip_write_msi_msg(irq_data, &msg); msi_domain_activate()
95 struct msi_msg msg; msi_domain_deactivate() local
97 memset(&msg, 0, sizeof(msg)); msi_domain_deactivate()
98 irq_chip_write_msi_msg(irq_data, &msg); msi_domain_deactivate()
52 irq_chip_write_msi_msg(struct irq_data *data, struct msi_msg *msg) irq_chip_write_msi_msg() argument
/linux-4.4.14/arch/powerpc/sysdev/
H A Dpmi.c45 pmi_message_t msg; member in struct:pmi_data
77 data->msg.type = type; pmi_irq_handler()
78 data->msg.data0 = ioread8(data->pmi_reg + PMI_READ_DATA0); pmi_irq_handler()
79 data->msg.data1 = ioread8(data->pmi_reg + PMI_READ_DATA1); pmi_irq_handler()
80 data->msg.data2 = ioread8(data->pmi_reg + PMI_READ_DATA2); pmi_irq_handler()
90 if (data->msg.type & PMI_ACK) { pmi_irq_handler()
119 if (handler->type == data->msg.type) pmi_notify_handlers()
120 handler->handle_pmi_message(data->msg); pmi_notify_handlers()
218 int pmi_send_message(pmi_message_t msg) pmi_send_message() argument
228 data->msg = msg; pmi_send_message()
229 pr_debug("pmi_send_message: msg is %08x\n", *(u32*)&msg); pmi_send_message()
234 iowrite8(msg.data0, data->pmi_reg + PMI_WRITE_DATA0); pmi_send_message()
235 iowrite8(msg.data1, data->pmi_reg + PMI_WRITE_DATA1); pmi_send_message()
236 iowrite8(msg.data2, data->pmi_reg + PMI_WRITE_DATA2); pmi_send_message()
237 iowrite8(msg.type, data->pmi_reg + PMI_WRITE_TYPE); pmi_send_message()
/linux-4.4.14/arch/arm/mach-omap1/
H A Dboard-sx1.c53 struct i2c_msg msg[1]; sx1_i2c_write_byte() local
59 msg->addr = devaddr; /* I2C address of chip */ sx1_i2c_write_byte()
60 msg->flags = 0; sx1_i2c_write_byte()
61 msg->len = 2; sx1_i2c_write_byte()
62 msg->buf = data; sx1_i2c_write_byte()
65 err = i2c_transfer(adap, msg, 1); sx1_i2c_write_byte()
77 struct i2c_msg msg[1]; sx1_i2c_read_byte() local
84 msg->addr = devaddr; /* I2C address of chip */ sx1_i2c_read_byte()
85 msg->flags = 0; sx1_i2c_read_byte()
86 msg->len = 1; sx1_i2c_read_byte()
87 msg->buf = data; sx1_i2c_read_byte()
89 err = i2c_transfer(adap, msg, 1); sx1_i2c_read_byte()
91 msg->addr = devaddr; /* I2C address */ sx1_i2c_read_byte()
92 msg->flags = I2C_M_RD; sx1_i2c_read_byte()
93 msg->len = 1; sx1_i2c_read_byte()
94 msg->buf = data; sx1_i2c_read_byte()
95 err = i2c_transfer(adap, msg, 1); sx1_i2c_read_byte()
/linux-4.4.14/drivers/media/usb/em28xx/
H A Dem28xx-input.c161 struct i2c_msg msg[] = { { .addr = i2c_dev->addr, .flags = 0, .buf = &subaddr, .len = 1}, em28xx_get_key_winfast_usbii_deluxe() local
165 if (2 != i2c_transfer(i2c_dev->adapter, msg, 2)) em28xx_get_key_winfast_usbii_deluxe()
171 msg[1].buf = &key; em28xx_get_key_winfast_usbii_deluxe()
172 if (2 != i2c_transfer(i2c_dev->adapter, msg, 2)) em28xx_get_key_winfast_usbii_deluxe()
192 u8 msg[3] = { 0, 0, 0 }; default_polling_getkey() local
198 msg, sizeof(msg)); default_polling_getkey()
203 poll_result->toggle_bit = (msg[0] >> 7); default_polling_getkey()
206 poll_result->read_count = (msg[0] & 0x7f); default_polling_getkey()
212 poll_result->scancode = RC_SCANCODE_RC5(msg[1], msg[2]); default_polling_getkey()
217 poll_result->scancode = RC_SCANCODE_NEC(msg[1], msg[2]); default_polling_getkey()
222 poll_result->scancode = msg[1] << 8 | msg[2]; default_polling_getkey()
234 u8 msg[5] = { 0, 0, 0, 0, 0 }; em2874_polling_getkey() local
240 msg, sizeof(msg)); em2874_polling_getkey()
245 poll_result->toggle_bit = (msg[0] >> 7); em2874_polling_getkey()
248 poll_result->read_count = (msg[0] & 0x7f); em2874_polling_getkey()
257 poll_result->scancode = RC_SCANCODE_RC5(msg[1], msg[2]); em2874_polling_getkey()
262 poll_result->scancode = msg[1] << 8 | msg[2]; em2874_polling_getkey()
263 if ((msg[3] ^ msg[4]) != 0xff) /* 32 bits NEC */ em2874_polling_getkey()
264 poll_result->scancode = RC_SCANCODE_NEC32((msg[1] << 24) | em2874_polling_getkey()
265 (msg[2] << 16) | em2874_polling_getkey()
266 (msg[3] << 8) | em2874_polling_getkey()
267 (msg[4])); em2874_polling_getkey()
268 else if ((msg[1] ^ msg[2]) != 0xff) /* 24 bits NEC */ em2874_polling_getkey()
269 poll_result->scancode = RC_SCANCODE_NECX(msg[1] << 8 | em2874_polling_getkey()
270 msg[2], msg[3]); em2874_polling_getkey()
272 poll_result->scancode = RC_SCANCODE_NEC(msg[1], msg[3]); em2874_polling_getkey()
277 poll_result->scancode = RC_SCANCODE_RC6_0(msg[1], msg[2]); em2874_polling_getkey()
282 poll_result->scancode = (msg[1] << 24) | (msg[2] << 16) | em2874_polling_getkey()
283 (msg[3] << 8) | msg[4]; em2874_polling_getkey()
/linux-4.4.14/net/rxrpc/
H A Dar-output.c28 struct msghdr *msg, size_t len);
33 static int rxrpc_sendmsg_cmsg(struct rxrpc_sock *rx, struct msghdr *msg, rxrpc_sendmsg_cmsg() argument
44 if (msg->msg_controllen == 0) rxrpc_sendmsg_cmsg()
47 for_each_cmsghdr(cmsg, msg) { for_each_cmsghdr()
48 if (!CMSG_OK(msg, cmsg)) for_each_cmsghdr()
60 if (msg->msg_flags & MSG_CMSG_COMPAT) { for_each_cmsghdr()
132 struct msghdr *msg, size_t len) rxrpc_client_sendmsg()
147 ret = rxrpc_sendmsg_cmsg(rx, msg, &user_call_ID, &cmd, &abort_code, rxrpc_client_sendmsg()
155 if (msg->msg_name) { rxrpc_client_sendmsg()
157 msg->msg_name); rxrpc_client_sendmsg()
192 ret = rxrpc_send_data(rx, call, msg, len); rxrpc_client_sendmsg()
203 * @msg: The data to send
207 * appropriate to sending data. No control data should be supplied in @msg,
211 int rxrpc_kernel_send_data(struct rxrpc_call *call, struct msghdr *msg, rxrpc_kernel_send_data() argument
218 ASSERTCMP(msg->msg_name, ==, NULL); rxrpc_kernel_send_data()
219 ASSERTCMP(msg->msg_control, ==, NULL); rxrpc_kernel_send_data()
233 ret = rxrpc_send_data(call->socket, call, msg, len); rxrpc_kernel_send_data()
272 int rxrpc_server_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, size_t len) rxrpc_server_sendmsg() argument
282 ret = rxrpc_sendmsg_cmsg(rx, msg, &user_call_ID, &cmd, &abort_code, rxrpc_server_sendmsg()
313 ret = rxrpc_send_data(rx, call, msg, len); rxrpc_server_sendmsg()
335 struct msghdr msg; rxrpc_send_packet() local
343 msg.msg_name = &trans->peer->srx.transport.sin; rxrpc_send_packet()
344 msg.msg_namelen = sizeof(trans->peer->srx.transport.sin); rxrpc_send_packet()
345 msg.msg_control = NULL; rxrpc_send_packet()
346 msg.msg_controllen = 0; rxrpc_send_packet()
347 msg.msg_flags = 0; rxrpc_send_packet()
359 ret = kernel_sendmsg(trans->local->socket, &msg, iov, 1, rxrpc_send_packet()
379 ret = kernel_sendmsg(trans->local->socket, &msg, iov, 1, rxrpc_send_packet()
522 struct msghdr *msg, size_t len) rxrpc_send_data()
531 timeo = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT); rxrpc_send_data()
539 more = msg->msg_flags & MSG_MORE; rxrpc_send_data()
554 if (msg->msg_flags & MSG_DONTWAIT) rxrpc_send_data()
567 if (chunk > msg_data_left(msg) && !more) rxrpc_send_data()
568 chunk = msg_data_left(msg); rxrpc_send_data()
579 sk, size, msg->msg_flags & MSG_DONTWAIT, &ret); rxrpc_send_data()
611 if (msg_data_left(msg) > 0) { rxrpc_send_data()
614 if (copy > msg_data_left(msg)) rxrpc_send_data()
615 copy = msg_data_left(msg); rxrpc_send_data()
620 ret = skb_add_data(skb, &msg->msg_iter, copy); rxrpc_send_data()
636 (msg_data_left(msg) == 0 && !more)) { rxrpc_send_data()
666 if (msg_data_left(msg) == 0 && !more) rxrpc_send_data()
682 rxrpc_queue_packet(call, skb, !msg_data_left(msg) && !more); rxrpc_send_data()
685 } while (msg_data_left(msg) > 0); rxrpc_send_data()
131 rxrpc_client_sendmsg(struct rxrpc_sock *rx, struct rxrpc_transport *trans, struct msghdr *msg, size_t len) rxrpc_client_sendmsg() argument
520 rxrpc_send_data(struct rxrpc_sock *rx, struct rxrpc_call *call, struct msghdr *msg, size_t len) rxrpc_send_data() argument
H A Dar-connevent.c64 struct msghdr msg; rxrpc_abort_connection() local
86 msg.msg_name = &conn->trans->peer->srx.transport.sin; rxrpc_abort_connection()
87 msg.msg_namelen = sizeof(conn->trans->peer->srx.transport.sin); rxrpc_abort_connection()
88 msg.msg_control = NULL; rxrpc_abort_connection()
89 msg.msg_controllen = 0; rxrpc_abort_connection()
90 msg.msg_flags = 0; rxrpc_abort_connection()
115 ret = kernel_sendmsg(conn->trans->local->socket, &msg, iov, 2, len); rxrpc_abort_connection()
341 struct msghdr msg; rxrpc_reject_packets() local
357 msg.msg_name = &sa; rxrpc_reject_packets()
358 msg.msg_control = NULL; rxrpc_reject_packets()
359 msg.msg_controllen = 0; rxrpc_reject_packets()
360 msg.msg_flags = 0; rxrpc_reject_packets()
366 msg.msg_namelen = sizeof(sa.sin); rxrpc_reject_packets()
369 msg.msg_namelen = 0; rxrpc_reject_packets()
392 kernel_sendmsg(local->socket, &msg, iov, 2, size); rxrpc_reject_packets()
/linux-4.4.14/drivers/media/pci/bt8xx/
H A Dbttv-i2c.c139 bttv_i2c_sendbytes(struct bttv *btv, const struct i2c_msg *msg, int last) bttv_i2c_sendbytes() argument
145 if (0 == msg->len) bttv_i2c_sendbytes()
149 xmit = (msg->addr << 25) | (msg->buf[0] << 16) | I2C_HW; bttv_i2c_sendbytes()
150 if (msg->len > 1 || !last) bttv_i2c_sendbytes()
159 pr_cont(" <W %02x %02x", msg->addr << 1, msg->buf[0]); bttv_i2c_sendbytes()
162 for (cnt = 1; cnt < msg->len; cnt++ ) { bttv_i2c_sendbytes()
164 xmit = (msg->buf[cnt] << 24) | I2C_HW | BT878_I2C_NOSTART; bttv_i2c_sendbytes()
165 if (cnt < msg->len-1 || !last) bttv_i2c_sendbytes()
174 pr_cont(" %02x", msg->buf[cnt]); bttv_i2c_sendbytes()
178 return msg->len; bttv_i2c_sendbytes()
189 bttv_i2c_readbytes(struct bttv *btv, const struct i2c_msg *msg, int last) bttv_i2c_readbytes() argument
195 for (cnt = 0; cnt < msg->len; cnt++) { bttv_i2c_readbytes()
196 xmit = (msg->addr << 25) | (1 << 24) | I2C_HW; bttv_i2c_readbytes()
197 if (cnt < msg->len-1) bttv_i2c_readbytes()
199 if (cnt < msg->len-1 || !last) bttv_i2c_readbytes()
206 pr_cont(" <R %02x", (msg->addr << 1) +1); bttv_i2c_readbytes()
215 msg->buf[cnt] = ((u32)btread(BT848_I2C) >> 8) & 0xff; bttv_i2c_readbytes()
217 pr_cont(" =%02x", msg->buf[cnt]); bttv_i2c_readbytes()
224 return msg->len; bttv_i2c_readbytes()
/linux-4.4.14/arch/powerpc/platforms/powernv/
H A Dopal-prd.c36 * The msg member must be at the end of the struct, as it's followed by the
41 struct opal_prd_msg_header msg; member in struct:opal_prd_msg_queue_item
170 if (count < sizeof(item->msg)) opal_prd_read()
200 size = be16_to_cpu(item->msg.size); opal_prd_read()
206 rc = copy_to_user(buf, &item->msg, size); opal_prd_read()
229 void *msg; opal_prd_write() local
244 msg = kmalloc(size, GFP_KERNEL); opal_prd_write()
245 if (!msg) opal_prd_write()
248 rc = copy_from_user(msg, buf, size); opal_prd_write()
254 rc = opal_prd_msg(msg); opal_prd_write()
261 kfree(msg); opal_prd_write()
268 struct opal_prd_msg_header msg; opal_prd_release() local
270 msg.size = cpu_to_be16(sizeof(msg)); opal_prd_release()
271 msg.type = OPAL_PRD_MSG_TYPE_FINI; opal_prd_release()
273 opal_prd_msg((struct opal_prd_msg *)&msg); opal_prd_release()
356 struct opal_msg *msg = _msg; opal_prd_msg_notifier() local
365 hdr = (void *)msg->params; opal_prd_msg_notifier()
367 item_size = msg_size + sizeof(*item) - sizeof(item->msg); opal_prd_msg_notifier()
373 memcpy(&item->msg, msg->params, msg_size); opal_prd_msg_notifier()
/linux-4.4.14/sound/soc/intel/skylake/
H A Dskl-sst-ipc.c251 static void skl_ipc_tx_data_copy(struct ipc_message *msg, char *tx_data, skl_ipc_tx_data_copy() argument
255 memcpy(msg->tx_data, tx_data, tx_size); skl_ipc_tx_data_copy()
267 static void skl_ipc_tx_msg(struct sst_generic_ipc *ipc, struct ipc_message *msg) skl_ipc_tx_msg() argument
269 struct skl_ipc_header *header = (struct skl_ipc_header *)(&msg->header); skl_ipc_tx_msg()
271 if (msg->tx_size) skl_ipc_tx_msg()
272 sst_dsp_outbox_write(ipc->dsp, msg->tx_data, msg->tx_size); skl_ipc_tx_msg()
282 struct ipc_message *msg = NULL; skl_ipc_reply_get_msg() local
291 msg = list_first_entry(&ipc->rx_list, struct ipc_message, list); skl_ipc_reply_get_msg()
294 return msg; skl_ipc_reply_get_msg()
321 dev_err(ipc->dev, "ipc: Unhandled error msg=%x", skl_ipc_process_notification()
333 struct ipc_message *msg; skl_ipc_process_reply() local
337 msg = skl_ipc_reply_get_msg(ipc, *ipc_header); skl_ipc_process_reply()
338 if (msg == NULL) { skl_ipc_process_reply()
351 msg->errno = -ENOMEM; skl_ipc_process_reply()
356 msg->errno = -EBUSY; skl_ipc_process_reply()
361 msg->errno = -EINVAL; skl_ipc_process_reply()
371 list_del(&msg->list); skl_ipc_process_reply()
372 sst_ipc_tx_msg_reply_complete(ipc, msg); skl_ipc_process_reply()
664 struct skl_ipc_init_instance_msg *msg, void *param_data) skl_ipc_init_instance()
671 u16 param_block_size = msg->param_data_size / sizeof(u32); skl_ipc_init_instance()
679 header.primary |= IPC_MOD_INSTANCE_ID(msg->instance_id); skl_ipc_init_instance()
680 header.primary |= IPC_MOD_ID(msg->module_id); skl_ipc_init_instance()
682 header.extension = IPC_CORE_ID(msg->core_id); skl_ipc_init_instance()
683 header.extension |= IPC_PPL_INSTANCE_ID(msg->ppl_instance_id); skl_ipc_init_instance()
689 msg->param_data_size, NULL, 0); skl_ipc_init_instance()
701 struct skl_ipc_bind_unbind_msg *msg) skl_ipc_bind_unbind()
705 u8 bind_unbind = msg->bind ? IPC_MOD_BIND : IPC_MOD_UNBIND; skl_ipc_bind_unbind()
711 header.primary |= IPC_MOD_INSTANCE_ID(msg->instance_id); skl_ipc_bind_unbind()
712 header.primary |= IPC_MOD_ID(msg->module_id); skl_ipc_bind_unbind()
714 header.extension = IPC_DST_MOD_ID(msg->dst_module_id); skl_ipc_bind_unbind()
715 header.extension |= IPC_DST_MOD_INSTANCE_ID(msg->dst_instance_id); skl_ipc_bind_unbind()
716 header.extension |= IPC_DST_QUEUE(msg->dst_queue); skl_ipc_bind_unbind()
717 header.extension |= IPC_SRC_QUEUE(msg->src_queue); skl_ipc_bind_unbind()
732 struct skl_ipc_large_config_msg *msg, u32 *param) skl_ipc_set_large_config()
742 header.primary |= IPC_MOD_INSTANCE_ID(msg->instance_id); skl_ipc_set_large_config()
743 header.primary |= IPC_MOD_ID(msg->module_id); skl_ipc_set_large_config()
745 header.extension = IPC_DATA_OFFSET_SZ(msg->param_data_size); skl_ipc_set_large_config()
746 header.extension |= IPC_LARGE_PARAM_ID(msg->large_param_id); skl_ipc_set_large_config()
750 sz_remaining = msg->param_data_size; skl_ipc_set_large_config()
771 data_offset = msg->param_data_size - sz_remaining; skl_ipc_set_large_config()
663 skl_ipc_init_instance(struct sst_generic_ipc *ipc, struct skl_ipc_init_instance_msg *msg, void *param_data) skl_ipc_init_instance() argument
700 skl_ipc_bind_unbind(struct sst_generic_ipc *ipc, struct skl_ipc_bind_unbind_msg *msg) skl_ipc_bind_unbind() argument
731 skl_ipc_set_large_config(struct sst_generic_ipc *ipc, struct skl_ipc_large_config_msg *msg, u32 *param) skl_ipc_set_large_config() argument
/linux-4.4.14/drivers/input/touchscreen/
H A Dtsc2005.c35 struct spi_message msg; tsc2005_cmd() local
39 spi_message_init(&msg); tsc2005_cmd()
40 spi_message_add_tail(&xfer, &msg); tsc2005_cmd()
42 error = spi_sync(spi, &msg); tsc2005_cmd()
/linux-4.4.14/fs/nfs/blocklayout/
H A Drpc_pipefs.c60 struct rpc_pipe_msg *msg = &bl_pipe_msg.msg; bl_resolve_deviceid() local
75 memset(msg, 0, sizeof(*msg)); bl_resolve_deviceid()
76 msg->len = sizeof(*bl_msg) + b->simple.len; bl_resolve_deviceid()
77 msg->data = kzalloc(msg->len, gfp_mask); bl_resolve_deviceid()
78 if (!msg->data) bl_resolve_deviceid()
81 bl_msg = msg->data; bl_resolve_deviceid()
84 nfs4_encode_simple(msg->data + sizeof(*bl_msg), b); bl_resolve_deviceid()
88 rc = rpc_queue_upcall(nn->bl_device_pipe, msg); bl_resolve_deviceid()
106 kfree(msg->data); bl_resolve_deviceid()
129 static void bl_pipe_destroy_msg(struct rpc_pipe_msg *msg) bl_pipe_destroy_msg() argument
132 container_of(msg, struct bl_pipe_msg, msg); bl_pipe_destroy_msg()
134 if (msg->errno >= 0) bl_pipe_destroy_msg()
/linux-4.4.14/sound/firewire/tascam/
H A Dtascam-transaction.c66 u8 *label, *msg; fill_message() local
71 msg = buf + 1; fill_message()
73 consume = snd_rawmidi_transmit_peek(substream, msg, 3); fill_message()
81 if (msg[i] == 0xf7) { fill_message()
102 if (msg[0] == 0xf0) { fill_message()
108 if ((msg[0] & 0x80) != 0x80) fill_message()
111 status = msg[0]; fill_message()
119 if ((msg[0] & 0x80) != 0x80) { fill_message()
125 msg[2] = msg[1]; fill_message()
126 msg[1] = msg[0]; fill_message()
127 msg[0] = tscm->running_status[port]; fill_message()
134 tscm->running_status[port] = msg[0]; fill_message()
138 *label = (port << 4) | (msg[0] >> 4); fill_message()
142 memset(msg + len, 0, 3 - len); fill_message()
/linux-4.4.14/tools/perf/util/intel-pt-decoder/
H A Dintel-pt-log.h68 static inline void intel_pt_log_at(const char *msg, uint64_t u) intel_pt_log_at() argument
70 intel_pt_log("%s at " x64_fmt "\n", msg, u); intel_pt_log_at()
73 static inline void intel_pt_log_to(const char *msg, uint64_t u) intel_pt_log_to() argument
75 intel_pt_log("%s to " x64_fmt "\n", msg, u); intel_pt_log_to()
/linux-4.4.14/tools/perf/util/
H A Dusage.c14 char msg[1024]; report() local
15 vsnprintf(msg, sizeof(msg), err, params); report()
16 fprintf(stderr, " %s%s\n", prefix, msg); report()
/linux-4.4.14/drivers/staging/lustre/include/linux/lnet/
H A Dsocklnd.h84 socklnd_init_msg(ksock_msg_t *msg, int type) socklnd_init_msg() argument
86 msg->ksm_csum = 0; socklnd_init_msg()
87 msg->ksm_type = type; socklnd_init_msg()
88 msg->ksm_zc_cookies[0] = msg->ksm_zc_cookies[1] = 0; socklnd_init_msg()
92 #define KSOCK_MSG_LNET 0xC1 /* lnet msg */
94 /* We need to know this number to parse hello msg from ksocklnd in
/linux-4.4.14/drivers/staging/gdm724x/
H A Dnetlink_k.c42 static void (*rcv_cb)(struct net_device *dev, u16 type, void *msg, int len);
49 void *msg; netlink_rcv_cb() local
71 msg = ND_NLMSG_DATA(nlh); netlink_rcv_cb()
76 rcv_cb(dev, nlh->nlmsg_type, msg, mlen); netlink_rcv_cb()
91 void (*cb)(struct net_device *dev, u16 type, void *msg, int len)) netlink_init()
115 int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len) netlink_send() argument
135 memcpy(NLMSG_DATA(nlh), msg, len); netlink_send() local
90 netlink_init(int unit, void (*cb)(struct net_device *dev, u16 type, void *msg, int len)) netlink_init() argument
/linux-4.4.14/drivers/staging/gdm72xx/
H A Dnetlink_k.c45 static void (*rcv_cb)(struct net_device *dev, u16 type, void *msg, int len);
52 void *msg; netlink_rcv_cb() local
66 msg = ND_NLMSG_DATA(nlh); netlink_rcv_cb()
72 rcv_cb(dev, nlh->nlmsg_type, msg, mlen); netlink_rcv_cb()
92 void *msg, int len)) netlink_init()
116 int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len) netlink_send() argument
141 memcpy(nlmsg_data(nlh), msg, len); netlink_send() local
91 netlink_init(int unit, void (*cb)(struct net_device *dev, u16 type, void *msg, int len)) netlink_init() argument
/linux-4.4.14/drivers/crypto/qat/qat_common/
H A Dadf_pf2vf_msg.c149 static int __adf_iov_putmsg(struct adf_accel_dev *accel_dev, u32 msg, u8 vf_nr) __adf_iov_putmsg() argument
192 msg &= ~local_in_use_mask; __adf_iov_putmsg()
193 msg |= local_in_use_pattern; __adf_iov_putmsg()
194 ADF_CSR_WR(pmisc_bar_addr, pf2vf_offset, msg); __adf_iov_putmsg()
213 ADF_CSR_WR(pmisc_bar_addr, pf2vf_offset, msg | int_bit); __adf_iov_putmsg()
227 /* Finished with PF2VF CSR; relinquish it and leave msg in CSR */ __adf_iov_putmsg()
237 * @msg: Message to send
244 int adf_iov_putmsg(struct adf_accel_dev *accel_dev, u32 msg, u8 vf_nr) adf_iov_putmsg() argument
250 ret = __adf_iov_putmsg(accel_dev, msg, vf_nr); adf_iov_putmsg()
266 u32 msg, resp = 0, vf_nr = vf_info->vf_nr; adf_vf2pf_req_hndl() local
269 msg = ADF_CSR_RD(pmisc_addr, hw_data->get_pf2vf_offset(vf_nr)); adf_vf2pf_req_hndl()
272 msg &= ~ADF_VF2PF_INT; adf_vf2pf_req_hndl()
273 ADF_CSR_WR(pmisc_addr, hw_data->get_pf2vf_offset(vf_nr), msg); adf_vf2pf_req_hndl()
275 if (!(msg & ADF_VF2PF_MSGORIGIN_SYSTEM)) adf_vf2pf_req_hndl()
279 switch ((msg & ADF_VF2PF_MSGTYPE_MASK) >> ADF_VF2PF_MSGTYPE_SHIFT) { adf_vf2pf_req_hndl()
282 u8 vf_compat_ver = msg >> ADF_VF2PF_COMPAT_VER_REQ_SHIFT; adf_vf2pf_req_hndl()
318 vf_nr + 1, msg); adf_vf2pf_req_hndl() local
334 vf_nr + 1, msg); adf_vf2pf_req_hndl() local
342 vf_nr + 1, msg); adf_vf2pf_req_hndl() local
358 vf_nr + 1, msg); adf_vf2pf_req_hndl() local
364 u32 msg = (ADF_PF2VF_MSGORIGIN_SYSTEM | adf_pf2vf_notify_restarting() local
369 if (vf->init && adf_iov_putmsg(accel_dev, msg, i)) adf_pf2vf_notify_restarting()
371 "Failed to send restarting msg to VF%d\n", i); adf_pf2vf_notify_restarting()
379 u32 msg = 0; adf_vf2pf_request_version() local
382 msg = ADF_VF2PF_MSGORIGIN_SYSTEM; adf_vf2pf_request_version()
383 msg |= ADF_VF2PF_MSGTYPE_COMPAT_VER_REQ << ADF_VF2PF_MSGTYPE_SHIFT; adf_vf2pf_request_version()
384 msg |= ADF_PFVF_COMPATIBILITY_VERSION << ADF_VF2PF_COMPAT_VER_REQ_SHIFT; adf_vf2pf_request_version()
388 ret = adf_iov_putmsg(accel_dev, msg, 0); adf_vf2pf_request_version()
/linux-4.4.14/arch/s390/kernel/
H A Dos_info.c77 char *buf, *buf_align, *msg; os_info_old_alloc() local
82 msg = "not available"; os_info_old_alloc()
88 msg = "alloc failed"; os_info_old_alloc()
93 msg = "copy failed"; os_info_old_alloc()
98 msg = "checksum failed"; os_info_old_alloc()
102 msg = "copied"; os_info_old_alloc()
110 nr, msg, addr, size); os_info_old_alloc()
/linux-4.4.14/drivers/media/i2c/smiapp/
H A Dsmiapp-regs.c79 struct i2c_msg msg; ____smiapp_read() local
84 msg.addr = client->addr; ____smiapp_read()
85 msg.flags = 0; ____smiapp_read()
86 msg.len = 2; ____smiapp_read()
87 msg.buf = data; ____smiapp_read()
92 r = i2c_transfer(client->adapter, &msg, 1); ____smiapp_read()
99 msg.len = len; ____smiapp_read()
100 msg.flags = I2C_M_RD; ____smiapp_read()
101 r = i2c_transfer(client->adapter, &msg, 1); ____smiapp_read()
222 struct i2c_msg msg; smiapp_write_no_quirk() local
234 msg.addr = client->addr; smiapp_write_no_quirk()
235 msg.flags = 0; /* Write */ smiapp_write_no_quirk()
236 msg.len = 2 + len; smiapp_write_no_quirk()
237 msg.buf = data; smiapp_write_no_quirk()
267 r = i2c_transfer(client->adapter, &msg, 1); smiapp_write_no_quirk()
/linux-4.4.14/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/
H A Danx9805.c48 struct i2c_msg *msg = msgs; anx9805_bus_xfer() local
60 if ( (msg->flags & I2C_M_RD) && msg->addr == 0x50) { anx9805_bus_xfer()
61 nvkm_wri2cr(adap, bus->addr, 0x40, msg->addr << 1); anx9805_bus_xfer()
64 nvkm_wri2cr(adap, bus->addr, 0x44, msg->len); anx9805_bus_xfer()
67 for (i = 0; i < msg->len; i++) { anx9805_bus_xfer()
74 msg->buf[i] = nvkm_rdi2cr(adap, bus->addr, 0x47); anx9805_bus_xfer()
77 if (!(msg->flags & I2C_M_RD)) { anx9805_bus_xfer()
78 if (msg->addr == 0x50 && msg->len == 0x01) { anx9805_bus_xfer()
79 off = msg->buf[0]; anx9805_bus_xfer()
81 if (msg->addr == 0x30 && msg->len == 0x01) { anx9805_bus_xfer()
82 seg = msg->buf[0]; anx9805_bus_xfer()
88 msg++; anx9805_bus_xfer()
/linux-4.4.14/net/ipv6/
H A Ddatagram.c386 int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len) ipv6_recv_error() argument
391 DECLARE_SOCKADDR(struct sockaddr_in6 *, sin, msg->msg_name); ipv6_recv_error()
406 msg->msg_flags |= MSG_TRUNC; ipv6_recv_error()
409 err = skb_copy_datagram_msg(skb, 0, msg, copied); ipv6_recv_error()
413 sock_recv_timestamp(msg, sk, skb); ipv6_recv_error()
446 ip6_datagram_recv_common_ctl(sk, msg, skb); ipv6_recv_error()
450 ip6_datagram_recv_specific_ctl(sk, msg, skb); ipv6_recv_error()
458 ip_cmsg_recv(msg, skb); ipv6_recv_error()
462 put_cmsg(msg, SOL_IPV6, IPV6_RECVERR, sizeof(errhdr), &errhdr); ipv6_recv_error()
466 msg->msg_flags |= MSG_ERRQUEUE; ipv6_recv_error()
479 int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len, ipv6_recv_rxpmtu() argument
485 DECLARE_SOCKADDR(struct sockaddr_in6 *, sin, msg->msg_name); ipv6_recv_rxpmtu()
496 msg->msg_flags |= MSG_TRUNC; ipv6_recv_rxpmtu()
499 err = skb_copy_datagram_msg(skb, 0, msg, copied); ipv6_recv_rxpmtu()
503 sock_recv_timestamp(msg, sk, skb); ipv6_recv_rxpmtu()
516 put_cmsg(msg, SOL_IPV6, IPV6_PATHMTU, sizeof(mtu_info), &mtu_info); ipv6_recv_rxpmtu()
527 void ip6_datagram_recv_common_ctl(struct sock *sk, struct msghdr *msg, ip6_datagram_recv_common_ctl() argument
547 put_cmsg(msg, SOL_IPV6, IPV6_PKTINFO, ip6_datagram_recv_common_ctl()
552 void ip6_datagram_recv_specific_ctl(struct sock *sk, struct msghdr *msg, ip6_datagram_recv_specific_ctl() argument
561 put_cmsg(msg, SOL_IPV6, IPV6_HOPLIMIT, sizeof(hlim), &hlim); ip6_datagram_recv_specific_ctl()
566 put_cmsg(msg, SOL_IPV6, IPV6_TCLASS, sizeof(tclass), &tclass); ip6_datagram_recv_specific_ctl()
572 put_cmsg(msg, SOL_IPV6, IPV6_FLOWINFO, sizeof(flowinfo), &flowinfo); ip6_datagram_recv_specific_ctl()
578 put_cmsg(msg, SOL_IPV6, IPV6_HOPOPTS, (ptr[1]+1)<<3, ptr); ip6_datagram_recv_specific_ctl()
604 put_cmsg(msg, SOL_IPV6, IPV6_DSTOPTS, len, ptr); ip6_datagram_recv_specific_ctl()
610 put_cmsg(msg, SOL_IPV6, IPV6_RTHDR, len, ptr); ip6_datagram_recv_specific_ctl()
632 put_cmsg(msg, SOL_IPV6, IPV6_2292PKTINFO, sizeof(src_info), &src_info); ip6_datagram_recv_specific_ctl()
636 put_cmsg(msg, SOL_IPV6, IPV6_2292HOPLIMIT, sizeof(hlim), &hlim); ip6_datagram_recv_specific_ctl()
640 put_cmsg(msg, SOL_IPV6, IPV6_2292HOPOPTS, (ptr[1]+1)<<3, ptr); ip6_datagram_recv_specific_ctl()
644 put_cmsg(msg, SOL_IPV6, IPV6_2292DSTOPTS, (ptr[1]+1)<<3, ptr); ip6_datagram_recv_specific_ctl()
648 put_cmsg(msg, SOL_IPV6, IPV6_2292RTHDR, (rthdr->hdrlen+1) << 3, rthdr); ip6_datagram_recv_specific_ctl()
652 put_cmsg(msg, SOL_IPV6, IPV6_2292DSTOPTS, (ptr[1]+1)<<3, ptr); ip6_datagram_recv_specific_ctl()
672 put_cmsg(msg, SOL_IPV6, IPV6_ORIGDSTADDR, sizeof(sin6), &sin6); ip6_datagram_recv_specific_ctl()
677 void ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg, ip6_datagram_recv_ctl() argument
680 ip6_datagram_recv_common_ctl(sk, msg, skb); ip6_datagram_recv_ctl()
681 ip6_datagram_recv_specific_ctl(sk, msg, skb); ip6_datagram_recv_ctl()
686 struct msghdr *msg, struct flowi6 *fl6, ip6_datagram_send_ctl()
697 for_each_cmsghdr(cmsg, msg) { for_each_cmsghdr()
700 if (!CMSG_OK(msg, cmsg)) { for_each_cmsghdr()
685 ip6_datagram_send_ctl(struct net *net, struct sock *sk, struct msghdr *msg, struct flowi6 *fl6, struct ipv6_txoptions *opt, int *hlimit, int *tclass, int *dontfrag) ip6_datagram_send_ctl() argument
/linux-4.4.14/drivers/rpmsg/
H A Dvirtio_rpmsg_bus.c95 * Each buffer will have 16 bytes for the msg header and 496 bytes for
691 struct rpmsg_hdr *msg; rpmsg_send_offchannel_raw() local
715 msg = get_a_tx_buf(vrp); rpmsg_send_offchannel_raw()
716 if (!msg && !wait) rpmsg_send_offchannel_raw()
720 while (!msg) { rpmsg_send_offchannel_raw()
731 (msg = get_a_tx_buf(vrp)), rpmsg_send_offchannel_raw()
744 msg->len = len; rpmsg_send_offchannel_raw()
745 msg->flags = 0; rpmsg_send_offchannel_raw()
746 msg->src = src; rpmsg_send_offchannel_raw()
747 msg->dst = dst; rpmsg_send_offchannel_raw()
748 msg->reserved = 0; rpmsg_send_offchannel_raw()
749 memcpy(msg->data, data, len); rpmsg_send_offchannel_raw()
752 msg->src, msg->dst, msg->len, rpmsg_send_offchannel_raw()
753 msg->flags, msg->reserved); rpmsg_send_offchannel_raw()
755 msg, sizeof(*msg) + msg->len, true); rpmsg_send_offchannel_raw()
757 sg_init_one(&sg, msg, sizeof(*msg) + len); rpmsg_send_offchannel_raw()
762 err = virtqueue_add_outbuf(vrp->svq, &sg, 1, msg, GFP_KERNEL); rpmsg_send_offchannel_raw()
782 struct rpmsg_hdr *msg, unsigned int len) rpmsg_recv_single()
789 msg->src, msg->dst, msg->len, rpmsg_recv_single()
790 msg->flags, msg->reserved); rpmsg_recv_single()
792 msg, sizeof(*msg) + msg->len, true); rpmsg_recv_single()
799 msg->len > (len - sizeof(struct rpmsg_hdr))) { rpmsg_recv_single()
800 dev_warn(dev, "inbound msg too big: (%d, %d)\n", len, msg->len); rpmsg_recv_single()
807 ept = idr_find(&vrp->endpoints, msg->dst); rpmsg_recv_single()
820 ept->cb(ept->rpdev, msg->data, msg->len, ept->priv, rpmsg_recv_single()
821 msg->src); rpmsg_recv_single()
828 dev_warn(dev, "msg received with no recipient\n"); rpmsg_recv_single()
831 sg_init_one(&sg, msg, RPMSG_BUF_SIZE); rpmsg_recv_single()
834 err = virtqueue_add_inbuf(vrp->rvq, &sg, 1, msg, GFP_KERNEL); rpmsg_recv_single()
848 struct rpmsg_hdr *msg; rpmsg_recv_done() local
852 msg = virtqueue_get_buf(rvq, &len); rpmsg_recv_done()
853 if (!msg) { rpmsg_recv_done()
858 while (msg) { rpmsg_recv_done()
859 err = rpmsg_recv_single(vrp, dev, msg, len); rpmsg_recv_done()
865 msg = virtqueue_get_buf(rvq, &len); rpmsg_recv_done()
877 * a TX msg we just sent it, and the buffer is put back to the used ring.
896 struct rpmsg_ns_msg *msg = data; rpmsg_ns_cb() local
907 if (len != sizeof(*msg)) { rpmsg_ns_cb()
908 dev_err(dev, "malformed ns msg (%d)\n", len); rpmsg_ns_cb()
924 msg->name[RPMSG_NAME_SIZE - 1] = '\0'; rpmsg_ns_cb()
927 msg->flags & RPMSG_NS_DESTROY ? "destroy" : "creat", rpmsg_ns_cb()
928 msg->name, msg->addr); rpmsg_ns_cb()
930 strncpy(chinfo.name, msg->name, sizeof(chinfo.name)); rpmsg_ns_cb()
932 chinfo.dst = msg->addr; rpmsg_ns_cb()
934 if (msg->flags & RPMSG_NS_DESTROY) { rpmsg_ns_cb()
781 rpmsg_recv_single(struct virtproc_info *vrp, struct device *dev, struct rpmsg_hdr *msg, unsigned int len) rpmsg_recv_single() argument

Completed in 9347 milliseconds

12345678910