[LPIA Hardy LBM] rt73usb: Allow debugfs EEPROM writes to write back settings
Andy Whitcroft
apw at canonical.com
Wed Jun 10 13:39:55 UTC 2009
On Wed, Jun 10, 2009 at 02:13:21PM +0100, Colin Ian King wrote:
> From 6c0d9600d45174ee348196b3420306e30bcac3ac Mon Sep 17 00:00:00 2001
> From: Colin Ian King <colin.king at canonical.com>
> Date: Wed, 10 Jun 2009 13:26:40 +0100
> Subject: [PATCH] UBUNTU: rt73usb: Allow debugfs EEPROM writes to write back settings
>
> BugLink: https://bugs.edge.launchpad.net/chelsea/+bug/352728
>
You should use the shortest form of the bug link in case the
package/project names change later.
BugLink: http://bugs.launchpad.net/bugs/352728
> Enable debugfs writes to write back settings to the EEPROM. This
> allows one to tweak NIC settings (such as default RX/TX
> antenna controls) for debugging and/or configuration purposes
> and keep these settings stored in a persistent way.
>
> Without this fix, debugfs writes update just the local EEPROM
> cached copy and don't actually write any changes back.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> .../drivers/net/wireless/rt2x00/rt73usb.c | 13 ++++++++++++-
> 1 files changed, 12 insertions(+), 1 deletions(-)
>
> diff --git a/updates/compat-wireless-2.6/drivers/net/wireless/rt2x00/rt73usb.c b/updates/compat-wireless-2.6/drivers/net/wireless/rt2x00/rt73usb.c
> index 34c6ff2..a797405 100644
> --- a/updates/compat-wireless-2.6/drivers/net/wireless/rt2x00/rt73usb.c
> +++ b/updates/compat-wireless-2.6/drivers/net/wireless/rt2x00/rt73usb.c
> @@ -256,6 +256,17 @@ static void rt73usb_write_csr(struct rt2x00_dev *rt2x00dev,
> rt73usb_register_write(rt2x00dev, CSR_OFFSET(word), data);
> }
>
> +static inline void rt73_eeprom_write(struct rt2x00_dev *rt2x00dev,
> + const unsigned int word, u16 data)
> +{
> + rt2x00dev->eeprom[word] = cpu_to_le16(data);
> +
> + rt2x00usb_vendor_request(rt2x00dev, USB_EEPROM_WRITE,
> + USB_VENDOR_REQUEST_OUT, word*2, 0,
> + &rt2x00dev->eeprom[word], sizeof(u16),
> + REGISTER_TIMEOUT16(sizeof(u16)));
> +}
> +
> static const struct rt2x00debug rt73usb_rt2x00debug = {
> .owner = THIS_MODULE,
> .csr = {
> @@ -266,7 +277,7 @@ static const struct rt2x00debug rt73usb_rt2x00debug = {
> },
> .eeprom = {
> .read = rt2x00_eeprom_read,
> - .write = rt2x00_eeprom_write,
> + .write = rt73_eeprom_write,
> .word_size = sizeof(u16),
> .word_count = EEPROM_SIZE / sizeof(u16),
> },
Subject to testing this change looks sensible to me for the LPIA branch.
ACK
-apw
More information about the kernel-team
mailing list