Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 85615
b: refs/heads/master
c: bb44fb7
h: refs/heads/master
i:
  85613: 741643e
  85611: 38a4de0
  85607: 028ee6f
  85599: c93adf3
v: v3
  • Loading branch information
Ben Dooks authored and Jeff Garzik committed Feb 11, 2008
1 parent 586c5e2 commit bb8ca56
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 073d3f46e5ccc49ede1d3487ed1e71d63d71b750
refs/heads/master: bb44fb70e069412c08e07f494b6b4e985f6331ac
15 changes: 15 additions & 0 deletions trunk/drivers/net/dm9000.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/dm9000.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down

0 comments on commit bb8ca56

Please sign in to comment.