summaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2008-07-28 16:53:32 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-28 08:28:03 -0700
commita01386924874c4d6d67f8a34e66f04452c2abb69 (patch)
treec412347f001f7d84c23ffc8d88f14479d999dfd4 /drivers/char
parent0f38c47a545d36da4038fec0708e6e3fbdb160b1 (diff)
downloadlinux-a01386924874c4d6d67f8a34e66f04452c2abb69.tar.gz
linux-a01386924874c4d6d67f8a34e66f04452c2abb69.tar.bz2
linux-a01386924874c4d6d67f8a34e66f04452c2abb69.zip
ipwireless: Preallocate received packet buffers with MRU size
ipwireless: Preallocate received packet buffers with MRU size Packets are assembled from link size (~300 bytes) up to PPP MRU (1500 by default). Try to preallocate full size rather than repeatedly advance buffer size by 256 bytes. Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/pcmcia/ipwireless/hardware.c3
-rw-r--r--drivers/char/pcmcia/ipwireless/network.c5
-rw-r--r--drivers/char/pcmcia/ipwireless/network.h1
3 files changed, 8 insertions, 1 deletions
diff --git a/drivers/char/pcmcia/ipwireless/hardware.c b/drivers/char/pcmcia/ipwireless/hardware.c
index d1e69de19156..7d500f82195a 100644
--- a/drivers/char/pcmcia/ipwireless/hardware.c
+++ b/drivers/char/pcmcia/ipwireless/hardware.c
@@ -567,7 +567,8 @@ static struct ipw_rx_packet *pool_allocate(struct ipw_hardware *hw,
spin_unlock_irqrestore(&hw->lock, flags);
list_del(&packet->queue);
} else {
- static int min_capacity = 256;
+ const int min_capacity =
+ ipwireless_ppp_mru(hw->network + 2);
int new_capacity;
spin_unlock_irqrestore(&hw->lock, flags);
diff --git a/drivers/char/pcmcia/ipwireless/network.c b/drivers/char/pcmcia/ipwireless/network.c
index 2b07af05106d..590762a7f217 100644
--- a/drivers/char/pcmcia/ipwireless/network.c
+++ b/drivers/char/pcmcia/ipwireless/network.c
@@ -499,3 +499,8 @@ int ipwireless_ppp_unit_number(struct ipw_network *network)
return ret;
}
+
+int ipwireless_ppp_mru(const struct ipw_network *network)
+{
+ return network->mru;
+}
diff --git a/drivers/char/pcmcia/ipwireless/network.h b/drivers/char/pcmcia/ipwireless/network.h
index ccacd26fc7ef..561f765b3334 100644
--- a/drivers/char/pcmcia/ipwireless/network.h
+++ b/drivers/char/pcmcia/ipwireless/network.h
@@ -48,5 +48,6 @@ void ipwireless_ppp_open(struct ipw_network *net);
void ipwireless_ppp_close(struct ipw_network *net);
int ipwireless_ppp_channel_index(struct ipw_network *net);
int ipwireless_ppp_unit_number(struct ipw_network *net);
+int ipwireless_ppp_mru(const struct ipw_network *net);
#endif