Re: [PATCH net-next] iwmc3200bt: Add iwmc3200 bluetooth driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 3, 2009 at 3:55 AM, Marcel Holtmann <marcel@xxxxxxxxxxxx> wrote:
> Hi Tomas,
>
> so I removed all the unneeded parties from this thread since there is no
> point in spamming everybody with this.
>
>>vl_sdio.o
>>  btmrvl-y                     := btmrvl_main.o
>>  btmrvl-$(CONFIG_DEBUG_FS)    += btmrvl_debugfs.o
>>
>> +obj-$(CONFIG_BT_IWMC3200)    += iwmc3200bt.o
>> +
>
> sort this one before the Marvell driver since it is a one file only
> driver.
>
No problem

>> + *  Based on  drivers/bluetooth/btsdio.c
>> + *  Copyright (C) 2007  Cambridge Silicon Radio Ltd.
>> + *  Copyright (C) 2007  Marcel Holtmann <marcel@xxxxxxxxxxxx>
>
> You mean "based on" or "90% copied" ;)
>

Right, we've tried actually to use btsdio but we differ in few key points,
actually we coudn't locate and working HW with btsdio to try if our
changes break it
If someone know such device please let me know.

>> +#ifdef CONFIG_BT_IWMC3200_DEBUG
>> +#define IBT_DBG(func, fmt, arg...) \
>> +     dev_dbg(&((func)->dev), "%s: " fmt "\n" , __func__ , ## arg)
>> +#define IBT_ERR(func, fmt, arg...) \
>> +     dev_err(&((func)->dev), "%s: " fmt "\n" , __func__ , ## arg)
>> +#define IBT_DUMP(func, buf, size) do {                                       \
>> +     char prefix_str[30 + 1];                                        \
>> +     scnprintf(prefix_str, 30, "%s %s",                              \
>> +             dev_driver_string(&((func)->dev)),                      \
>> +             dev_name(&((func)->dev)));                              \
>> +     print_hex_dump(KERN_DEBUG, prefix_str, DUMP_PREFIX_OFFSET,      \
>> +                     16, 1, buf, size, false);                       \
>> +} while (0)
>> +
>> +#define VD "-d"
>> +#else
>> +#define IBT_DBG(func, fmt, arg...)
>> +#define IBT_ERR(func, fmt, arg...)
>> +#define IBT_DUMP(func, buf, size)
>> +#define VD
>> +#endif /* CONFIG_BT_IWMC3200_DEBUG */
>> +
>> +#ifdef REPOSITORY_LABEL
>> +#define RL REPOSITORY_LABEL
>> +#else
>> +#define RL local
>> +#endif
>
> All of this debug stuff has to go away. It is really not needed and
> BT_DBG with dynamic_printk support seems more than enough.


Personally I prefer using dev_dbg in device driver then inventing it
again with pr_debug.

>
>> +#define IWMCBT_VERSION "0.1.6"
>> +
>> +#define DRIVER_VERSION IWMCBT_VERSION "-"  __stringify(RL) VD
>
> This one needs to be removed too. I don't care about the repository
> label in upstream.

See what I can do somehow I need to also maintain  it internally
>
>> +#define IWMC_BT_SDIO_DEVID (0x1406)
>> +
>> +static const struct sdio_device_id btsdio_table[] = {
>> +     /* IWMC3200BT (0x1406) */
>> +     { SDIO_DEVICE(SDIO_VENDOR_ID_INTEL, 0x1406)},
>> +     { }     /* Terminating entry */
>> +};
>
> This is pointless. Just use the numbers directly. and put a proper
> comment above SDIO_DEVICE with hardware this is. Also no need to repeat
> the number in that comment.

This is what we agreed up, VENDOR ID is defined, device id is inline

>
>> +
>> +MODULE_DEVICE_TABLE(sdio, btsdio_table);
>> +
>> +struct btsdio_data {
>> +     struct hci_dev   *hdev;
>> +     struct sdio_func *func;
>> +
>> +     struct work_struct work;
>> +
>> +     struct sk_buff_head txq;
>> +     unsigned char tx_buf[2048];
>> +     unsigned char rx_buf[2048];
>> +};
>
> I know that you guys copied btsdio driver, but if you change the name,
> then also change the internal structure names. So this these should be
> called iwmc3200_data and etc.

Right, I just would like to postpone it for now for easier alignment with btsdio

>
> Also I prefer that we allocate tx_buf and rx_buf so that they are
> ensured to be aligned and we don't have to play alignment tricks during
> the packet sending and receiving.

Correct, that's something on the list.

>

>> +#ifdef CONFIG_BT_IWMC3200_DEBUG
>> +static char *type_names[] = {
>> +     "Illegal",
>> +     "HCI_COMMAND_PKT",
>> +     "HCI_ACLDATA_PKT",
>> +     "HCI_SCODATA_PKT",
>> +     "HCI_EVENT_PKT"
>> +};
>> +#endif /* CONFIG_BT_IWMC3200_DEBUG  */
>
> No unneeded debug extras please. This is a Bluetooth HCI driver. It is
> really not that complicated.
>

This can go

> <snip>
>
> I need the debug cleanup first, before continuing looking at the rest of
> the driver.

>> +MODULE_ALIAS("ibtsdio");
>
> We are not using module aliases here. So that can be removed.

No problem this can be removed now


Thanks for the review, will send updated patch soon
Tomas
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux