Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc. |
| 3 | * All rights reserved. |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License along |
| 16 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 18 | * |
| 19 | * |
| 20 | * File: mac.c |
| 21 | * |
| 22 | * Purpose: MAC routines |
| 23 | * |
| 24 | * Author: Tevin Chen |
| 25 | * |
| 26 | * Date: May 21, 1996 |
| 27 | * |
| 28 | * Functions: |
| 29 | * |
| 30 | * Revision History: |
| 31 | */ |
| 32 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 33 | #include "tmacro.h" |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 34 | #include "tether.h" |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 35 | #include "desc.h" |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 36 | #include "mac.h" |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 37 | #include "80211hdr.h" |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 38 | #include "control.h" |
Jim Lieb | 9d26d60 | 2009-08-12 14:54:08 -0700 | [diff] [blame] | 39 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 40 | //static int msglevel =MSG_LEVEL_DEBUG; |
| 41 | static int msglevel =MSG_LEVEL_INFO; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 42 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 43 | /* |
| 44 | * Description: |
| 45 | * Write MAC Multicast Address Mask |
| 46 | * |
| 47 | * Parameters: |
| 48 | * In: |
Malcolm Priestley | 0ca3e28 | 2014-02-12 19:18:26 +0000 | [diff] [blame] | 49 | * mc_filter (mac filter) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 50 | * Out: |
| 51 | * none |
| 52 | * |
| 53 | * Return Value: none |
| 54 | * |
| 55 | */ |
Malcolm Priestley | 7585940 | 2014-05-23 18:00:00 +0100 | [diff] [blame] | 56 | void MACvWriteMultiAddr(struct vnt_private *priv, u64 mc_filter) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 57 | { |
Malcolm Priestley | 0ca3e28 | 2014-02-12 19:18:26 +0000 | [diff] [blame] | 58 | __le64 le_mc = cpu_to_le64(mc_filter); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 59 | |
Malcolm Priestley | 7585940 | 2014-05-23 18:00:00 +0100 | [diff] [blame] | 60 | CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE, MAC_REG_MAR0, |
Malcolm Priestley | 0ca3e28 | 2014-02-12 19:18:26 +0000 | [diff] [blame] | 61 | MESSAGE_REQUEST_MACREG, sizeof(le_mc), (u8 *)&le_mc); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 62 | } |
| 63 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 64 | /* |
| 65 | * Description: |
| 66 | * Shut Down MAC |
| 67 | * |
| 68 | * Parameters: |
| 69 | * In: |
| 70 | * Out: |
| 71 | * none |
| 72 | * |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 73 | * |
| 74 | */ |
Malcolm Priestley | 88eee07 | 2014-05-23 18:00:01 +0100 | [diff] [blame] | 75 | void MACbShutdown(struct vnt_private *priv) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 76 | { |
Malcolm Priestley | 88eee07 | 2014-05-23 18:00:01 +0100 | [diff] [blame] | 77 | CONTROLnsRequestOut(priv, MESSAGE_TYPE_MACSHUTDOWN, 0, 0, 0, NULL); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 78 | } |
| 79 | |
Malcolm Priestley | bee7b68 | 2014-05-23 18:00:02 +0100 | [diff] [blame] | 80 | void MACvSetBBType(struct vnt_private *priv, u8 type) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 81 | { |
Malcolm Priestley | bee7b68 | 2014-05-23 18:00:02 +0100 | [diff] [blame] | 82 | u8 data[2]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 83 | |
Malcolm Priestley | bee7b68 | 2014-05-23 18:00:02 +0100 | [diff] [blame] | 84 | data[0] = type; |
| 85 | data[1] = EnCFG_BBType_MASK; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 86 | |
Malcolm Priestley | bee7b68 | 2014-05-23 18:00:02 +0100 | [diff] [blame] | 87 | CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG0, |
| 88 | MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 89 | } |
| 90 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 91 | /* |
| 92 | * Description: |
| 93 | * Disable the Key Entry by MISCFIFO |
| 94 | * |
| 95 | * Parameters: |
| 96 | * In: |
| 97 | * dwIoBase - Base Address for MAC |
| 98 | * |
| 99 | * Out: |
| 100 | * none |
| 101 | * |
| 102 | * Return Value: none |
| 103 | * |
| 104 | */ |
Malcolm Priestley | e836e42 | 2014-05-23 18:00:04 +0100 | [diff] [blame] | 105 | void MACvDisableKeyEntry(struct vnt_private *priv, u8 entry_idx) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 106 | { |
Malcolm Priestley | e836e42 | 2014-05-23 18:00:04 +0100 | [diff] [blame] | 107 | CONTROLnsRequestOut(priv, MESSAGE_TYPE_CLRKEYENTRY, 0, 0, |
| 108 | sizeof(entry_idx), &entry_idx); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 109 | } |
| 110 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 111 | /* |
| 112 | * Description: |
| 113 | * Set the Key by MISCFIFO |
| 114 | * |
| 115 | * Parameters: |
| 116 | * In: |
| 117 | * dwIoBase - Base Address for MAC |
| 118 | * |
| 119 | * Out: |
| 120 | * none |
| 121 | * |
| 122 | * Return Value: none |
| 123 | * |
| 124 | */ |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 125 | void MACvSetKeyEntry(struct vnt_private *pDevice, u16 wKeyCtl, u32 uEntryIdx, |
| 126 | u32 uKeyIdx, u8 *pbyAddr, u32 *pdwKey) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 127 | { |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 128 | u8 *pbyKey; |
| 129 | u16 wOffset; |
| 130 | u32 dwData1, dwData2; |
| 131 | int ii; |
| 132 | u8 pbyData[24]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 133 | |
Malcolm Priestley | 14c5ef5 | 2013-01-17 23:19:37 +0000 | [diff] [blame] | 134 | if (pDevice->byLocalID <= MAC_REVISION_A1) |
| 135 | if (pDevice->vnt_mgmt.byCSSPK == KEY_CTL_CCMP) |
| 136 | return; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 137 | |
| 138 | wOffset = MISCFIFO_KEYETRY0; |
| 139 | wOffset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE); |
| 140 | |
| 141 | dwData1 = 0; |
| 142 | dwData1 |= wKeyCtl; |
| 143 | dwData1 <<= 16; |
| 144 | dwData1 |= MAKEWORD(*(pbyAddr+4), *(pbyAddr+5)); |
| 145 | |
Malcolm Priestley | b4dc03a | 2012-11-11 15:45:52 +0000 | [diff] [blame] | 146 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"1. wOffset: %d, Data: %X,"\ |
| 147 | " KeyCtl:%X\n", wOffset, dwData1, wKeyCtl); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 148 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 149 | dwData2 = 0; |
| 150 | dwData2 |= *(pbyAddr+3); |
| 151 | dwData2 <<= 8; |
| 152 | dwData2 |= *(pbyAddr+2); |
| 153 | dwData2 <<= 8; |
| 154 | dwData2 |= *(pbyAddr+1); |
| 155 | dwData2 <<= 8; |
| 156 | dwData2 |= *(pbyAddr+0); |
| 157 | |
Malcolm Priestley | b4dc03a | 2012-11-11 15:45:52 +0000 | [diff] [blame] | 158 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"2. wOffset: %d, Data: %X\n", |
| 159 | wOffset, dwData2); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 160 | |
Andres More | b902fbf | 2013-02-25 20:32:51 -0500 | [diff] [blame] | 161 | pbyKey = (u8 *)pdwKey; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 162 | |
Andres More | b902fbf | 2013-02-25 20:32:51 -0500 | [diff] [blame] | 163 | pbyData[0] = (u8)dwData1; |
| 164 | pbyData[1] = (u8)(dwData1>>8); |
| 165 | pbyData[2] = (u8)(dwData1>>16); |
| 166 | pbyData[3] = (u8)(dwData1>>24); |
| 167 | pbyData[4] = (u8)dwData2; |
| 168 | pbyData[5] = (u8)(dwData2>>8); |
| 169 | pbyData[6] = (u8)(dwData2>>16); |
| 170 | pbyData[7] = (u8)(dwData2>>24); |
Andres More | 33d33e42 | 2010-05-19 23:50:00 -0300 | [diff] [blame] | 171 | for (ii = 8; ii < 24; ii++) |
| 172 | pbyData[ii] = *pbyKey++; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 173 | |
| 174 | CONTROLnsRequestOut(pDevice, |
| 175 | MESSAGE_TYPE_SETKEY, |
| 176 | wOffset, |
Andres More | 3eaca0d | 2013-02-25 20:32:52 -0500 | [diff] [blame] | 177 | (u16)uKeyIdx, |
Malcolm Priestley | 13d8d89 | 2013-06-17 22:19:54 +0100 | [diff] [blame] | 178 | ARRAY_SIZE(pbyData), |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 179 | pbyData |
| 180 | ); |
| 181 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 182 | } |
| 183 | |
Malcolm Priestley | f22f769 | 2014-05-23 18:00:05 +0100 | [diff] [blame] | 184 | void MACvRegBitsOff(struct vnt_private *priv, u8 reg_ofs, u8 bits) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 185 | { |
Malcolm Priestley | f22f769 | 2014-05-23 18:00:05 +0100 | [diff] [blame] | 186 | u8 data[2]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 187 | |
Malcolm Priestley | f22f769 | 2014-05-23 18:00:05 +0100 | [diff] [blame] | 188 | data[0] = 0; |
| 189 | data[1] = bits; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 190 | |
Malcolm Priestley | f22f769 | 2014-05-23 18:00:05 +0100 | [diff] [blame] | 191 | CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE_MASK, |
| 192 | reg_ofs, MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 193 | } |
| 194 | |
Malcolm Priestley | 8fda36c | 2014-05-23 18:00:06 +0100 | [diff] [blame] | 195 | void MACvRegBitsOn(struct vnt_private *priv, u8 reg_ofs, u8 bits) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 196 | { |
Malcolm Priestley | 8fda36c | 2014-05-23 18:00:06 +0100 | [diff] [blame] | 197 | u8 data[2]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 198 | |
Malcolm Priestley | 8fda36c | 2014-05-23 18:00:06 +0100 | [diff] [blame] | 199 | data[0] = bits; |
| 200 | data[1] = bits; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 201 | |
Malcolm Priestley | 8fda36c | 2014-05-23 18:00:06 +0100 | [diff] [blame] | 202 | CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE_MASK, |
| 203 | reg_ofs, MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 204 | } |
| 205 | |
Malcolm Priestley | e1cc91f | 2014-05-23 18:00:07 +0100 | [diff] [blame] | 206 | void MACvWriteWord(struct vnt_private *priv, u8 reg_ofs, u16 word) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 207 | { |
Malcolm Priestley | e1cc91f | 2014-05-23 18:00:07 +0100 | [diff] [blame] | 208 | u8 data[2]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 209 | |
Malcolm Priestley | e1cc91f | 2014-05-23 18:00:07 +0100 | [diff] [blame] | 210 | data[0] = (u8)(word & 0xff); |
| 211 | data[1] = (u8)(word >> 8); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 212 | |
Malcolm Priestley | e1cc91f | 2014-05-23 18:00:07 +0100 | [diff] [blame] | 213 | CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE, |
| 214 | reg_ofs, MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 215 | } |
| 216 | |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 217 | void MACvWriteBSSIDAddress(struct vnt_private *pDevice, u8 *pbyEtherAddr) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 218 | { |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 219 | CONTROLnsRequestOut(pDevice, |
| 220 | MESSAGE_TYPE_WRITE, |
| 221 | MAC_REG_BSSID0, |
| 222 | MESSAGE_REQUEST_MACREG, |
Malcolm Priestley | 08a150c | 2014-05-23 18:00:08 +0100 | [diff] [blame^] | 223 | ETH_ALEN, |
| 224 | pbyEtherAddr |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 225 | ); |
| 226 | } |
| 227 | |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 228 | void MACvEnableProtectMD(struct vnt_private *pDevice) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 229 | { |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 230 | u8 pbyData[2]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 231 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 232 | pbyData[0] = EnCFG_ProtectMd; |
| 233 | pbyData[1] = EnCFG_ProtectMd; |
| 234 | |
| 235 | CONTROLnsRequestOut(pDevice, |
| 236 | MESSAGE_TYPE_WRITE_MASK, |
| 237 | MAC_REG_ENCFG0, |
| 238 | MESSAGE_REQUEST_MACREG, |
Malcolm Priestley | 13d8d89 | 2013-06-17 22:19:54 +0100 | [diff] [blame] | 239 | ARRAY_SIZE(pbyData), |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 240 | pbyData |
| 241 | ); |
| 242 | } |
| 243 | |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 244 | void MACvDisableProtectMD(struct vnt_private *pDevice) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 245 | { |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 246 | u8 pbyData[2]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 247 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 248 | pbyData[0] = 0; |
| 249 | pbyData[1] = EnCFG_ProtectMd; |
| 250 | |
| 251 | CONTROLnsRequestOut(pDevice, |
| 252 | MESSAGE_TYPE_WRITE_MASK, |
| 253 | MAC_REG_ENCFG0, |
| 254 | MESSAGE_REQUEST_MACREG, |
Malcolm Priestley | 13d8d89 | 2013-06-17 22:19:54 +0100 | [diff] [blame] | 255 | ARRAY_SIZE(pbyData), |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 256 | pbyData |
| 257 | ); |
| 258 | } |
| 259 | |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 260 | void MACvEnableBarkerPreambleMd(struct vnt_private *pDevice) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 261 | { |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 262 | u8 pbyData[2]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 263 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 264 | pbyData[0] = EnCFG_BarkerPream; |
| 265 | pbyData[1] = EnCFG_BarkerPream; |
| 266 | |
| 267 | CONTROLnsRequestOut(pDevice, |
| 268 | MESSAGE_TYPE_WRITE_MASK, |
| 269 | MAC_REG_ENCFG2, |
| 270 | MESSAGE_REQUEST_MACREG, |
Malcolm Priestley | 13d8d89 | 2013-06-17 22:19:54 +0100 | [diff] [blame] | 271 | ARRAY_SIZE(pbyData), |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 272 | pbyData |
| 273 | ); |
| 274 | } |
| 275 | |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 276 | void MACvDisableBarkerPreambleMd(struct vnt_private *pDevice) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 277 | { |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 278 | u8 pbyData[2]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 279 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 280 | pbyData[0] = 0; |
| 281 | pbyData[1] = EnCFG_BarkerPream; |
| 282 | |
| 283 | CONTROLnsRequestOut(pDevice, |
| 284 | MESSAGE_TYPE_WRITE_MASK, |
| 285 | MAC_REG_ENCFG2, |
| 286 | MESSAGE_REQUEST_MACREG, |
Malcolm Priestley | 13d8d89 | 2013-06-17 22:19:54 +0100 | [diff] [blame] | 287 | ARRAY_SIZE(pbyData), |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 288 | pbyData |
| 289 | ); |
| 290 | } |
| 291 | |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 292 | void MACvWriteBeaconInterval(struct vnt_private *pDevice, u16 wInterval) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 293 | { |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 294 | u8 pbyData[2]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 295 | |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 296 | pbyData[0] = (u8)(wInterval & 0xff); |
| 297 | pbyData[1] = (u8)(wInterval >> 8); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 298 | |
| 299 | CONTROLnsRequestOut(pDevice, |
Clelia V. Korol | b411f12 | 2010-09-16 15:00:19 -0300 | [diff] [blame] | 300 | MESSAGE_TYPE_WRITE, |
| 301 | MAC_REG_BI, |
| 302 | MESSAGE_REQUEST_MACREG, |
Malcolm Priestley | 13d8d89 | 2013-06-17 22:19:54 +0100 | [diff] [blame] | 303 | ARRAY_SIZE(pbyData), |
Clelia V. Korol | b411f12 | 2010-09-16 15:00:19 -0300 | [diff] [blame] | 304 | pbyData |
| 305 | ); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 306 | } |