#include <limits.h>
#include <stdio.h>
#include <stdbool.h>
#include <stddef.h>
#include <time.h>
#include <malloc.h>
#include <sys/pci.h>
#include <string.h>
#include <pthread.h>
#include <intr.h>
#include <sys/pio.h>
#include <sys/io.h>
#include <drivers/if_ether.h>
#include <stdint.h>
#include <math.h>
Go to the source code of this file.
Classes | |
struct | sk_buff |
Defines | |
#define | __devexit |
#define | __devinit |
#define | __iomem |
#define | __packed __attribute__((__packed__)) |
#define | __WARN() |
#define | ADDR BITOP_ADDR(addr) |
#define | ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
#define | BITOP_ADDR(x) "=m" (*(volatile long *) (x)) |
#define | BITS_PER_BYTE 8 |
#define | BITS_PER_LONG 32 |
#define | BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) |
#define | BUG() |
#define | BUG_ON(condition) do { if (condition) BUG(); } while(0) |
#define | BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) |
#define | cpu_to_le16(x) (u16)(x) |
#define | DECLARE_BITMAP(name, bits) unsigned long name[BITS_TO_LONGS(bits)] |
#define | dev_kfree_skb(a) dev_kfree_skb_any(a) |
#define | DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) |
#define | E2BIG 7 /* Argument list too long */ |
#define | EACCES 13 /* Permission denied */ |
#define | EAGAIN 11 /* Try again */ |
#define | EBADF 9 /* Bad file number */ |
#define | EBUSY 16 /* Device or resource busy */ |
#define | ECHILD 10 /* No child processes */ |
#define | EDOM 33 /* Math argument out of domain of func */ |
#define | EEXIST 17 /* File exists */ |
#define | EFAULT 14 /* Bad address */ |
#define | EFBIG 27 /* File too large */ |
#define | EINPROGRESS 115 /* Operation now in progress */ |
#define | EINTR 4 /* Interrupted system call */ |
#define | EINVAL 22 /* Invalid argument */ |
#define | EIO 5 /* I/O error */ |
#define | EISDIR 21 /* Is a directory */ |
#define | EMFILE 24 /* Too many open files */ |
#define | EMLINK 31 /* Too many links */ |
#define | ENFILE 23 /* File table overflow */ |
#define | ENODEV 19 /* No such device */ |
#define | ENOENT 2 /* No such file or directory */ |
#define | ENOEXEC 8 /* Exec format error */ |
#define | ENOMEM 12 /* Out of memory */ |
#define | ENOSPC 28 /* No space left on device */ |
#define | ENOTBLK 15 /* Block device required */ |
#define | ENOTDIR 20 /* Not a directory */ |
#define | ENOTSUPP 524 /* Operation is not supported */ |
#define | ENOTTY 25 /* Not a typewriter */ |
#define | ENXIO 6 /* No such device or address */ |
#define | EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ |
#define | EPERM 1 /* Operation not permitted */ |
#define | EPIPE 32 /* Broken pipe */ |
#define | ERANGE 34 /* Math result not representable */ |
#define | EROFS 30 /* Read-only file system */ |
#define | ERR_PTR(x) ((void *)(x)) |
#define | ESPIPE 29 /* Illegal seek */ |
#define | ESRCH 3 /* No such process */ |
#define | ETIMEDOUT 110 /* Connection timed out */ |
#define | ETXTBSY 26 /* Text file busy */ |
#define | EXDEV 18 /* Cross-device link */ |
#define | GFP_KERNEL |
#define | ioread32(addr) readl(addr) |
#define | iowrite32(val, addr) writel(val,addr) |
#define | IRQ_HANDLED POSIX_INTR_HANDLED_NOTIFY |
#define | IRQ_NONE POSIX_INTR_NOT_HANDLED |
#define | IS_ERR(x) ((unsigned long)(x) >= (unsigned long)-MAX_ERRNO) |
#define | kcalloc(elems, size, mode) calloc(elems,size) |
#define | KERN_ALERT |
#define | KERN_CRIT |
#define | KERN_DEBUG |
#define | KERN_EMERG |
#define | KERN_ERR |
#define | KERN_INFO |
#define | KERN_NOTICE |
#define | KERN_WARNING |
#define | kfree(x) free(x) |
#define | kmalloc(size, mode) malloc(size) |
#define | kzalloc(size, mode) malloc(size) |
#define | le16_to_cpu(x) (x) |
#define | likely(x) (x) |
#define | list_first_entry(ptr, type, member) list_entry((ptr)->next, type, member) |
#define | max(x, y) |
#define | MAX_ERRNO 4095 |
#define | mdelay(u) |
#define | min(x, y) |
#define | NETDEV_TX_BUSY 1 /* driver tx path was busy*/ |
#define | NETDEV_TX_OK 0 /* driver took care of packet */ |
#define | PCI_VENDOR_ID_ATHEROS 0x168c |
#define | printk printc |
#define | PTR_ERR(x) ((unsigned long)(x)) |
#define | roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) |
#define | test_bit(nr, addr) |
#define | udelay(u) |
#define | unlikely(x) (x) |
#define | WARN_ON(condition) |
Typedefs | |
typedef s16 | __le16 |
typedef s32 | __le32 |
typedef s64 | __le64 |
typedef s8 | __le8 |
typedef u16 | __u16 |
typedef u32 | __u32 |
typedef u64 | __u64 |
typedef u8 | __u8 |
typedef uintptr_t | dma_addr_t |
typedef int16_t | s16 |
typedef int32_t | s32 |
typedef int64_t | s64 |
typedef int8_t | s8 |
typedef uint16_t | u16 |
typedef uint32_t | u32 |
typedef uint64_t | u64 |
typedef uint8_t | u8 |
typedef unsigned int | u_int |
Functions | |
static void | __clear_bit (int nr, volatile unsigned long *addr) |
static void | __set_bit (int nr, volatile unsigned long *addr) |
static int | constant_test_bit (int nr, const volatile unsigned long *addr) |
static struct sk_buff * | dev_alloc_skb (unsigned int len) |
static void | dev_kfree_skb_any (struct sk_buff *skb) |
static int | fls (int x) |
static int | get_bitmask_order (unsigned int count) |
static int | ilog2 (unsigned int n) |
static void | skb_copy_from_linear_data (const struct sk_buff *skb, void *to, const unsigned int len) |
static void | skb_copy_from_linear_data_offset (const struct sk_buff *skb, const int offset, void *to, const unsigned int len) |
static void | skb_copy_to_linear_data (struct sk_buff *skb, const void *from, const unsigned int len) |
static void | skb_copy_to_linear_data_offset (struct sk_buff *skb, const int offset, const void *from, const unsigned int len) |
static unsigned int | skb_headroom (const struct sk_buff *skb) |
static unsigned char * | skb_pull (struct sk_buff *skb, unsigned int len) |
static unsigned char * | skb_push (struct sk_buff *skb, unsigned int len) |
static unsigned char * | skb_put (struct sk_buff *skb, int len) |
static void | skb_reserve (struct sk_buff *skb, int len) |
static int | skb_tailroom (const struct sk_buff *skb) |
static int | variable_test_bit (int nr, volatile const unsigned long *addr) |
#define __devexit |
Definition at line 88 of file ath5k_linux_layer.h.
#define __devinit |
Definition at line 87 of file ath5k_linux_layer.h.
#define __iomem |
Definition at line 86 of file ath5k_linux_layer.h.
struct ath5k_desc __packed __attribute__((__packed__)) |
Definition at line 85 of file ath5k_linux_layer.h.
#define __WARN | ( | ) |
do { \ printk("WARNING: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \ } while (0)
Definition at line 138 of file ath5k_linux_layer.h.
#define ADDR BITOP_ADDR(addr) |
Definition at line 161 of file ath5k_linux_layer.h.
#define ARRAY_SIZE | ( | x | ) | (sizeof(x) / sizeof((x)[0])) |
Definition at line 83 of file ath5k_linux_layer.h.
#define BITOP_ADDR | ( | x | ) | "=m" (*(volatile long *) (x)) |
Definition at line 160 of file ath5k_linux_layer.h.
#define BITS_PER_BYTE 8 |
Definition at line 234 of file ath5k_linux_layer.h.
#define BITS_PER_LONG 32 |
Definition at line 162 of file ath5k_linux_layer.h.
#define BITS_TO_LONGS | ( | nr | ) | DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) |
Definition at line 236 of file ath5k_linux_layer.h.
#define BUG | ( | ) |
do { \ printe("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \ } while (0)
Definition at line 129 of file ath5k_linux_layer.h.
Definition at line 133 of file ath5k_linux_layer.h.
#define BUILD_BUG_ON | ( | condition | ) | ((void)sizeof(char[1 - 2*!!(condition)])) |
Definition at line 136 of file ath5k_linux_layer.h.
#define cpu_to_le16 | ( | x | ) | (u16)(x) |
Definition at line 96 of file ath5k_linux_layer.h.
#define DECLARE_BITMAP | ( | name, | |
bits | |||
) | unsigned long name[BITS_TO_LONGS(bits)] |
Definition at line 237 of file ath5k_linux_layer.h.
#define dev_kfree_skb | ( | a | ) | dev_kfree_skb_any(a) |
Definition at line 369 of file ath5k_linux_layer.h.
Definition at line 235 of file ath5k_linux_layer.h.
#define E2BIG 7 /* Argument list too long */ |
Definition at line 294 of file ath5k_linux_layer.h.
#define EACCES 13 /* Permission denied */ |
Definition at line 300 of file ath5k_linux_layer.h.
#define EAGAIN 11 /* Try again */ |
Definition at line 298 of file ath5k_linux_layer.h.
#define EBADF 9 /* Bad file number */ |
Definition at line 296 of file ath5k_linux_layer.h.
#define EBUSY 16 /* Device or resource busy */ |
Definition at line 303 of file ath5k_linux_layer.h.
#define ECHILD 10 /* No child processes */ |
Definition at line 297 of file ath5k_linux_layer.h.
#define EDOM 33 /* Math argument out of domain of func */ |
Definition at line 320 of file ath5k_linux_layer.h.
Definition at line 304 of file ath5k_linux_layer.h.
#define EFAULT 14 /* Bad address */ |
Definition at line 301 of file ath5k_linux_layer.h.
#define EFBIG 27 /* File too large */ |
Definition at line 314 of file ath5k_linux_layer.h.
#define EINPROGRESS 115 /* Operation now in progress */ |
Definition at line 324 of file ath5k_linux_layer.h.
Definition at line 291 of file ath5k_linux_layer.h.
#define EINVAL 22 /* Invalid argument */ |
Definition at line 309 of file ath5k_linux_layer.h.
#define EIO 5 /* I/O error */ |
Definition at line 292 of file ath5k_linux_layer.h.
Definition at line 308 of file ath5k_linux_layer.h.
#define EMFILE 24 /* Too many open files */ |
Definition at line 311 of file ath5k_linux_layer.h.
#define EMLINK 31 /* Too many links */ |
Definition at line 318 of file ath5k_linux_layer.h.
#define ENFILE 23 /* File table overflow */ |
Definition at line 310 of file ath5k_linux_layer.h.
#define ENODEV 19 /* No such device */ |
Definition at line 306 of file ath5k_linux_layer.h.
Definition at line 289 of file ath5k_linux_layer.h.
#define ENOEXEC 8 /* Exec format error */ |
Definition at line 295 of file ath5k_linux_layer.h.
Definition at line 299 of file ath5k_linux_layer.h.
#define ENOSPC 28 /* No space left on device */ |
Definition at line 315 of file ath5k_linux_layer.h.
#define ENOTBLK 15 /* Block device required */ |
Definition at line 302 of file ath5k_linux_layer.h.
Definition at line 307 of file ath5k_linux_layer.h.
#define ENOTSUPP 524 /* Operation is not supported */ |
Definition at line 325 of file ath5k_linux_layer.h.
#define ENOTTY 25 /* Not a typewriter */ |
Definition at line 312 of file ath5k_linux_layer.h.
#define ENXIO 6 /* No such device or address */ |
Definition at line 293 of file ath5k_linux_layer.h.
#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ |
Definition at line 322 of file ath5k_linux_layer.h.
#define EPERM 1 /* Operation not permitted */ |
Definition at line 288 of file ath5k_linux_layer.h.
#define EPIPE 32 /* Broken pipe */ |
Definition at line 319 of file ath5k_linux_layer.h.
#define ERANGE 34 /* Math result not representable */ |
Definition at line 321 of file ath5k_linux_layer.h.
Definition at line 317 of file ath5k_linux_layer.h.
#define ERR_PTR | ( | x | ) | ((void *)(x)) |
Definition at line 332 of file ath5k_linux_layer.h.
#define ESPIPE 29 /* Illegal seek */ |
Definition at line 316 of file ath5k_linux_layer.h.
#define ESRCH 3 /* No such process */ |
Definition at line 290 of file ath5k_linux_layer.h.
#define ETIMEDOUT 110 /* Connection timed out */ |
Definition at line 323 of file ath5k_linux_layer.h.
#define ETXTBSY 26 /* Text file busy */ |
Definition at line 313 of file ath5k_linux_layer.h.
#define EXDEV 18 /* Cross-device link */ |
Definition at line 305 of file ath5k_linux_layer.h.
#define GFP_KERNEL |
Definition at line 102 of file ath5k_linux_layer.h.
#define ioread32 | ( | addr | ) | readl(addr) |
Definition at line 111 of file ath5k_linux_layer.h.
Definition at line 112 of file ath5k_linux_layer.h.
#define IRQ_HANDLED POSIX_INTR_HANDLED_NOTIFY |
Definition at line 154 of file ath5k_linux_layer.h.
#define IRQ_NONE POSIX_INTR_NOT_HANDLED |
Definition at line 153 of file ath5k_linux_layer.h.
Definition at line 330 of file ath5k_linux_layer.h.
Definition at line 105 of file ath5k_linux_layer.h.
#define KERN_ALERT |
Definition at line 121 of file ath5k_linux_layer.h.
#define KERN_CRIT |
Definition at line 122 of file ath5k_linux_layer.h.
#define KERN_DEBUG |
Definition at line 126 of file ath5k_linux_layer.h.
#define KERN_EMERG |
Definition at line 120 of file ath5k_linux_layer.h.
#define KERN_ERR |
Definition at line 119 of file ath5k_linux_layer.h.
#define KERN_INFO |
Definition at line 125 of file ath5k_linux_layer.h.
#define KERN_NOTICE |
Definition at line 124 of file ath5k_linux_layer.h.
#define KERN_WARNING |
Definition at line 123 of file ath5k_linux_layer.h.
#define kfree | ( | x | ) | free(x) |
Definition at line 106 of file ath5k_linux_layer.h.
Definition at line 104 of file ath5k_linux_layer.h.
Definition at line 103 of file ath5k_linux_layer.h.
#define le16_to_cpu | ( | x | ) | (x) |
Definition at line 97 of file ath5k_linux_layer.h.
#define likely | ( | x | ) | (x) |
Definition at line 90 of file ath5k_linux_layer.h.
#define list_first_entry | ( | ptr, | |
type, | |||
member | |||
) | list_entry((ptr)->next, type, member) |
Definition at line 459 of file ath5k_linux_layer.h.
#define max | ( | x, | |
y | |||
) |
({ \
typeof(x) _max1 = (x); \
typeof(y) _max2 = (y); \
(void) (&_max1 == &_max2); \
_max1 > _max2 ? _max1 : _max2; })
Definition at line 245 of file ath5k_linux_layer.h.
#define MAX_ERRNO 4095 |
Definition at line 326 of file ath5k_linux_layer.h.
#define mdelay | ( | u | ) |
do { \ struct timespec ts = {0, u*1000*1000}; \ nanosleep (&ts, NULL); \ } while (0);
Definition at line 279 of file ath5k_linux_layer.h.
#define min | ( | x, | |
y | |||
) |
({ \
typeof(x) _min1 = (x); \
typeof(y) _min2 = (y); \
(void) (&_min1 == &_min2); \
_min1 < _min2 ? _min1 : _min2; })
Definition at line 250 of file ath5k_linux_layer.h.
#define NETDEV_TX_BUSY 1 /* driver tx path was busy*/ |
Definition at line 327 of file ath5k_linux_layer.h.
#define NETDEV_TX_OK 0 /* driver took care of packet */ |
Definition at line 328 of file ath5k_linux_layer.h.
#define PCI_VENDOR_ID_ATHEROS 0x168c |
Definition at line 54 of file ath5k_linux_layer.h.
#define printk printc |
Definition at line 117 of file ath5k_linux_layer.h.
#define PTR_ERR | ( | x | ) | ((unsigned long)(x)) |
Definition at line 331 of file ath5k_linux_layer.h.
#define roundup | ( | x, | |
y | |||
) | ((((x) + ((y) - 1)) / (y)) * (y)) |
Definition at line 244 of file ath5k_linux_layer.h.
#define test_bit | ( | nr, | |
addr | |||
) |
(__builtin_constant_p((nr)) \ ? constant_test_bit((nr), (addr)) \ : variable_test_bit((nr), (addr)))
Definition at line 229 of file ath5k_linux_layer.h.
#define udelay | ( | u | ) |
do { \ struct timespec ts = {0, u*1000}; \ nanosleep (&ts, NULL); \ } while (0);
Definition at line 274 of file ath5k_linux_layer.h.
#define unlikely | ( | x | ) | (x) |
Definition at line 91 of file ath5k_linux_layer.h.
#define WARN_ON | ( | condition | ) |
({ \ int __ret_warn_on = !!(condition); \ if (unlikely(__ret_warn_on)) \ __WARN(); \ unlikely(__ret_warn_on); \ })
Definition at line 142 of file ath5k_linux_layer.h.
Definition at line 70 of file ath5k_linux_layer.h.
Definition at line 71 of file ath5k_linux_layer.h.
Definition at line 72 of file ath5k_linux_layer.h.
Definition at line 69 of file ath5k_linux_layer.h.
Definition at line 74 of file ath5k_linux_layer.h.
Definition at line 75 of file ath5k_linux_layer.h.
Definition at line 76 of file ath5k_linux_layer.h.
Definition at line 73 of file ath5k_linux_layer.h.
typedef uintptr_t dma_addr_t |
Definition at line 68 of file ath5k_linux_layer.h.
typedef int16_t s16 |
Definition at line 66 of file ath5k_linux_layer.h.
typedef int32_t s32 |
Definition at line 65 of file ath5k_linux_layer.h.
typedef int64_t s64 |
Definition at line 64 of file ath5k_linux_layer.h.
typedef int8_t s8 |
Definition at line 67 of file ath5k_linux_layer.h.
typedef uint16_t u16 |
Definition at line 62 of file ath5k_linux_layer.h.
typedef uint32_t u32 |
Definition at line 61 of file ath5k_linux_layer.h.
typedef uint64_t u64 |
Definition at line 60 of file ath5k_linux_layer.h.
typedef uint8_t u8 |
Definition at line 63 of file ath5k_linux_layer.h.
typedef unsigned int u_int |
Definition at line 78 of file ath5k_linux_layer.h.
static void __clear_bit | ( | int | nr, |
volatile unsigned long * | addr | ||
) | [inline, static] |
Definition at line 198 of file ath5k_linux_layer.h.
static void __set_bit | ( | int | nr, |
volatile unsigned long * | addr | ||
) | [inline, static] |
Definition at line 193 of file ath5k_linux_layer.h.
static int constant_test_bit | ( | int | nr, |
const volatile unsigned long * | addr | ||
) | [inline, static] |
Definition at line 211 of file ath5k_linux_layer.h.
static struct sk_buff* dev_alloc_skb | ( | unsigned int | len | ) | [static, read] |
Definition at line 349 of file ath5k_linux_layer.h.
static void dev_kfree_skb_any | ( | struct sk_buff * | skb | ) | [inline, static] |
Definition at line 371 of file ath5k_linux_layer.h.
static int fls | ( | int | x | ) | [inline, static] |
Definition at line 164 of file ath5k_linux_layer.h.
static int get_bitmask_order | ( | unsigned int | count | ) | [inline, static] |
Definition at line 203 of file ath5k_linux_layer.h.
static int ilog2 | ( | unsigned int | n | ) | [inline, static] |
Returns the floor form of binary logarithm for a 32 bit integer. -1 is returned if n is 0.
Definition at line 260 of file ath5k_linux_layer.h.
static void skb_copy_from_linear_data | ( | const struct sk_buff * | skb, |
void * | to, | ||
const unsigned int | len | ||
) | [inline, static] |
Definition at line 426 of file ath5k_linux_layer.h.
static void skb_copy_from_linear_data_offset | ( | const struct sk_buff * | skb, |
const int | offset, | ||
void * | to, | ||
const unsigned int | len | ||
) | [inline, static] |
Definition at line 433 of file ath5k_linux_layer.h.
static void skb_copy_to_linear_data | ( | struct sk_buff * | skb, |
const void * | from, | ||
const unsigned int | len | ||
) | [inline, static] |
Definition at line 440 of file ath5k_linux_layer.h.
static void skb_copy_to_linear_data_offset | ( | struct sk_buff * | skb, |
const int | offset, | ||
const void * | from, | ||
const unsigned int | len | ||
) | [inline, static] |
Definition at line 447 of file ath5k_linux_layer.h.
static unsigned int skb_headroom | ( | const struct sk_buff * | skb | ) | [inline, static] |
Definition at line 400 of file ath5k_linux_layer.h.
Definition at line 405 of file ath5k_linux_layer.h.
Definition at line 416 of file ath5k_linux_layer.h.
Definition at line 379 of file ath5k_linux_layer.h.
static void skb_reserve | ( | struct sk_buff * | skb, |
int | len | ||
) | [inline, static] |
Definition at line 389 of file ath5k_linux_layer.h.
static int skb_tailroom | ( | const struct sk_buff * | skb | ) | [inline, static] |
Definition at line 395 of file ath5k_linux_layer.h.
static int variable_test_bit | ( | int | nr, |
volatile const unsigned long * | addr | ||
) | [inline, static] |
Definition at line 217 of file ath5k_linux_layer.h.