diff options
author | Ron Mercer <ron.mercer@qlogic.com> | 2009-06-10 11:49:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-11 05:37:05 -0400 |
commit | b8facca01ba381c3f8ff2391fbe3860ebc6a6bdc (patch) | |
tree | 11e7b481ab9436d5cbaf616101b46aa67cb4bc36 /drivers/net/qlge/qlge.h | |
parent | 88c55e3cbd1bd4e8f52dcda67456763710a025a5 (diff) |
qlge: Allow RX buf rings to be > than 4096 bytes.
RX buffer rings can be comprised of non-contiguous fixed
size chunks of memory. The ring is given to the hardware
as a pointer to a location that stores the location of
the queue. If the queue is greater than 4096 bytes then
the hardware gets a list of said pointers.
This patch addes the necessary logic to generate the list if
the queue size exceeds 4096.
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlge/qlge.h')
-rw-r--r-- | drivers/net/qlge/qlge.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h index b1ddfd1b8d53..156e02e8905d 100644 --- a/drivers/net/qlge/qlge.h +++ b/drivers/net/qlge/qlge.h | |||
@@ -41,7 +41,18 @@ | |||
41 | 41 | ||
42 | #define NUM_SMALL_BUFFERS 512 | 42 | #define NUM_SMALL_BUFFERS 512 |
43 | #define NUM_LARGE_BUFFERS 512 | 43 | #define NUM_LARGE_BUFFERS 512 |
44 | #define DB_PAGE_SIZE 4096 | ||
45 | |||
46 | /* Calculate the number of (4k) pages required to | ||
47 | * contain a buffer queue of the given length. | ||
48 | */ | ||
49 | #define MAX_DB_PAGES_PER_BQ(x) \ | ||
50 | (((x * sizeof(u64)) / DB_PAGE_SIZE) + \ | ||
51 | (((x * sizeof(u64)) % DB_PAGE_SIZE) ? 1 : 0)) | ||
44 | 52 | ||
53 | #define RX_RING_SHADOW_SPACE (sizeof(u64) + \ | ||
54 | MAX_DB_PAGES_PER_BQ(NUM_SMALL_BUFFERS) * sizeof(u64) + \ | ||
55 | MAX_DB_PAGES_PER_BQ(NUM_LARGE_BUFFERS) * sizeof(u64)) | ||
45 | #define SMALL_BUFFER_SIZE 256 | 56 | #define SMALL_BUFFER_SIZE 256 |
46 | #define LARGE_BUFFER_SIZE PAGE_SIZE | 57 | #define LARGE_BUFFER_SIZE PAGE_SIZE |
47 | #define MAX_SPLIT_SIZE 1023 | 58 | #define MAX_SPLIT_SIZE 1023 |
@@ -65,8 +76,6 @@ | |||
65 | #define TX_DESC_PER_OAL 0 | 76 | #define TX_DESC_PER_OAL 0 |
66 | #endif | 77 | #endif |
67 | 78 | ||
68 | #define DB_PAGE_SIZE 4096 | ||
69 | |||
70 | /* MPI test register definitions. This register | 79 | /* MPI test register definitions. This register |
71 | * is used for determining alternate NIC function's | 80 | * is used for determining alternate NIC function's |
72 | * PCI->func number. | 81 | * PCI->func number. |