Deleted Added
full compact
39c39
< /* $FreeBSD: head/sys/dev/oce/oce_sysctl.c 231879 2012-02-17 13:55:17Z luigi $ */
---
> /* $FreeBSD: head/sys/dev/oce/oce_sysctl.c 247880 2013-03-06 09:53:38Z delphij $ */
40a41,43
> /* $FreeBSD: head/sys/dev/oce/oce_sysctl.c 247880 2013-03-06 09:53:38Z delphij $ */
>
>
51a55
> static int oce_sysctl_sfp_vpd_dump(SYSCTL_HANDLER_ARGS);
63a68
> uint32_t sfp_vpd_dump_buffer[TRANSCEIVER_DATA_NUM_ELE];
65d69
<
96c100,101
< if (sc->function_mode & FNM_FLEX10_MODE)
---
> if ((sc->function_mode & FNM_FLEX10_MODE) ||
> (sc->function_mode & FNM_UMC_MODE))
123a129,141
> /*
> * Dumps Transceiver data
> * "sysctl dev.oce.0.sfp_vpd_dump=0"
> * "sysctl -x dev.oce.0.sfp_vpd_dump_buffer" for hex dump
> * "sysctl -b dev.oce.0.sfp_vpd_dump_buffer > sfp.bin" for binary dump
> */
> SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "sfp_vpd_dump",
> CTLTYPE_INT | CTLFLAG_RW, (void *)sc, 0, oce_sysctl_sfp_vpd_dump,
> "I", "Initiate a sfp_vpd_dump operation");
> SYSCTL_ADD_OPAQUE(ctx, child, OID_AUTO, "sfp_vpd_dump_buffer",
> CTLFLAG_RD, sfp_vpd_dump_buffer,
> TRANSCEIVER_DATA_SIZE, "IU", "Access sfp_vpd_dump buffer");
>
136d153
<
150d166
<
1305a1322,1349
>
> static int
> oce_sysctl_sfp_vpd_dump(SYSCTL_HANDLER_ARGS)
> {
> int result = 0, error;
> int rc = 0;
> POCE_SOFTC sc = (POCE_SOFTC) arg1;
>
> /* sysctl default handler */
> error = sysctl_handle_int(oidp, &result, 0, req);
> if (error || !req->newptr)
> return (error);
>
> if(result == -1) {
> return EINVAL;
> }
> bzero((char *)sfp_vpd_dump_buffer, TRANSCEIVER_DATA_SIZE);
>
> rc = oce_mbox_read_transrecv_data(sc, PAGE_NUM_A0);
> if(rc)
> return rc;
>
> rc = oce_mbox_read_transrecv_data(sc, PAGE_NUM_A2);
> if(rc)
> return rc;
>
> return rc;
> }