[PATCH] ipwireless_cs driver for 4G PC Card
Jiri Slaby
jslaby at suse.cz
Fri Nov 30 08:11:59 EST 2007
On 11/30/2007 01:55 PM, David Sterba wrote:
> Hi,
>
> I'm submitting driver for IPWireless PC Card, used for 4G
> internet connection.
> The driver has been in -mm series as ipwireless_cs.git tree for
> some time, is actively used and there are currently no
> outstanding bugs.
Almost :).
[...]
> Rewieved-by: Jiri Slaby <jslaby at suse.cz>
[...]
> diff --git a/drivers/char/pcmcia/ipwireless_cs_hardware.c b/drivers/char/pcmcia/ipwireless_cs_hardware.c
> new file mode 100644
> index 0000000..d67ce2e
> --- /dev/null
> +++ b/drivers/char/pcmcia/ipwireless_cs_hardware.c
[...]
> +static struct ipw_rx_packet *pool_allocate(struct ipw_hardware *hw,
> + struct ipw_rx_packet *packet,
> + int minimum_free_space)
> +{
> +
> + if (!packet) {
> + unsigned long flags;
> +
> + /*
> + * If this is the first fragment, then we will need to fetch a
> + * packet to put it in.
> + */
> + spin_lock_irqsave(&hw->spinlock, flags);
> + /* If we have one in our pool, then pull it out. */
> + if (!list_empty(&hw->rx_pool)) {
> + packet = list_first_entry(&hw->rx_pool,
> + struct ipw_rx_packet, queue);
> + list_del(&packet->queue);
> + hw->rx_pool_size--;
> + spin_unlock_irqrestore(&hw->spinlock, flags);
> + } else {
> + /* Otherwise allocate a new one. */
> + static int min_capacity = 256;
> + int new_capacity;
> +
> + spin_unlock_irqrestore(&hw->spinlock, flags);
> + new_capacity =
> + minimum_free_space > min_capacity
> + ? minimum_free_space
> + : min_capacity;
> + packet = kmalloc(sizeof(struct ipw_rx_packet)
> + + new_capacity, GFP_ATOMIC);
These not-testing-alloc-retvals remain unresolved. Please post a -fix or patch
v2 if any other comments come.
> + packet->capacity = new_capacity;
...
thanks.
More information about the linux-pcmcia
mailing list