Specify a CTLTYPE_FOO so that a future sysctl(8) change does not need

to rely on the format string.
This commit is contained in:
Matthew D Fleming 2011-01-18 21:14:23 +00:00
parent 2fee06f087
commit 5bc0787f29
9 changed files with 45 additions and 36 deletions

View File

@ -5082,11 +5082,11 @@ em_add_hw_stats(struct adapter *adapter)
"Watchdog timeouts");
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "device_control",
CTLFLAG_RD, adapter, E1000_CTRL,
CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_CTRL,
em_sysctl_reg_handler, "IU",
"Device Control Register");
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_control",
CTLFLAG_RD, adapter, E1000_RCTL,
CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_RCTL,
em_sysctl_reg_handler, "IU",
"Receiver Control Register");
SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "fc_high_water",
@ -5103,11 +5103,13 @@ em_add_hw_stats(struct adapter *adapter)
queue_list = SYSCTL_CHILDREN(queue_node);
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head",
CTLFLAG_RD, adapter, E1000_TDH(txr->me),
CTLTYPE_UINT | CTLFLAG_RD, adapter,
E1000_TDH(txr->me),
em_sysctl_reg_handler, "IU",
"Transmit Descriptor Head");
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_tail",
CTLFLAG_RD, adapter, E1000_TDT(txr->me),
CTLTYPE_UINT | CTLFLAG_RD, adapter,
E1000_TDT(txr->me),
em_sysctl_reg_handler, "IU",
"Transmit Descriptor Tail");
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "tx_irq",
@ -5118,11 +5120,13 @@ em_add_hw_stats(struct adapter *adapter)
"Queue No Descriptor Available");
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_head",
CTLFLAG_RD, adapter, E1000_RDH(rxr->me),
CTLTYPE_UINT | CTLFLAG_RD, adapter,
E1000_RDH(rxr->me),
em_sysctl_reg_handler, "IU",
"Receive Descriptor Head");
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_tail",
CTLFLAG_RD, adapter, E1000_RDT(rxr->me),
CTLTYPE_UINT | CTLFLAG_RD, adapter,
E1000_RDT(rxr->me),
em_sysctl_reg_handler, "IU",
"Receive Descriptor Tail");
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "rx_irq",

View File

@ -5120,17 +5120,19 @@ igb_add_hw_stats(struct adapter *adapter)
queue_list = SYSCTL_CHILDREN(queue_node);
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "interrupt_rate",
CTLFLAG_RD, &adapter->queues[i],
CTLTYPE_UINT | CTLFLAG_RD, &adapter->queues[i],
sizeof(&adapter->queues[i]),
igb_sysctl_interrupt_rate_handler,
"IU", "Interrupt Rate");
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head",
CTLFLAG_RD, adapter, E1000_TDH(txr->me),
CTLTYPE_UINT | CTLFLAG_RD, adapter,
E1000_TDH(txr->me),
igb_sysctl_reg_handler, "IU",
"Transmit Descriptor Head");
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_tail",
CTLFLAG_RD, adapter, E1000_TDT(txr->me),
CTLTYPE_UINT | CTLFLAG_RD, adapter,
E1000_TDT(txr->me),
igb_sysctl_reg_handler, "IU",
"Transmit Descriptor Tail");
SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "no_desc_avail",
@ -5141,11 +5143,13 @@ igb_add_hw_stats(struct adapter *adapter)
"Queue Packets Transmitted");
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_head",
CTLFLAG_RD, adapter, E1000_RDH(rxr->me),
CTLTYPE_UINT | CTLFLAG_RD, adapter,
E1000_RDH(rxr->me),
igb_sysctl_reg_handler, "IU",
"Receive Descriptor Head");
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_tail",
CTLFLAG_RD, adapter, E1000_RDT(rxr->me),
CTLTYPE_UINT | CTLFLAG_RD, adapter,
E1000_RDT(rxr->me),
igb_sysctl_reg_handler, "IU",
"Receive Descriptor Tail");
SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_packets",

View File

@ -4297,11 +4297,11 @@ lem_add_hw_stats(struct adapter *adapter)
"Watchdog timeouts");
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "device_control",
CTLFLAG_RD, adapter, E1000_CTRL,
CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_CTRL,
lem_sysctl_reg_handler, "IU",
"Device Control Register");
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_control",
CTLFLAG_RD, adapter, E1000_RCTL,
CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_RCTL,
lem_sysctl_reg_handler, "IU",
"Receiver Control Register");
SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "fc_high_water",
@ -4318,19 +4318,19 @@ lem_add_hw_stats(struct adapter *adapter)
"TX FIFO resets");
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "txd_head",
CTLFLAG_RD, adapter, E1000_TDH(0),
CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_TDH(0),
lem_sysctl_reg_handler, "IU",
"Transmit Descriptor Head");
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "txd_tail",
CTLFLAG_RD, adapter, E1000_TDT(0),
CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_TDT(0),
lem_sysctl_reg_handler, "IU",
"Transmit Descriptor Tail");
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rxd_head",
CTLFLAG_RD, adapter, E1000_RDH(0),
CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_RDH(0),
lem_sysctl_reg_handler, "IU",
"Receive Descriptor Head");
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rxd_tail",
CTLFLAG_RD, adapter, E1000_RDT(0),
CTLTYPE_UINT | CTLFLAG_RD, adapter, E1000_RDT(0),
lem_sysctl_reg_handler, "IU",
"Receive Descriptor Tail");

View File

@ -2908,8 +2908,8 @@ en_attach(struct en_softc *sc)
goto fail;
if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree),
OID_AUTO, "istats", CTLFLAG_RD, sc, 0, en_sysctl_istats,
"S", "internal statistics") == NULL)
OID_AUTO, "istats", CTLTYPE_OPAQUE | CTLFLAG_RD, sc, 0,
en_sysctl_istats, "S", "internal statistics") == NULL)
goto fail;
#ifdef EN_DEBUG

View File

@ -2794,13 +2794,13 @@ fatm_attach(device_t dev)
goto fail;
if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree),
OID_AUTO, "istats", CTLFLAG_RD, sc, 0, fatm_sysctl_istats,
"LU", "internal statistics") == NULL)
OID_AUTO, "istats", CTLTYPE_ULONG | CTLFLAG_RD, sc, 0,
fatm_sysctl_istats, "LU", "internal statistics") == NULL)
goto fail;
if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree),
OID_AUTO, "stats", CTLFLAG_RD, sc, 0, fatm_sysctl_stats,
"LU", "card statistics") == NULL)
OID_AUTO, "stats", CTLTYPE_ULONG | CTLFLAG_RD, sc, 0,
fatm_sysctl_stats, "LU", "card statistics") == NULL)
goto fail;
if (SYSCTL_ADD_INT(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree),

View File

@ -666,7 +666,7 @@ isc_add_sysctls(isc_session_t *sp)
SYSCTL_CHILDREN(sp->oid),
OID_AUTO,
"targetname",
CTLFLAG_RD,
CTLTYPE_STRING | CTLFLAG_RD,
(void *)&sp->opt.targetName, 0,
isc_sysctl_targetName, "A", "target name");
@ -674,7 +674,7 @@ isc_add_sysctls(isc_session_t *sp)
SYSCTL_CHILDREN(sp->oid),
OID_AUTO,
"targeaddress",
CTLFLAG_RD,
CTLTYPE_STRING | CTLFLAG_RD,
(void *)&sp->opt.targetAddress, 0,
isc_sysctl_targetAddress, "A", "target address");
@ -682,7 +682,7 @@ isc_add_sysctls(isc_session_t *sp)
SYSCTL_CHILDREN(sp->oid),
OID_AUTO,
"stats",
CTLFLAG_RD,
CTLTYPE_STRING | CTLFLAG_RD,
(void *)sp, 0,
isc_dump_stats, "A", "statistics");

View File

@ -5044,15 +5044,16 @@ ixgbe_add_hw_stats(struct adapter *adapter)
queue_list = SYSCTL_CHILDREN(queue_node);
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "interrupt_rate",
CTLFLAG_RD, &adapter->queues[i], sizeof(&adapter->queues[i]),
CTLTYPE_UINT | CTLFLAG_RD, &adapter->queues[i],
sizeof(&adapter->queues[i]),
ixgbe_sysctl_interrupt_rate_handler, "IU",
"Interrupt Rate");
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head",
CTLFLAG_RD, txr, sizeof(txr),
CTLTYPE_UINT | CTLFLAG_RD, txr, sizeof(txr),
ixgbe_sysctl_tdh_handler, "IU",
"Transmit Descriptor Head");
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_tail",
CTLFLAG_RD, txr, sizeof(txr),
CTLTYPE_UINT | CTLFLAG_RD, txr, sizeof(txr),
ixgbe_sysctl_tdt_handler, "IU",
"Transmit Descriptor Tail");
SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "no_desc_avail",
@ -5077,11 +5078,11 @@ ixgbe_add_hw_stats(struct adapter *adapter)
queue_list = SYSCTL_CHILDREN(queue_node);
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_head",
CTLFLAG_RD, rxr, sizeof(rxr),
CTLTYPE_UINT | CTLFLAG_RD, rxr, sizeof(rxr),
ixgbe_sysctl_rdh_handler, "IU",
"Receive Descriptor Head");
SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_tail",
CTLFLAG_RD, rxr, sizeof(rxr),
CTLTYPE_UINT | CTLFLAG_RD, rxr, sizeof(rxr),
ixgbe_sysctl_rdt_handler, "IU",
"Receive Descriptor Tail");
SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_packets",

View File

@ -254,13 +254,13 @@ patm_attach(device_t dev)
goto fail;
if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree),
OID_AUTO, "istats", CTLFLAG_RD, sc, 0, patm_sysctl_istats,
"S", "internal statistics") == NULL)
OID_AUTO, "istats", CTLTYPE_OPAQUE | CTLFLAG_RD, sc, 0,
patm_sysctl_istats, "S", "internal statistics") == NULL)
goto fail;
if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree),
OID_AUTO, "eeprom", CTLFLAG_RD, sc, 0, patm_sysctl_eeprom,
"S", "EEPROM contents") == NULL)
OID_AUTO, "eeprom", CTLTYPE_OPAQUE | CTLFLAG_RD, sc, 0,
patm_sysctl_eeprom, "S", "EEPROM contents") == NULL)
goto fail;
if (SYSCTL_ADD_UINT(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree),

View File

@ -240,7 +240,7 @@ ue_attach_post_task(struct usb_proc_msg *_task)
OID_AUTO, num, CTLFLAG_RD, NULL, "");
SYSCTL_ADD_PROC(&ue->ue_sysctl_ctx,
SYSCTL_CHILDREN(ue->ue_sysctl_oid), OID_AUTO,
"%parent", CTLFLAG_RD, ue, 0,
"%parent", CTLTYPE_STRING | CTLFLAG_RD, ue, 0,
ue_sysctl_parent, "A", "parent device");
UE_LOCK(ue);