Do not try to read i2c info when no transceiver is present.

MFC with:	r270064
Sponsored by:	Yandex LLC
This commit is contained in:
Alexander V. Chernikov 2014-09-13 16:04:55 +00:00
parent c1d9ecf2be
commit b2100781b8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271524

View File

@ -764,11 +764,13 @@ sfp_status(int s, struct ifreq *ifr, int verbose)
/*
* Try to read byte 0 from i2c:
* Both SFF-8472 and SFF-8436 use it as
* 'identification byte'
* 'identification byte'.
* Stop reading status on zero as value -
* this might happen in case of empty transceiver slot.
*/
id_byte = 0;
ii.f(&ii, SFF_8472_BASE, SFF_8472_ID, 1, (caddr_t)&id_byte);
if (ii.error != 0)
if (ii.error != 0 || id_byte == 0)
return;
switch (id_byte) {