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