OLD | NEW |
1 //------------------------------------------------------------------------------ | 1 //------------------------------------------------------------------------------ |
2 // <copyright file="hif.h" company="Atheros"> | 2 // <copyright file="hif.h" company="Atheros"> |
3 // Copyright (c) 2004-2008 Atheros Corporation. All rights reserved. | 3 // Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. |
4 // | 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 version 2 as | |
7 // published by the Free Software Foundation; | |
8 // | 5 // |
9 // Software distributed under the License is distributed on an "AS | 6 // Permission to use, copy, modify, and/or distribute this software for any |
10 // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or | 7 // purpose with or without fee is hereby granted, provided that the above |
11 // implied. See the License for the specific language governing | 8 // copyright notice and this permission notice appear in all copies. |
12 // rights and limitations under the License. | 9 // |
| 10 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 11 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 12 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 13 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 14 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 15 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 16 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
13 // | 17 // |
14 // | 18 // |
15 //------------------------------------------------------------------------------ | 19 //------------------------------------------------------------------------------ |
16 //============================================================================== | 20 //============================================================================== |
17 // HIF specific declarations and prototypes | 21 // HIF specific declarations and prototypes |
18 // | 22 // |
19 // Author(s): ="Atheros" | 23 // Author(s): ="Atheros" |
20 //============================================================================== | 24 //============================================================================== |
21 #ifndef _HIF_H_ | 25 #ifndef _HIF_H_ |
22 #define _HIF_H_ | 26 #define _HIF_H_ |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 * | 223 * |
220 */ | 224 */ |
221 | 225 |
222 typedef struct { | 226 typedef struct { |
223 A_UINT32 ExtendedAddress; /* extended address for larger writes */ | 227 A_UINT32 ExtendedAddress; /* extended address for larger writes */ |
224 A_UINT32 ExtendedSize; | 228 A_UINT32 ExtendedSize; |
225 } HIF_MBOX_PROPERTIES; | 229 } HIF_MBOX_PROPERTIES; |
226 | 230 |
227 #define HIF_MBOX_FLAG_NO_BUNDLING (1 << 0) /* do not allow bundling over the
mailbox */ | 231 #define HIF_MBOX_FLAG_NO_BUNDLING (1 << 0) /* do not allow bundling over the
mailbox */ |
228 | 232 |
| 233 typedef enum _MBOX_BUF_IF_TYPE { |
| 234 MBOX_BUS_IF_SDIO = 0, |
| 235 MBOX_BUS_IF_SPI = 1, |
| 236 } MBOX_BUF_IF_TYPE; |
| 237 |
229 typedef struct { | 238 typedef struct { |
230 A_UINT32 MboxAddresses[4]; /* must be first element for legacy HIFs that re
turn the address in | 239 A_UINT32 MboxAddresses[4]; /* must be first element for legacy HIFs that re
turn the address in |
231 and ARRAY of 32-bit words */ | 240 and ARRAY of 32-bit words */ |
232 | 241 |
233 /* the following describe extended mailbox properties */ | 242 /* the following describe extended mailbox properties */ |
234 HIF_MBOX_PROPERTIES MboxProp[4]; | 243 HIF_MBOX_PROPERTIES MboxProp[4]; |
235 /* if the HIF supports the GMbox extended address region it can report i
t | 244 /* if the HIF supports the GMbox extended address region it can report i
t |
236 * here, some interfaces cannot support the GMBOX address range and not
set this */ | 245 * here, some interfaces cannot support the GMBOX address range and not
set this */ |
237 A_UINT32 GMboxAddress; | 246 A_UINT32 GMboxAddress; |
238 A_UINT32 GMboxSize; | 247 A_UINT32 GMboxSize; |
239 A_UINT32 Flags; /* flags to describe mbox behavior or usage */ | 248 A_UINT32 Flags; /* flags to describe mbox behavior or usage */ |
| 249 MBOX_BUF_IF_TYPE MboxBusIFType; /* mailbox bus interface type */ |
240 } HIF_DEVICE_MBOX_INFO; | 250 } HIF_DEVICE_MBOX_INFO; |
241 | 251 |
242 typedef enum { | 252 typedef enum { |
243 HIF_DEVICE_IRQ_SYNC_ONLY, /* for HIF implementations that require the DSR
to process all | 253 HIF_DEVICE_IRQ_SYNC_ONLY, /* for HIF implementations that require the DSR
to process all |
244 interrupts before returning */ | 254 interrupts before returning */ |
245 HIF_DEVICE_IRQ_ASYNC_SYNC, /* for HIF implementations that allow DSR to pro
cess interrupts | 255 HIF_DEVICE_IRQ_ASYNC_SYNC, /* for HIF implementations that allow DSR to pro
cess interrupts |
246 using ASYNC I/O (that is HIFAckInterrupt can
be called at a | 256 using ASYNC I/O (that is HIFAckInterrupt can
be called at a |
247 later time */ | 257 later time */ |
248 } HIF_DEVICE_IRQ_PROCESSING_MODE; | 258 } HIF_DEVICE_IRQ_PROCESSING_MODE; |
249 | 259 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 }; | 329 }; |
320 | 330 |
321 typedef struct osdrv_callbacks { | 331 typedef struct osdrv_callbacks { |
322 void *context; /* context to pass for all callbacks except deviceRe
movedHandler | 332 void *context; /* context to pass for all callbacks except deviceRe
movedHandler |
323 the deviceRemovedHandler is only called if the de
vice is claimed */ | 333 the deviceRemovedHandler is only called if the de
vice is claimed */ |
324 A_STATUS (* deviceInsertedHandler)(void *context, void *hif_handle); | 334 A_STATUS (* deviceInsertedHandler)(void *context, void *hif_handle); |
325 A_STATUS (* deviceRemovedHandler)(void *claimedContext, void *hif_handle); | 335 A_STATUS (* deviceRemovedHandler)(void *claimedContext, void *hif_handle); |
326 A_STATUS (* deviceSuspendHandler)(void *context); | 336 A_STATUS (* deviceSuspendHandler)(void *context); |
327 A_STATUS (* deviceResumeHandler)(void *context); | 337 A_STATUS (* deviceResumeHandler)(void *context); |
328 A_STATUS (* deviceWakeupHandler)(void *context); | 338 A_STATUS (* deviceWakeupHandler)(void *context); |
| 339 A_STATUS (* devicePowerChangeHandler)(void *context, HIF_DEVICE_POWER_CHANGE
_TYPE config); |
329 } OSDRV_CALLBACKS; | 340 } OSDRV_CALLBACKS; |
330 | 341 |
331 #define HIF_OTHER_EVENTS (1 << 0) /* other interrupts (non-Recv) are pendi
ng, host | 342 #define HIF_OTHER_EVENTS (1 << 0) /* other interrupts (non-Recv) are pendi
ng, host |
332 needs to read the register table to f
igure out what */ | 343 needs to read the register table to f
igure out what */ |
333 #define HIF_RECV_MSG_AVAIL (1 << 1) /* pending recv packet */ | 344 #define HIF_RECV_MSG_AVAIL (1 << 1) /* pending recv packet */ |
334 | 345 |
335 typedef struct _HIF_PENDING_EVENTS_INFO { | 346 typedef struct _HIF_PENDING_EVENTS_INFO { |
336 A_UINT32 Events; | 347 A_UINT32 Events; |
337 A_UINT32 LookAhead; | 348 A_UINT32 LookAhead; |
338 A_UINT32 AvailableRecvBytes; | 349 A_UINT32 AvailableRecvBytes; |
| 350 #ifdef THREAD_X |
| 351 A_UINT32 Polling; |
| 352 A_UINT32 INT_CAUSE_REG; |
| 353 #endif |
339 } HIF_PENDING_EVENTS_INFO; | 354 } HIF_PENDING_EVENTS_INFO; |
340 | 355 |
341 /* function to get pending events , some HIF modules use special mechanisms | 356 /* function to get pending events , some HIF modules use special mechanisms |
342 * to detect packet available and other interrupts */ | 357 * to detect packet available and other interrupts */ |
343 typedef A_STATUS ( *HIF_PENDING_EVENTS_FUNC)(HIF_DEVICE *device, | 358 typedef A_STATUS ( *HIF_PENDING_EVENTS_FUNC)(HIF_DEVICE *device, |
344 HIF_PENDING_EVENTS_INFO *pEvents, | 359 HIF_PENDING_EVENTS_INFO *pEvents, |
345 void *AsyncConte
xt); | 360 void *AsyncConte
xt); |
346 | 361 |
347 #define HIF_MASK_RECV TRUE | 362 #define HIF_MASK_RECV TRUE |
348 #define HIF_UNMASK_RECV FALSE | 363 #define HIF_UNMASK_RECV FALSE |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 * the previous interrupt request has been serviced and the all the relevant | 417 * the previous interrupt request has been serviced and the all the relevant |
403 * sources have been cleared. HTC is ready to process more interrupts. | 418 * sources have been cleared. HTC is ready to process more interrupts. |
404 * This should prevent the bus driver from raising an interrupt unless the | 419 * This should prevent the bus driver from raising an interrupt unless the |
405 * previous one has been serviced and acknowledged using the previous API. | 420 * previous one has been serviced and acknowledged using the previous API. |
406 */ | 421 */ |
407 void HIFAckInterrupt(HIF_DEVICE *device); | 422 void HIFAckInterrupt(HIF_DEVICE *device); |
408 | 423 |
409 void HIFMaskInterrupt(HIF_DEVICE *device); | 424 void HIFMaskInterrupt(HIF_DEVICE *device); |
410 | 425 |
411 void HIFUnMaskInterrupt(HIF_DEVICE *device); | 426 void HIFUnMaskInterrupt(HIF_DEVICE *device); |
| 427 |
| 428 #ifdef THREAD_X |
| 429 /* |
| 430 * This set of functions are to be used by the bus driver to notify |
| 431 * the HIF module about various events. |
| 432 * These are not implemented if the bus driver provides an alternative |
| 433 * way for this notification though callbacks for instance. |
| 434 */ |
| 435 int HIFInsertEventNotify(void); |
| 436 |
| 437 int HIFRemoveEventNotify(void); |
| 438 |
| 439 int HIFIRQEventNotify(void); |
| 440 |
| 441 int HIFRWCompleteEventNotify(void); |
| 442 #endif |
412 | 443 |
413 A_STATUS | 444 A_STATUS |
414 HIFConfigureDevice(HIF_DEVICE *device, HIF_DEVICE_CONFIG_OPCODE opcode, | 445 HIFConfigureDevice(HIF_DEVICE *device, HIF_DEVICE_CONFIG_OPCODE opcode, |
415 void *config, A_UINT32 configLen); | 446 void *config, A_UINT32 configLen); |
416 | 447 |
| 448 /* |
| 449 * This API wait for the remaining MBOX messages to be drained |
| 450 * This should be moved to HTC AR6K layer |
| 451 */ |
| 452 A_STATUS hifWaitForPendingRecv(HIF_DEVICE *device); |
| 453 |
417 #ifdef __cplusplus | 454 #ifdef __cplusplus |
418 } | 455 } |
419 #endif | 456 #endif |
420 | 457 |
421 #endif /* _HIF_H_ */ | 458 #endif /* _HIF_H_ */ |
OLD | NEW |