aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip/eeprom.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/tulip/eeprom.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/tulip/eeprom.c')
-rw-r--r--drivers/net/tulip/eeprom.c62
1 files changed, 35 insertions, 27 deletions
diff --git a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c
index 391acd32a6a5..6002e651b9ea 100644
--- a/drivers/net/tulip/eeprom.c
+++ b/drivers/net/tulip/eeprom.c
@@ -13,6 +13,7 @@
13*/ 13*/
14 14
15#include <linux/pci.h> 15#include <linux/pci.h>
16#include <linux/slab.h>
16#include "tulip.h" 17#include "tulip.h"
17#include <linux/init.h> 18#include <linux/init.h>
18#include <asm/unaligned.h> 19#include <asm/unaligned.h>
@@ -143,6 +144,12 @@ static void __devinit tulip_build_fake_mediatable(struct tulip_private *tp)
143 144
144void __devinit tulip_parse_eeprom(struct net_device *dev) 145void __devinit tulip_parse_eeprom(struct net_device *dev)
145{ 146{
147 /*
148 dev is not registered at this point, so logging messages can't
149 use dev_<level> or netdev_<level> but dev->name is good via a
150 hack in the caller
151 */
152
146 /* The last media info list parsed, for multiport boards. */ 153 /* The last media info list parsed, for multiport boards. */
147 static struct mediatable *last_mediatable; 154 static struct mediatable *last_mediatable;
148 static unsigned char *last_ee_data; 155 static unsigned char *last_ee_data;
@@ -161,36 +168,33 @@ void __devinit tulip_parse_eeprom(struct net_device *dev)
161 if (ee_data[0] == 0xff) { 168 if (ee_data[0] == 0xff) {
162 if (last_mediatable) { 169 if (last_mediatable) {
163 controller_index++; 170 controller_index++;
164 printk(KERN_INFO "%s: Controller %d of multiport board.\n", 171 pr_info("%s: Controller %d of multiport board\n",
165 dev->name, controller_index); 172 dev->name, controller_index);
166 tp->mtable = last_mediatable; 173 tp->mtable = last_mediatable;
167 ee_data = last_ee_data; 174 ee_data = last_ee_data;
168 goto subsequent_board; 175 goto subsequent_board;
169 } else 176 } else
170 printk(KERN_INFO "%s: Missing EEPROM, this interface may " 177 pr_info("%s: Missing EEPROM, this interface may not work correctly!\n",
171 "not work correctly!\n", 178 dev->name);
172 dev->name);
173 return; 179 return;
174 } 180 }
175 /* Do a fix-up based on the vendor half of the station address prefix. */ 181 /* Do a fix-up based on the vendor half of the station address prefix. */
176 for (i = 0; eeprom_fixups[i].name; i++) { 182 for (i = 0; eeprom_fixups[i].name; i++) {
177 if (dev->dev_addr[0] == eeprom_fixups[i].addr0 183 if (dev->dev_addr[0] == eeprom_fixups[i].addr0 &&
178 && dev->dev_addr[1] == eeprom_fixups[i].addr1 184 dev->dev_addr[1] == eeprom_fixups[i].addr1 &&
179 && dev->dev_addr[2] == eeprom_fixups[i].addr2) { 185 dev->dev_addr[2] == eeprom_fixups[i].addr2) {
180 if (dev->dev_addr[2] == 0xE8 && ee_data[0x1a] == 0x55) 186 if (dev->dev_addr[2] == 0xE8 && ee_data[0x1a] == 0x55)
181 i++; /* An Accton EN1207, not an outlaw Maxtech. */ 187 i++; /* An Accton EN1207, not an outlaw Maxtech. */
182 memcpy(ee_data + 26, eeprom_fixups[i].newtable, 188 memcpy(ee_data + 26, eeprom_fixups[i].newtable,
183 sizeof(eeprom_fixups[i].newtable)); 189 sizeof(eeprom_fixups[i].newtable));
184 printk(KERN_INFO "%s: Old format EEPROM on '%s' board. Using" 190 pr_info("%s: Old format EEPROM on '%s' board. Using substitute media control info\n",
185 " substitute media control info.\n", 191 dev->name, eeprom_fixups[i].name);
186 dev->name, eeprom_fixups[i].name);
187 break; 192 break;
188 } 193 }
189 } 194 }
190 if (eeprom_fixups[i].name == NULL) { /* No fixup found. */ 195 if (eeprom_fixups[i].name == NULL) { /* No fixup found. */
191 printk(KERN_INFO "%s: Old style EEPROM with no media selection " 196 pr_info("%s: Old style EEPROM with no media selection information\n",
192 "information.\n", 197 dev->name);
193 dev->name);
194 return; 198 return;
195 } 199 }
196 } 200 }
@@ -218,7 +222,8 @@ subsequent_board:
218 /* there is no phy information, don't even try to build mtable */ 222 /* there is no phy information, don't even try to build mtable */
219 if (count == 0) { 223 if (count == 0) {
220 if (tulip_debug > 0) 224 if (tulip_debug > 0)
221 printk(KERN_WARNING "%s: no phy info, aborting mtable build\n", dev->name); 225 pr_warning("%s: no phy info, aborting mtable build\n",
226 dev->name);
222 return; 227 return;
223 } 228 }
224 229
@@ -234,8 +239,10 @@ subsequent_board:
234 mtable->has_nonmii = mtable->has_mii = mtable->has_reset = 0; 239 mtable->has_nonmii = mtable->has_mii = mtable->has_reset = 0;
235 mtable->csr15dir = mtable->csr15val = 0; 240 mtable->csr15dir = mtable->csr15val = 0;
236 241
237 printk(KERN_INFO "%s: EEPROM default media type %s.\n", dev->name, 242 pr_info("%s: EEPROM default media type %s\n",
238 media & 0x0800 ? "Autosense" : medianame[media & MEDIA_MASK]); 243 dev->name,
244 media & 0x0800 ? "Autosense"
245 : medianame[media & MEDIA_MASK]);
239 for (i = 0; i < count; i++) { 246 for (i = 0; i < count; i++) {
240 struct medialeaf *leaf = &mtable->mleaf[i]; 247 struct medialeaf *leaf = &mtable->mleaf[i];
241 248
@@ -298,16 +305,17 @@ subsequent_board:
298 } 305 }
299 if (tulip_debug > 1 && leaf->media == 11) { 306 if (tulip_debug > 1 && leaf->media == 11) {
300 unsigned char *bp = leaf->leafdata; 307 unsigned char *bp = leaf->leafdata;
301 printk(KERN_INFO "%s: MII interface PHY %d, setup/reset " 308 pr_info("%s: MII interface PHY %d, setup/reset sequences %d/%d long, capabilities %02x %02x\n",
302 "sequences %d/%d long, capabilities %2.2x %2.2x.\n", 309 dev->name,
303 dev->name, bp[0], bp[1], bp[2 + bp[1]*2], 310 bp[0], bp[1], bp[2 + bp[1]*2],
304 bp[5 + bp[2 + bp[1]*2]*2], bp[4 + bp[2 + bp[1]*2]*2]); 311 bp[5 + bp[2 + bp[1]*2]*2],
312 bp[4 + bp[2 + bp[1]*2]*2]);
305 } 313 }
306 printk(KERN_INFO "%s: Index #%d - Media %s (#%d) described " 314 pr_info("%s: Index #%d - Media %s (#%d) described by a %s (%d) block\n",
307 "by a %s (%d) block.\n", 315 dev->name,
308 dev->name, i, medianame[leaf->media & 15], leaf->media, 316 i, medianame[leaf->media & 15], leaf->media,
309 leaf->type < ARRAY_SIZE(block_name) ? block_name[leaf->type] : "<unknown>", 317 leaf->type < ARRAY_SIZE(block_name) ? block_name[leaf->type] : "<unknown>",
310 leaf->type); 318 leaf->type);
311 } 319 }
312 if (new_advertise) 320 if (new_advertise)
313 tp->sym_advertise = new_advertise; 321 tp->sym_advertise = new_advertise;