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 | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 75 | void MACbShutdown(struct vnt_private *pDevice) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 76 | { |
Malcolm Priestley | 3136b5f | 2014-05-15 22:49:24 +0100 | [diff] [blame] | 77 | CONTROLnsRequestOut(pDevice, |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 78 | MESSAGE_TYPE_MACSHUTDOWN, |
| 79 | 0, |
| 80 | 0, |
| 81 | 0, |
| 82 | NULL |
| 83 | ); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 84 | } |
| 85 | |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 86 | void MACvSetBBType(struct vnt_private *pDevice, u8 byType) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 87 | { |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 88 | u8 pbyData[2]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 89 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 90 | pbyData[0] = byType; |
| 91 | pbyData[1] = EnCFG_BBType_MASK; |
| 92 | |
| 93 | CONTROLnsRequestOut(pDevice, |
| 94 | MESSAGE_TYPE_WRITE_MASK, |
| 95 | MAC_REG_ENCFG0, |
| 96 | MESSAGE_REQUEST_MACREG, |
Malcolm Priestley | 13d8d89 | 2013-06-17 22:19:54 +0100 | [diff] [blame] | 97 | ARRAY_SIZE(pbyData), |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 98 | pbyData |
| 99 | ); |
| 100 | } |
| 101 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 102 | /* |
| 103 | * Description: |
| 104 | * Disable the Key Entry by MISCFIFO |
| 105 | * |
| 106 | * Parameters: |
| 107 | * In: |
| 108 | * dwIoBase - Base Address for MAC |
| 109 | * |
| 110 | * Out: |
| 111 | * none |
| 112 | * |
| 113 | * Return Value: none |
| 114 | * |
| 115 | */ |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 116 | void MACvDisableKeyEntry(struct vnt_private *pDevice, u32 uEntryIdx) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 117 | { |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 118 | u8 byData; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 119 | |
Andres More | b902fbf | 2013-02-25 20:32:51 -0500 | [diff] [blame] | 120 | byData = (u8) uEntryIdx; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 121 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 122 | //issue write misc fifo command to device |
| 123 | CONTROLnsRequestOut(pDevice, |
| 124 | MESSAGE_TYPE_CLRKEYENTRY, |
| 125 | 0, |
| 126 | 0, |
| 127 | 1, |
| 128 | &byData |
| 129 | ); |
| 130 | } |
| 131 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 132 | /* |
| 133 | * Description: |
| 134 | * Set the Key by MISCFIFO |
| 135 | * |
| 136 | * Parameters: |
| 137 | * In: |
| 138 | * dwIoBase - Base Address for MAC |
| 139 | * |
| 140 | * Out: |
| 141 | * none |
| 142 | * |
| 143 | * Return Value: none |
| 144 | * |
| 145 | */ |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 146 | void MACvSetKeyEntry(struct vnt_private *pDevice, u16 wKeyCtl, u32 uEntryIdx, |
| 147 | u32 uKeyIdx, u8 *pbyAddr, u32 *pdwKey) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 148 | { |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 149 | u8 *pbyKey; |
| 150 | u16 wOffset; |
| 151 | u32 dwData1, dwData2; |
| 152 | int ii; |
| 153 | u8 pbyData[24]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 154 | |
Malcolm Priestley | 14c5ef5 | 2013-01-17 23:19:37 +0000 | [diff] [blame] | 155 | if (pDevice->byLocalID <= MAC_REVISION_A1) |
| 156 | if (pDevice->vnt_mgmt.byCSSPK == KEY_CTL_CCMP) |
| 157 | return; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 158 | |
| 159 | wOffset = MISCFIFO_KEYETRY0; |
| 160 | wOffset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE); |
| 161 | |
| 162 | dwData1 = 0; |
| 163 | dwData1 |= wKeyCtl; |
| 164 | dwData1 <<= 16; |
| 165 | dwData1 |= MAKEWORD(*(pbyAddr+4), *(pbyAddr+5)); |
| 166 | |
Malcolm Priestley | b4dc03a | 2012-11-11 15:45:52 +0000 | [diff] [blame] | 167 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"1. wOffset: %d, Data: %X,"\ |
| 168 | " KeyCtl:%X\n", wOffset, dwData1, wKeyCtl); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 169 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 170 | dwData2 = 0; |
| 171 | dwData2 |= *(pbyAddr+3); |
| 172 | dwData2 <<= 8; |
| 173 | dwData2 |= *(pbyAddr+2); |
| 174 | dwData2 <<= 8; |
| 175 | dwData2 |= *(pbyAddr+1); |
| 176 | dwData2 <<= 8; |
| 177 | dwData2 |= *(pbyAddr+0); |
| 178 | |
Malcolm Priestley | b4dc03a | 2012-11-11 15:45:52 +0000 | [diff] [blame] | 179 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"2. wOffset: %d, Data: %X\n", |
| 180 | wOffset, dwData2); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 181 | |
Andres More | b902fbf | 2013-02-25 20:32:51 -0500 | [diff] [blame] | 182 | pbyKey = (u8 *)pdwKey; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 183 | |
Andres More | b902fbf | 2013-02-25 20:32:51 -0500 | [diff] [blame] | 184 | pbyData[0] = (u8)dwData1; |
| 185 | pbyData[1] = (u8)(dwData1>>8); |
| 186 | pbyData[2] = (u8)(dwData1>>16); |
| 187 | pbyData[3] = (u8)(dwData1>>24); |
| 188 | pbyData[4] = (u8)dwData2; |
| 189 | pbyData[5] = (u8)(dwData2>>8); |
| 190 | pbyData[6] = (u8)(dwData2>>16); |
| 191 | pbyData[7] = (u8)(dwData2>>24); |
Andres More | 33d33e42 | 2010-05-19 23:50:00 -0300 | [diff] [blame] | 192 | for (ii = 8; ii < 24; ii++) |
| 193 | pbyData[ii] = *pbyKey++; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 194 | |
| 195 | CONTROLnsRequestOut(pDevice, |
| 196 | MESSAGE_TYPE_SETKEY, |
| 197 | wOffset, |
Andres More | 3eaca0d | 2013-02-25 20:32:52 -0500 | [diff] [blame] | 198 | (u16)uKeyIdx, |
Malcolm Priestley | 13d8d89 | 2013-06-17 22:19:54 +0100 | [diff] [blame] | 199 | ARRAY_SIZE(pbyData), |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 200 | pbyData |
| 201 | ); |
| 202 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 203 | } |
| 204 | |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 205 | void MACvRegBitsOff(struct vnt_private *pDevice, u8 byRegOfs, u8 byBits) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 206 | { |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 207 | u8 pbyData[2]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 208 | |
| 209 | pbyData[0] = 0; |
| 210 | pbyData[1] = byBits; |
| 211 | |
| 212 | CONTROLnsRequestOut(pDevice, |
| 213 | MESSAGE_TYPE_WRITE_MASK, |
| 214 | byRegOfs, |
| 215 | MESSAGE_REQUEST_MACREG, |
Malcolm Priestley | 13d8d89 | 2013-06-17 22:19:54 +0100 | [diff] [blame] | 216 | ARRAY_SIZE(pbyData), |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 217 | pbyData |
| 218 | ); |
| 219 | } |
| 220 | |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 221 | void MACvRegBitsOn(struct vnt_private *pDevice, u8 byRegOfs, u8 byBits) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 222 | { |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 223 | u8 pbyData[2]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 224 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 225 | pbyData[0] = byBits; |
| 226 | pbyData[1] = byBits; |
| 227 | |
| 228 | CONTROLnsRequestOut(pDevice, |
| 229 | MESSAGE_TYPE_WRITE_MASK, |
| 230 | byRegOfs, |
| 231 | MESSAGE_REQUEST_MACREG, |
Malcolm Priestley | 13d8d89 | 2013-06-17 22:19:54 +0100 | [diff] [blame] | 232 | ARRAY_SIZE(pbyData), |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 233 | pbyData |
| 234 | ); |
| 235 | } |
| 236 | |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 237 | void MACvWriteWord(struct vnt_private *pDevice, u8 byRegOfs, u16 wData) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 238 | { |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 239 | u8 pbyData[2]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 240 | |
Andres More | b902fbf | 2013-02-25 20:32:51 -0500 | [diff] [blame] | 241 | pbyData[0] = (u8)(wData & 0xff); |
| 242 | pbyData[1] = (u8)(wData >> 8); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 243 | |
| 244 | CONTROLnsRequestOut(pDevice, |
| 245 | MESSAGE_TYPE_WRITE, |
| 246 | byRegOfs, |
| 247 | MESSAGE_REQUEST_MACREG, |
Malcolm Priestley | 13d8d89 | 2013-06-17 22:19:54 +0100 | [diff] [blame] | 248 | ARRAY_SIZE(pbyData), |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 249 | pbyData |
| 250 | ); |
| 251 | |
| 252 | } |
| 253 | |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 254 | void MACvWriteBSSIDAddress(struct vnt_private *pDevice, u8 *pbyEtherAddr) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 255 | { |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 256 | u8 pbyData[6]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 257 | |
Andres More | b902fbf | 2013-02-25 20:32:51 -0500 | [diff] [blame] | 258 | pbyData[0] = *((u8 *)pbyEtherAddr); |
| 259 | pbyData[1] = *((u8 *)pbyEtherAddr+1); |
| 260 | pbyData[2] = *((u8 *)pbyEtherAddr+2); |
| 261 | pbyData[3] = *((u8 *)pbyEtherAddr+3); |
| 262 | pbyData[4] = *((u8 *)pbyEtherAddr+4); |
| 263 | pbyData[5] = *((u8 *)pbyEtherAddr+5); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 264 | |
| 265 | CONTROLnsRequestOut(pDevice, |
| 266 | MESSAGE_TYPE_WRITE, |
| 267 | MAC_REG_BSSID0, |
| 268 | MESSAGE_REQUEST_MACREG, |
Malcolm Priestley | 13d8d89 | 2013-06-17 22:19:54 +0100 | [diff] [blame] | 269 | ARRAY_SIZE(pbyData), |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 270 | pbyData |
| 271 | ); |
| 272 | } |
| 273 | |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 274 | void MACvEnableProtectMD(struct vnt_private *pDevice) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 275 | { |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 276 | u8 pbyData[2]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 277 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 278 | pbyData[0] = EnCFG_ProtectMd; |
| 279 | pbyData[1] = EnCFG_ProtectMd; |
| 280 | |
| 281 | CONTROLnsRequestOut(pDevice, |
| 282 | MESSAGE_TYPE_WRITE_MASK, |
| 283 | MAC_REG_ENCFG0, |
| 284 | MESSAGE_REQUEST_MACREG, |
Malcolm Priestley | 13d8d89 | 2013-06-17 22:19:54 +0100 | [diff] [blame] | 285 | ARRAY_SIZE(pbyData), |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 286 | pbyData |
| 287 | ); |
| 288 | } |
| 289 | |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 290 | void MACvDisableProtectMD(struct vnt_private *pDevice) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 291 | { |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 292 | u8 pbyData[2]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 293 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 294 | pbyData[0] = 0; |
| 295 | pbyData[1] = EnCFG_ProtectMd; |
| 296 | |
| 297 | CONTROLnsRequestOut(pDevice, |
| 298 | MESSAGE_TYPE_WRITE_MASK, |
| 299 | MAC_REG_ENCFG0, |
| 300 | MESSAGE_REQUEST_MACREG, |
Malcolm Priestley | 13d8d89 | 2013-06-17 22:19:54 +0100 | [diff] [blame] | 301 | ARRAY_SIZE(pbyData), |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 302 | pbyData |
| 303 | ); |
| 304 | } |
| 305 | |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 306 | void MACvEnableBarkerPreambleMd(struct vnt_private *pDevice) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 307 | { |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 308 | u8 pbyData[2]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 309 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 310 | pbyData[0] = EnCFG_BarkerPream; |
| 311 | pbyData[1] = EnCFG_BarkerPream; |
| 312 | |
| 313 | CONTROLnsRequestOut(pDevice, |
| 314 | MESSAGE_TYPE_WRITE_MASK, |
| 315 | MAC_REG_ENCFG2, |
| 316 | MESSAGE_REQUEST_MACREG, |
Malcolm Priestley | 13d8d89 | 2013-06-17 22:19:54 +0100 | [diff] [blame] | 317 | ARRAY_SIZE(pbyData), |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 318 | pbyData |
| 319 | ); |
| 320 | } |
| 321 | |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 322 | void MACvDisableBarkerPreambleMd(struct vnt_private *pDevice) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 323 | { |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 324 | u8 pbyData[2]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 325 | |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 326 | pbyData[0] = 0; |
| 327 | pbyData[1] = EnCFG_BarkerPream; |
| 328 | |
| 329 | CONTROLnsRequestOut(pDevice, |
| 330 | MESSAGE_TYPE_WRITE_MASK, |
| 331 | MAC_REG_ENCFG2, |
| 332 | MESSAGE_REQUEST_MACREG, |
Malcolm Priestley | 13d8d89 | 2013-06-17 22:19:54 +0100 | [diff] [blame] | 333 | ARRAY_SIZE(pbyData), |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 334 | pbyData |
| 335 | ); |
| 336 | } |
| 337 | |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 338 | void MACvWriteBeaconInterval(struct vnt_private *pDevice, u16 wInterval) |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 339 | { |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 340 | u8 pbyData[2]; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 341 | |
Malcolm Priestley | 98583c0 | 2012-12-10 22:01:23 +0000 | [diff] [blame] | 342 | pbyData[0] = (u8)(wInterval & 0xff); |
| 343 | pbyData[1] = (u8)(wInterval >> 8); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 344 | |
| 345 | CONTROLnsRequestOut(pDevice, |
Clelia V. Korol | b411f12 | 2010-09-16 15:00:19 -0300 | [diff] [blame] | 346 | MESSAGE_TYPE_WRITE, |
| 347 | MAC_REG_BI, |
| 348 | MESSAGE_REQUEST_MACREG, |
Malcolm Priestley | 13d8d89 | 2013-06-17 22:19:54 +0100 | [diff] [blame] | 349 | ARRAY_SIZE(pbyData), |
Clelia V. Korol | b411f12 | 2010-09-16 15:00:19 -0300 | [diff] [blame] | 350 | pbyData |
| 351 | ); |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 352 | } |