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.c55
1 files changed, 31 insertions, 24 deletions
diff --git a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c
index 93f4e8309f81..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,15 +168,14 @@ 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 dev_info(&dev->dev, 171 pr_info("%s: Controller %d of multiport board\n",
165 "Controller %d of multiport board\n", 172 dev->name, controller_index);
166 controller_index);
167 tp->mtable = last_mediatable; 173 tp->mtable = last_mediatable;
168 ee_data = last_ee_data; 174 ee_data = last_ee_data;
169 goto subsequent_board; 175 goto subsequent_board;
170 } else 176 } else
171 dev_info(&dev->dev, 177 pr_info("%s: Missing EEPROM, this interface may not work correctly!\n",
172 "Missing EEPROM, this interface may not work correctly!\n"); 178 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. */
@@ -181,15 +187,14 @@ void __devinit tulip_parse_eeprom(struct net_device *dev)
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 dev_info(&dev->dev, 190 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", 191 dev->name, eeprom_fixups[i].name);
186 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 dev_info(&dev->dev, 196 pr_info("%s: Old style EEPROM with no media selection information\n",
192 "Old style EEPROM with no media selection information\n"); 197 dev->name);
193 return; 198 return;
194 } 199 }
195 } 200 }
@@ -217,8 +222,8 @@ subsequent_board:
217 /* 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 */
218 if (count == 0) { 223 if (count == 0) {
219 if (tulip_debug > 0) 224 if (tulip_debug > 0)
220 dev_warn(&dev->dev, 225 pr_warning("%s: no phy info, aborting mtable build\n",
221 "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 dev_info(&dev->dev, "EEPROM default media type %s\n", 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,17 +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 dev_info(&dev->dev, 308 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", 309 dev->name,
303 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], 311 bp[5 + bp[2 + bp[1]*2]*2],
305 bp[4 + bp[2 + bp[1]*2]*2]); 312 bp[4 + bp[2 + bp[1]*2]*2]);
306 } 313 }
307 dev_info(&dev->dev, 314 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", 315 dev->name,
309 i, medianame[leaf->media & 15], leaf->media, 316 i, medianame[leaf->media & 15], leaf->media,
310 leaf->type < ARRAY_SIZE(block_name) ? block_name[leaf->type] : "<unknown>", 317 leaf->type < ARRAY_SIZE(block_name) ? block_name[leaf->type] : "<unknown>",
311 leaf->type); 318 leaf->type);
312 } 319 }
313 if (new_advertise) 320 if (new_advertise)
314 tp->sym_advertise = new_advertise; 321 tp->sym_advertise = new_advertise;