Print this page
3503 usba doesn't initialize cc_no_resources, causes gibberish output in kstat
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Richard Lowe <richlowe@richlowe.net>


 326                 kstat_named_init(&esp->cc_stall,
 327                     "Endpoint Stalls", KSTAT_DATA_UINT64);
 328                 kstat_named_init(&esp->cc_dev_not_resp,
 329                     "Device Not Responding", KSTAT_DATA_UINT64);
 330                 kstat_named_init(&esp->cc_pid_checkfailure,
 331                     "PID Check Bit Errors", KSTAT_DATA_UINT64);
 332                 kstat_named_init(&esp->cc_unexp_pid,
 333                     "Invalid PID Errors", KSTAT_DATA_UINT64);
 334                 kstat_named_init(&esp->cc_data_overrun,
 335                     "Data Overruns", KSTAT_DATA_UINT64);
 336                 kstat_named_init(&esp->cc_data_underrun,
 337                     "Data Underruns", KSTAT_DATA_UINT64);
 338                 kstat_named_init(&esp->cc_buffer_overrun,
 339                     "Buffer Overruns", KSTAT_DATA_UINT64);
 340                 kstat_named_init(&esp->cc_buffer_underrun,
 341                     "Buffer Underruns", KSTAT_DATA_UINT64);
 342                 kstat_named_init(&esp->cc_timeout,
 343                     "Command Timed Out", KSTAT_DATA_UINT64);
 344                 kstat_named_init(&esp->cc_not_accessed,
 345                     "Not Accessed By Hardware", KSTAT_DATA_UINT64);


 346                 kstat_named_init(&esp->cc_unspecified_err,
 347                     "Unspecified Error", KSTAT_DATA_UINT64);
 348 #ifdef  NOTYETNEEDED
 349                 kstat_named_init(&esp->hcdi_usb_failure,
 350                     "USB Failure", KSTAT_DATA_UINT64);
 351                 kstat_named_init(&esp->hcdi_usb_no_resources,
 352                     "No Resources", KSTAT_DATA_UINT64);
 353                 kstat_named_init(&esp->hcdi_usb_no_bandwidth,
 354                     "No Bandwidth", KSTAT_DATA_UINT64);
 355                 kstat_named_init(&esp->hcdi_usb_pipe_reserved,
 356                     "Pipe Reserved", KSTAT_DATA_UINT64);
 357                 kstat_named_init(&esp->hcdi_usb_pipe_unshareable,
 358                     "Pipe Unshareable", KSTAT_DATA_UINT64);
 359                 kstat_named_init(&esp->hcdi_usb_not_supported,
 360                     "Function Not Supported", KSTAT_DATA_UINT64);
 361                 kstat_named_init(&esp->hcdi_usb_pipe_error,
 362                     "Pipe Error", KSTAT_DATA_UINT64);
 363                 kstat_named_init(&esp->hcdi_usb_pipe_busy,
 364                     "Pipe Busy", KSTAT_DATA_UINT64);
 365 #endif
 366 
 367                 HCDI_ERROR_STATS(hcdi)->ks_private = hcdi;
 368                 HCDI_ERROR_STATS(hcdi)->ks_update = nulldev;
 369                 kstat_install(HCDI_ERROR_STATS(hcdi));
 370         }
 371 }
 372 
 373 
 374 /*
 375  * Do actual error stats
 376  */
 377 void
 378 usba_hcdi_update_error_stats(usba_hcdi_t *hcdi, usb_cr_t completion_reason)
 379 {
 380         if (HCDI_ERROR_STATS(hcdi) == NULL) {
 381 
 382                 return;
 383         }
 384 
 385         switch (completion_reason) {




 326                 kstat_named_init(&esp->cc_stall,
 327                     "Endpoint Stalls", KSTAT_DATA_UINT64);
 328                 kstat_named_init(&esp->cc_dev_not_resp,
 329                     "Device Not Responding", KSTAT_DATA_UINT64);
 330                 kstat_named_init(&esp->cc_pid_checkfailure,
 331                     "PID Check Bit Errors", KSTAT_DATA_UINT64);
 332                 kstat_named_init(&esp->cc_unexp_pid,
 333                     "Invalid PID Errors", KSTAT_DATA_UINT64);
 334                 kstat_named_init(&esp->cc_data_overrun,
 335                     "Data Overruns", KSTAT_DATA_UINT64);
 336                 kstat_named_init(&esp->cc_data_underrun,
 337                     "Data Underruns", KSTAT_DATA_UINT64);
 338                 kstat_named_init(&esp->cc_buffer_overrun,
 339                     "Buffer Overruns", KSTAT_DATA_UINT64);
 340                 kstat_named_init(&esp->cc_buffer_underrun,
 341                     "Buffer Underruns", KSTAT_DATA_UINT64);
 342                 kstat_named_init(&esp->cc_timeout,
 343                     "Command Timed Out", KSTAT_DATA_UINT64);
 344                 kstat_named_init(&esp->cc_not_accessed,
 345                     "Not Accessed By Hardware", KSTAT_DATA_UINT64);
 346                 kstat_named_init(&esp->cc_no_resources,
 347                     "No Resources", KSTAT_DATA_UINT64);
 348                 kstat_named_init(&esp->cc_unspecified_err,
 349                     "Unspecified Error", KSTAT_DATA_UINT64);
 350                 kstat_named_init(&esp->cc_stopped_polling,
 351                     "Stopped Polling", KSTAT_DATA_UINT64);
 352                 kstat_named_init(&esp->cc_pipe_closing,
 353                     "Pipe Closing", KSTAT_DATA_UINT64);
 354                 kstat_named_init(&esp->cc_pipe_reset,
 355                     "Pipe Reset", KSTAT_DATA_UINT64);
 356                 kstat_named_init(&esp->cc_not_supported,
 357                     "Command Not Supported", KSTAT_DATA_UINT64);
 358                 kstat_named_init(&esp->cc_flushed,
 359                     "Request Flushed", KSTAT_DATA_UINT64);








 360 
 361                 HCDI_ERROR_STATS(hcdi)->ks_private = hcdi;
 362                 HCDI_ERROR_STATS(hcdi)->ks_update = nulldev;
 363                 kstat_install(HCDI_ERROR_STATS(hcdi));
 364         }
 365 }
 366 
 367 
 368 /*
 369  * Do actual error stats
 370  */
 371 void
 372 usba_hcdi_update_error_stats(usba_hcdi_t *hcdi, usb_cr_t completion_reason)
 373 {
 374         if (HCDI_ERROR_STATS(hcdi) == NULL) {
 375 
 376                 return;
 377         }
 378 
 379         switch (completion_reason) {