Skip to content
Snippets Groups Projects
Commit 80a18535 authored by Adam Wujek's avatar Adam Wujek
Browse files

s [FEATURE: #351] userspace/libwr/i2c_sfp: support revision of SFP in SFP matching process


Signed-off-by: default avatarAdam Wujek <dev_public@wujek.eu>
parent d5f62606
No related merge requests found
......@@ -866,11 +866,11 @@ static struct shw_sfp_caldata *shw_sfp_match_db(int *txWaveLength,
/* If pointer to parameter is not null, it has to match.
* If TX wavelength pointer is null it has to match 0 in
* database (not defined), otherwite match the values. */
if (((!txWaveLength && t->tx_wl == 0) || (txWaveLength && t->tx_wl != 0 && t->tx_wl == *txWaveLength))
&& (!vn || (t->vendor_name[0] != 0 && strncmp(vn, t->vendor_name, VENDOR_NAME_LEN) == 0))
&& (!pn || (t->part_num[0] != 0 && strncmp(pn, t->part_num, VENDOR_PN_LEN) == 0))
&& (!vs || (t->vendor_serial[0] != 0 && strncmp(vs, t->vendor_serial, VENDOR_SERIAL_LEN) == 0))
&& (!vr || (t->vendor_revision[0] != 0 && strncmp(vr, t->vendor_revision, VENDOR_REV_LEN) == 0))
if ( ((!txWaveLength && t->tx_wl == 0) || (txWaveLength && *txWaveLength == t->tx_wl))
&& ((!vn && t->vendor_name[0] == 0) || (vn && strncmp(vn, t->vendor_name, VENDOR_NAME_LEN) == 0))
&& ((!pn && t->part_num[0] == 0) || (pn && strncmp(pn, t->part_num, VENDOR_PN_LEN) == 0))
&& ((!vs && t->vendor_serial[0] == 0) || (vs && strncmp(vs, t->vendor_serial, VENDOR_SERIAL_LEN) == 0))
&& ((!vr && t->vendor_revision[0] == 0) || (vr && strncmp(vr, t->vendor_revision, VENDOR_REV_LEN) == 0))
) {
t->match_flags = 0;
t->match_flags |= txWaveLength ? SFP_MATCH_FLAG_TX_WAVELENGTH : 0;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment