Print this page
8699 Want NIC transceiver visibility (fix lint)


  51 {
  52         uint_t i;
  53         uint8_t buf[256];
  54 
  55         bzero(buf, sizeof (buf));
  56         buf[SFF_8472_IDENTIFIER] = SFF_8024_ID_QSFP;
  57 
  58         /*
  59          * The upper four bits of this value are used as a 4-bit identifier. The
  60          * lower four bits are used as options.
  61          */
  62         for (i = 0; i < 16; i++) {
  63                 int ret;
  64                 nvlist_t *nvl;
  65 
  66                 buf[SFF_8636_DEVICE_TECH] = i << 4;
  67                 buf[SFF_8636_DEVICE_TECH] |= (i % 16);
  68 
  69                 if ((ret = libsff_parse(buf, sizeof (buf), 0xa0, &nvl)) != 0) {
  70                         errx(1, "TEST FAILED: failed to parse QSFP device tech "
  71                             "%d: %s\n", i, strerror(errno));
  72                 }
  73 
  74                 lst_print_array(nvl, LIBSFF_KEY_TRAN_TECH);
  75                 nvlist_free(nvl);
  76         }
  77 
  78         return (0);
  79 }


  51 {
  52         uint_t i;
  53         uint8_t buf[256];
  54 
  55         bzero(buf, sizeof (buf));
  56         buf[SFF_8472_IDENTIFIER] = SFF_8024_ID_QSFP;
  57 
  58         /*
  59          * The upper four bits of this value are used as a 4-bit identifier. The
  60          * lower four bits are used as options.
  61          */
  62         for (i = 0; i < 16; i++) {
  63                 int ret;
  64                 nvlist_t *nvl;
  65 
  66                 buf[SFF_8636_DEVICE_TECH] = i << 4;
  67                 buf[SFF_8636_DEVICE_TECH] |= (i % 16);
  68 
  69                 if ((ret = libsff_parse(buf, sizeof (buf), 0xa0, &nvl)) != 0) {
  70                         errx(1, "TEST FAILED: failed to parse QSFP device tech "
  71                             "%d: %s\n", i, strerror(ret));
  72                 }
  73 
  74                 lst_print_array(nvl, LIBSFF_KEY_TRAN_TECH);
  75                 nvlist_free(nvl);
  76         }
  77 
  78         return (0);
  79 }