Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bb44fb70e069412c08e07f494b6b4e985f6331ac Commit: bb44fb70e069412c08e07f494b6b4e985f6331ac Parent: 073d3f46e5ccc49ede1d3487ed1e71d63d71b750 Author: Ben Dooks <[EMAIL PROTECTED]> AuthorDate: Tue Feb 5 00:02:20 2008 +0000 Committer: Jeff Garzik <[EMAIL PROTECTED]> CommitDate: Mon Feb 11 11:06:35 2008 -0500
DM9000: Add platform flag for no attached EEPROM Allow the platform data to specify to the DM9000 driver that there is no posibility of an attached EEPROM on the device, so default all reads to 0xff and ignore any write operations. Signed-off-by: Ben Dooks <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/dm9000.c | 15 +++++++++++++++ include/linux/dm9000.h | 1 + 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index d0cd7f9..afd2cf5 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c @@ -405,6 +405,9 @@ static int dm9000_get_eeprom(struct net_device *dev, if ((len & 1) != 0 || (offset & 1) != 0) return -EINVAL; + if (dm->flags & DM9000_PLATF_NO_EEPROM) + return -ENOENT; + ee->magic = DM_EEPROM_MAGIC; for (i = 0; i < len; i += 2) @@ -426,6 +429,9 @@ static int dm9000_set_eeprom(struct net_device *dev, if ((len & 1) != 0 || (offset & 1) != 0) return -EINVAL; + if (dm->flags & DM9000_PLATF_NO_EEPROM) + return -ENOENT; + if (ee->magic != DM_EEPROM_MAGIC) return -EINVAL; @@ -1100,6 +1106,12 @@ dm9000_read_eeprom(board_info_t *db, int offset, u8 *to) { unsigned long flags; + if (db->flags & DM9000_PLATF_NO_EEPROM) { + to[0] = 0xff; + to[1] = 0xff; + return; + } + mutex_lock(&db->addr_lock); spin_lock_irqsave(&db->lock, flags); @@ -1134,6 +1146,9 @@ dm9000_write_eeprom(board_info_t *db, int offset, u8 *data) { unsigned long flags; + if (db->flags & DM9000_PLATF_NO_EEPROM) + return; + mutex_lock(&db->addr_lock); spin_lock_irqsave(&db->lock, flags); diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h index ea530fd..a375046 100644 --- a/include/linux/dm9000.h +++ b/include/linux/dm9000.h @@ -20,6 +20,7 @@ #define DM9000_PLATF_16BITONLY (0x0002) #define DM9000_PLATF_32BITONLY (0x0004) #define DM9000_PLATF_EXT_PHY (0x0008) +#define DM9000_PLATF_NO_EEPROM (0x0010) /* platfrom data for platfrom device structure's platfrom_data field */ - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html