| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: if_iwm.c,v 1.18 2015/03/03 09:16:56 nonaka Exp $ */ | | 1 | /* $NetBSD: if_iwm.c,v 1.19 2015/03/03 09:22:06 nonaka Exp $ */ |
2 | /* OpenBSD: if_iwm.c,v 1.18 2015/02/11 01:12:42 brad Exp */ | | 2 | /* OpenBSD: if_iwm.c,v 1.18 2015/02/11 01:12:42 brad Exp */ |
3 | | | 3 | |
4 | /* | | 4 | /* |
5 | * Copyright (c) 2014 genua mbh <info@genua.de> | | 5 | * Copyright (c) 2014 genua mbh <info@genua.de> |
6 | * Copyright (c) 2014 Fixup Software Ltd. | | 6 | * Copyright (c) 2014 Fixup Software Ltd. |
7 | * | | 7 | * |
8 | * Permission to use, copy, modify, and distribute this software for any | | 8 | * Permission to use, copy, modify, and distribute this software for any |
9 | * purpose with or without fee is hereby granted, provided that the above | | 9 | * purpose with or without fee is hereby granted, provided that the above |
10 | * copyright notice and this permission notice appear in all copies. | | 10 | * copyright notice and this permission notice appear in all copies. |
11 | * | | 11 | * |
12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | | 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
13 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | | 13 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
14 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | | 14 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| @@ -95,27 +95,27 @@ | | | @@ -95,27 +95,27 @@ |
95 | * purpose with or without fee is hereby granted, provided that the above | | 95 | * purpose with or without fee is hereby granted, provided that the above |
96 | * copyright notice and this permission notice appear in all copies. | | 96 | * copyright notice and this permission notice appear in all copies. |
97 | * | | 97 | * |
98 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | | 98 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
99 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | | 99 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
100 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | | 100 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
101 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | | 101 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
102 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | | 102 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
103 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | | 103 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
104 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | | 104 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
105 | */ | | 105 | */ |
106 | | | 106 | |
107 | #include <sys/cdefs.h> | | 107 | #include <sys/cdefs.h> |
108 | __KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.18 2015/03/03 09:16:56 nonaka Exp $"); | | 108 | __KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.19 2015/03/03 09:22:06 nonaka Exp $"); |
109 | | | 109 | |
110 | #include <sys/param.h> | | 110 | #include <sys/param.h> |
111 | #include <sys/conf.h> | | 111 | #include <sys/conf.h> |
112 | #include <sys/kernel.h> | | 112 | #include <sys/kernel.h> |
113 | #include <sys/kmem.h> | | 113 | #include <sys/kmem.h> |
114 | #include <sys/mbuf.h> | | 114 | #include <sys/mbuf.h> |
115 | #include <sys/mutex.h> | | 115 | #include <sys/mutex.h> |
116 | #include <sys/proc.h> | | 116 | #include <sys/proc.h> |
117 | #include <sys/socket.h> | | 117 | #include <sys/socket.h> |
118 | #include <sys/sockio.h> | | 118 | #include <sys/sockio.h> |
119 | #include <sys/systm.h> | | 119 | #include <sys/systm.h> |
120 | | | 120 | |
121 | #include <sys/cpu.h> | | 121 | #include <sys/cpu.h> |
| @@ -3501,27 +3501,27 @@ iwm_mvm_phy_ctxt_changed(struct iwm_soft | | | @@ -3501,27 +3501,27 @@ iwm_mvm_phy_ctxt_changed(struct iwm_soft |
3501 | * | | 3501 | * |
3502 | * For now, we always copy the first part and map the second one (if it exists). | | 3502 | * For now, we always copy the first part and map the second one (if it exists). |
3503 | */ | | 3503 | */ |
3504 | static int | | 3504 | static int |
3505 | iwm_send_cmd(struct iwm_softc *sc, struct iwm_host_cmd *hcmd) | | 3505 | iwm_send_cmd(struct iwm_softc *sc, struct iwm_host_cmd *hcmd) |
3506 | { | | 3506 | { |
3507 | struct iwm_tx_ring *ring = &sc->txq[IWM_MVM_CMD_QUEUE]; | | 3507 | struct iwm_tx_ring *ring = &sc->txq[IWM_MVM_CMD_QUEUE]; |
3508 | struct iwm_tfd *desc; | | 3508 | struct iwm_tfd *desc; |
3509 | struct iwm_tx_data *data; | | 3509 | struct iwm_tx_data *data; |
3510 | struct iwm_device_cmd *cmd; | | 3510 | struct iwm_device_cmd *cmd; |
3511 | struct mbuf *m; | | 3511 | struct mbuf *m; |
3512 | bus_addr_t paddr; | | 3512 | bus_addr_t paddr; |
3513 | uint32_t addr_lo; | | 3513 | uint32_t addr_lo; |
3514 | int error, i, paylen, off, s; | | 3514 | int error = 0, i, paylen, off, s; |
3515 | int code; | | 3515 | int code; |
3516 | int async, wantresp; | | 3516 | int async, wantresp; |
3517 | | | 3517 | |
3518 | code = hcmd->id; | | 3518 | code = hcmd->id; |
3519 | async = hcmd->flags & IWM_CMD_ASYNC; | | 3519 | async = hcmd->flags & IWM_CMD_ASYNC; |
3520 | wantresp = hcmd->flags & IWM_CMD_WANT_SKB; | | 3520 | wantresp = hcmd->flags & IWM_CMD_WANT_SKB; |
3521 | | | 3521 | |
3522 | for (i = 0, paylen = 0; i < __arraycount(hcmd->len); i++) { | | 3522 | for (i = 0, paylen = 0; i < __arraycount(hcmd->len); i++) { |
3523 | paylen += hcmd->len[i]; | | 3523 | paylen += hcmd->len[i]; |
3524 | } | | 3524 | } |
3525 | | | 3525 | |
3526 | /* if the command wants an answer, busy sc_cmd_resp */ | | 3526 | /* if the command wants an answer, busy sc_cmd_resp */ |
3527 | if (wantresp) { | | 3527 | if (wantresp) { |