diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-22 22:22:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-22 22:22:33 -0400 |
commit | f09cc910fe3af7e63298105bc0482653eb534c3c (patch) | |
tree | a09dca8a3d033352edff6cb1d911f3cd0e980f1f /drivers/net/niu.c | |
parent | 8b0eaccab4584ace24d233214bfee3cb50e49a60 (diff) | |
parent | ea2c47b42f12dadbad9d879fb6df102b9003ab82 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (30 commits)
[IPSEC] IPV6: Fix to add tunnel mode SA correctly.
[NET]: Cut off the queue_mapping field from sk_buff
[NET]: Hide the queue_mapping field inside netif_subqueue_stopped
[NET]: Make and use skb_get_queue_mapping
[NET]: Use the skb_set_queue_mapping where appropriate
[INET]: Use MODULE_ALIAS_NET_PF_PROTO_TYPE where possible.
[INET]: Let inet_diag and friends autoload
[NIU]: Cleanup PAGE_SIZE checks a bit
[NET]: Fix SKB_WITH_OVERHEAD calculation
[ATM]: Fix clip module reload crash.
[TG3]: Update version to 3.85
[TG3]: PCI command adjustment
[TG3]: Add management FW version to ethtool report
[TG3]: Add 5723 support
[Bluetooth] Convert RFCOMM to use kthread API
[Bluetooth] Add constant for Bluetooth socket options level
[Bluetooth] Add support for handling simple eSCO links
[Bluetooth] Add address and channel attribute to RFCOMM TTY device
[Bluetooth] Fix wrong argument in debug code of HIDP
[Bluetooth] Add generic driver for Bluetooth USB devices
...
Diffstat (limited to 'drivers/net/niu.c')
-rw-r--r-- | drivers/net/niu.c | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index ed1f9bbb2a32..112ab079ce7d 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -3103,31 +3103,12 @@ static int niu_alloc_tx_ring_info(struct niu *np, | |||
3103 | 3103 | ||
3104 | static void niu_size_rbr(struct niu *np, struct rx_ring_info *rp) | 3104 | static void niu_size_rbr(struct niu *np, struct rx_ring_info *rp) |
3105 | { | 3105 | { |
3106 | u16 bs; | 3106 | u16 bss; |
3107 | 3107 | ||
3108 | switch (PAGE_SIZE) { | 3108 | bss = min(PAGE_SHIFT, 15); |
3109 | case 4 * 1024: | ||
3110 | case 8 * 1024: | ||
3111 | case 16 * 1024: | ||
3112 | case 32 * 1024: | ||
3113 | rp->rbr_block_size = PAGE_SIZE; | ||
3114 | rp->rbr_blocks_per_page = 1; | ||
3115 | break; | ||
3116 | 3109 | ||
3117 | default: | 3110 | rp->rbr_block_size = 1 << bss; |
3118 | if (PAGE_SIZE % (32 * 1024) == 0) | 3111 | rp->rbr_blocks_per_page = 1 << (PAGE_SHIFT-bss); |
3119 | bs = 32 * 1024; | ||
3120 | else if (PAGE_SIZE % (16 * 1024) == 0) | ||
3121 | bs = 16 * 1024; | ||
3122 | else if (PAGE_SIZE % (8 * 1024) == 0) | ||
3123 | bs = 8 * 1024; | ||
3124 | else if (PAGE_SIZE % (4 * 1024) == 0) | ||
3125 | bs = 4 * 1024; | ||
3126 | else | ||
3127 | BUG(); | ||
3128 | rp->rbr_block_size = bs; | ||
3129 | rp->rbr_blocks_per_page = PAGE_SIZE / bs; | ||
3130 | } | ||
3131 | 3112 | ||
3132 | rp->rbr_sizes[0] = 256; | 3113 | rp->rbr_sizes[0] = 256; |
3133 | rp->rbr_sizes[1] = 1024; | 3114 | rp->rbr_sizes[1] = 1024; |
@@ -7902,12 +7883,7 @@ static int __init niu_init(void) | |||
7902 | { | 7883 | { |
7903 | int err = 0; | 7884 | int err = 0; |
7904 | 7885 | ||
7905 | BUILD_BUG_ON((PAGE_SIZE < 4 * 1024) || | 7886 | BUILD_BUG_ON(PAGE_SIZE < 4 * 1024); |
7906 | ((PAGE_SIZE > 32 * 1024) && | ||
7907 | ((PAGE_SIZE % (32 * 1024)) != 0 && | ||
7908 | (PAGE_SIZE % (16 * 1024)) != 0 && | ||
7909 | (PAGE_SIZE % (8 * 1024)) != 0 && | ||
7910 | (PAGE_SIZE % (4 * 1024)) != 0))); | ||
7911 | 7887 | ||
7912 | niu_debug = netif_msg_init(debug, NIU_MSG_DEFAULT); | 7888 | niu_debug = netif_msg_init(debug, NIU_MSG_DEFAULT); |
7913 | 7889 | ||