Changeset 37785 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Jul 5, 2011 2:14:14 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetAdp/solaris/VBoxNetAdp-solaris.c
r37081 r37785 208 208 static int vboxNetAdpSolarisSetPromisc(gld_mac_info_t *pMacInfo, int fPromisc); 209 209 static int vboxNetAdpSolarisSetMulticast(gld_mac_info_t *pMacInfo, unsigned char *pMulticastAddr, int fMulticast); 210 static int vboxNetAdpSolarisGetStats(gld_mac_info_t *pMacInfo, struct gld_stats *pStats); 210 211 211 212 … … 306 307 pMacInfo->gldm_send = vboxNetAdpSolarisSend; 307 308 pMacInfo->gldm_intr = NULL; 308 pMacInfo->gldm_get_stats = NULL;309 pMacInfo->gldm_get_stats = vboxNetAdpSolarisGetStats; 309 310 pMacInfo->gldm_ioctl = NULL; 310 311 pMacInfo->gldm_ident = DEVICE_NAME; … … 312 313 pMacInfo->gldm_minpkt = 0; 313 314 pMacInfo->gldm_maxpkt = VBOXNETADP_MTU; 314 315 pMacInfo->gldm_capabilities = GLD_CAP_LINKSTATE; 315 316 AssertCompile(sizeof(RTMAC) == ETHERADDRL); 316 317 … … 341 342 { 342 343 ddi_report_dev(pDip); 344 gld_linkstate(pMacInfo, GLD_LINKSTATE_UP); 343 345 return DDI_SUCCESS; 344 346 } … … 399 401 if (pState) 400 402 { 403 gld_linkstate(pMacInfo, GLD_LINKSTATE_DOWN); 401 404 int rc = gld_unregister(pMacInfo); 402 405 if (rc == DDI_SUCCESS) … … 489 492 } 490 493 494 495 static int vboxNetAdpSolarisGetStats(gld_mac_info_t *pMacInfo, struct gld_stats *pStats) 496 { 497 /* 498 * For now fake up stats. Stats like duplex and speed are better set as they 499 * are used in utilities like dladm. Link state capabilities are critical 500 * as they are used by ipadm while trying to restore persistent interface configs. 501 */ 502 vboxnetadp_state_t *pState = (vboxnetadp_state_t *)pMacInfo->gldm_private; 503 if (pState) 504 { 505 pStats->glds_speed = 1000000000ULL; /* Bits/sec. */ 506 pStats->glds_media = GLDM_UNKNOWN; /* Media/Connector Type */ 507 pStats->glds_intr = 0; /* Interrupt count */ 508 pStats->glds_norcvbuf = 0; /* Recv. discards */ 509 pStats->glds_errxmt = 0; /* Xmit errors */ 510 pStats->glds_errrcv = 0; /* Recv. errors */ 511 pStats->glds_missed = 0; /* Pkt Drops on Recv. */ 512 pStats->glds_underflow = 0; /* Buffer underflows */ 513 pStats->glds_overflow = 0; /* Buffer overflows */ 514 515 /* Ether */ 516 pStats->glds_frame = 0; /* Align errors */ 517 pStats->glds_crc = 0; /* CRC errors */ 518 pStats->glds_duplex = GLD_DUPLEX_FULL; /* Link duplex state */ 519 pStats->glds_nocarrier = 0; /* Carrier sense errors */ 520 pStats->glds_collisions = 0; /* Xmit Collisions */ 521 pStats->glds_excoll = 0; /* Frame discard due to excess collisions */ 522 pStats->glds_xmtlatecoll = 0; /* Late collisions */ 523 pStats->glds_defer = 0; /* Deferred Xmits */ 524 pStats->glds_dot3_first_coll = 0; /* Single collision frames */ 525 pStats->glds_dot3_multi_coll = 0; /* Multiple collision frames */ 526 pStats->glds_dot3_sqe_error = 0; /* SQE errors */ 527 pStats->glds_dot3_mac_xmt_error = 0; /* MAC Xmit errors */ 528 pStats->glds_dot3_mac_rcv_error = 0; /* Mac Recv. errors */ 529 pStats->glds_dot3_frame_too_long = 0; /* Frame too long errors */ 530 pStats->glds_short = 0; /* Runt frames */ 531 532 pStats->glds_noxmtbuf = 0; /* Xmit Buf errors */ 533 pStats->glds_xmtretry = 0; /* Xmit retries */ 534 pStats->glds_multixmt = 0; /* Multicast Xmits */ 535 pStats->glds_multircv = 0; /* Multicast Recvs. */ 536 pStats->glds_brdcstxmt = 0; /* Broadcast Xmits*/ 537 pStats->glds_brdcstrcv = 0; /* Broadcast Recvs. */ 538 539 return GLD_SUCCESS; 540 } 541 else 542 LogRel((DEVICE_NAME ":vboxNetAdpSolarisGetStats failed to get internal state.\n")); 543 return GLD_FAILURE; 544 } 545
Note:
See TracChangeset
for help on using the changeset viewer.