diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
| commit | fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch) | |
| tree | a57612d1888735a2ec7972891b68c1ac5ec8faea /drivers/net/bna/cna.h | |
| parent | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff) | |
Diffstat (limited to 'drivers/net/bna/cna.h')
| -rw-r--r-- | drivers/net/bna/cna.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/drivers/net/bna/cna.h b/drivers/net/bna/cna.h new file mode 100644 index 00000000000..a679e038747 --- /dev/null +++ b/drivers/net/bna/cna.h | |||
| @@ -0,0 +1,80 @@ | |||
| 1 | /* | ||
| 2 | * Linux network driver for Brocade Converged Network Adapter. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify it | ||
| 5 | * under the terms of the GNU General Public License (GPL) Version 2 as | ||
| 6 | * published by the Free Software Foundation | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, but | ||
| 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 11 | * General Public License for more details. | ||
| 12 | */ | ||
| 13 | /* | ||
| 14 | * Copyright (c) 2006-2010 Brocade Communications Systems, Inc. | ||
| 15 | * All rights reserved | ||
| 16 | * www.brocade.com | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef __CNA_H__ | ||
| 20 | #define __CNA_H__ | ||
| 21 | |||
| 22 | #include <linux/kernel.h> | ||
| 23 | #include <linux/types.h> | ||
| 24 | #include <linux/pci.h> | ||
| 25 | #include <linux/delay.h> | ||
| 26 | #include <linux/bitops.h> | ||
| 27 | #include <linux/timer.h> | ||
| 28 | #include <linux/interrupt.h> | ||
| 29 | #include <linux/if_ether.h> | ||
| 30 | #include <asm/page.h> | ||
| 31 | #include <asm/io.h> | ||
| 32 | #include <asm/string.h> | ||
| 33 | |||
| 34 | #include <linux/list.h> | ||
| 35 | |||
| 36 | #define bfa_sm_fault(__event) do { \ | ||
| 37 | pr_err("SM Assertion failure: %s: %d: event = %d", __FILE__, __LINE__, \ | ||
| 38 | __event); \ | ||
| 39 | } while (0) | ||
| 40 | |||
| 41 | extern char bfa_version[]; | ||
| 42 | |||
| 43 | #define CNA_FW_FILE_CT "ctfw_cna.bin" | ||
| 44 | #define FC_SYMNAME_MAX 256 /*!< max name server symbolic name size */ | ||
| 45 | |||
| 46 | #pragma pack(1) | ||
| 47 | |||
| 48 | #define MAC_ADDRLEN (6) | ||
| 49 | typedef struct mac { u8 mac[MAC_ADDRLEN]; } mac_t; | ||
| 50 | |||
| 51 | #pragma pack() | ||
| 52 | |||
| 53 | #define bfa_q_first(_q) ((void *)(((struct list_head *) (_q))->next)) | ||
| 54 | #define bfa_q_next(_qe) (((struct list_head *) (_qe))->next) | ||
| 55 | #define bfa_q_prev(_qe) (((struct list_head *) (_qe))->prev) | ||
| 56 | |||
| 57 | /* | ||
| 58 | * bfa_q_qe_init - to initialize a queue element | ||
| 59 | */ | ||
| 60 | #define bfa_q_qe_init(_qe) { \ | ||
| 61 | bfa_q_next(_qe) = (struct list_head *) NULL; \ | ||
| 62 | bfa_q_prev(_qe) = (struct list_head *) NULL; \ | ||
| 63 | } | ||
| 64 | |||
| 65 | /* | ||
| 66 | * bfa_q_deq - dequeue an element from head of the queue | ||
| 67 | */ | ||
| 68 | #define bfa_q_deq(_q, _qe) { \ | ||
| 69 | if (!list_empty(_q)) { \ | ||
| 70 | (*((struct list_head **) (_qe))) = bfa_q_next(_q); \ | ||
| 71 | bfa_q_prev(bfa_q_next(*((struct list_head **) _qe))) = \ | ||
| 72 | (struct list_head *) (_q); \ | ||
| 73 | bfa_q_next(_q) = bfa_q_next(*((struct list_head **) _qe)); \ | ||
| 74 | bfa_q_qe_init(*((struct list_head **) _qe)); \ | ||
| 75 | } else { \ | ||
| 76 | *((struct list_head **)(_qe)) = NULL; \ | ||
| 77 | } \ | ||
| 78 | } | ||
| 79 | |||
| 80 | #endif /* __CNA_H__ */ | ||
