• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/sys/dev/netmap/

Lines Matching defs:hdr

62 nmreq_register_from_legacy(struct nmreq *nmr, struct nmreq_header *hdr,
98 if (strlen(hdr->nr_name) + strlen(suffix)
99 >= sizeof(hdr->nr_name)) {
103 strlcat(hdr->nr_name, suffix, sizeof(hdr->nr_name));
125 struct nmreq_header *hdr = nm_os_malloc(sizeof(*hdr));
127 if (hdr == NULL) {
137 hdr->nr_version = NETMAP_API; /* new API */
138 strlcpy(hdr->nr_name, nmr->nr_name, sizeof(nmr->nr_name));
139 hdr->nr_options = (uintptr_t)NULL;
140 hdr->nr_body = (uintptr_t)NULL;
149 hdr->nr_body = (uintptr_t)req;
150 hdr->nr_reqtype = NETMAP_REQ_REGISTER;
151 if (nmreq_register_from_legacy(nmr, hdr, req)) {
159 hdr->nr_body = (uintptr_t)req;
160 hdr->nr_reqtype = NETMAP_REQ_VALE_ATTACH;
161 if (nmreq_register_from_legacy(nmr, hdr, &req->reg)) {
173 hdr->nr_reqtype = NETMAP_REQ_VALE_DETACH;
174 hdr->nr_body = (uintptr_t)nm_os_malloc(sizeof(struct nmreq_vale_detach));
181 hdr->nr_body = (uintptr_t)req;
182 hdr->nr_reqtype = (nmr->nr_cmd == NETMAP_BDG_VNET_HDR) ?
190 hdr->nr_body = (uintptr_t)req;
191 hdr->nr_reqtype = NETMAP_REQ_VALE_NEWIF;
200 hdr->nr_reqtype = NETMAP_REQ_VALE_DELIF;
207 hdr->nr_body = (uintptr_t)req;
208 hdr->nr_reqtype = (nmr->nr_cmd == NETMAP_BDG_POLLING_ON) ?
239 hdr->nr_body = (uintptr_t)req;
240 hdr->nr_reqtype = NETMAP_REQ_VALE_LIST;
247 hdr->nr_body = (uintptr_t)req;
248 hdr->nr_reqtype = NETMAP_REQ_PORT_INFO_GET;
262 return hdr;
264 if (hdr) {
265 if (hdr->nr_body) {
266 nm_os_free((void *)(uintptr_t)hdr->nr_body);
268 nm_os_free(hdr);
292 nmreq_to_legacy(struct nmreq_header *hdr, struct nmreq *nmr)
298 switch (hdr->nr_reqtype) {
301 (struct nmreq_register *)(uintptr_t)hdr->nr_body;
307 (struct nmreq_port_info_get *)(uintptr_t)hdr->nr_body;
318 (struct nmreq_vale_attach *)(uintptr_t)hdr->nr_body;
327 (struct nmreq_vale_list *)(uintptr_t)hdr->nr_body;
328 strlcpy(nmr->nr_name, hdr->nr_name, sizeof(nmr->nr_name));
336 (struct nmreq_port_hdr *)(uintptr_t)hdr->nr_body;
342 (struct nmreq_vale_newif *)(uintptr_t)hdr->nr_body;
372 struct nmreq_header *hdr;
379 hdr = nmreq_from_legacy(nmr, cmd);
380 if (hdr == NULL) { /* out of memory */
383 error = netmap_ioctl(priv, NIOCCTRL, (caddr_t)hdr, td,
386 nmreq_to_legacy(hdr, nmr);
388 if (hdr->nr_body) {
389 nm_os_free((void *)(uintptr_t)hdr->nr_body);
391 nm_os_free(hdr);