diff options
| author | Venugopal Iyer <Venu.Iyer@Sun.COM> | 2010-03-09 15:30:01 -0800 |
|---|---|---|
| committer | Venugopal Iyer <Venu.Iyer@Sun.COM> | 2010-03-09 15:30:01 -0800 |
| commit | 0dc2366f7b9f9f36e10909b1e95edbf2a261c2ac (patch) | |
| tree | 21e9b7ebf6656a506e66695947b60e562787ea4f /usr/src/uts/common/io/elxl | |
| parent | e47012d1925f46ba3ba641bef25c0cf3af74d020 (diff) | |
| download | illumos-gate-0dc2366f7b9f9f36e10909b1e95edbf2a261c2ac.tar.gz | |
PSARC/2009/364 dlstat and flowstat
PSARC/2009/436 Anti-spoofing Link Protection
PSARC/2009/448 pool dladm link property
PSARC/2009/501 Dynamic Ring Grouping on NICs
PSARC/2009/638 Public GLDv3 Interfaces
PSARC/2010/074 Crossbow resource usage updates
6838175 mac_tx should be able to send out a packet without a configured address
6806552 single MAC default TX ring doesn't scale
6809686 back-to-back LACP not recovering after removing one of the aggregated ports
6902209 setting maxbw to zero requires an intermediate reset-linkprop to take effect
6855972 Bind interrupts to the same CPU as poll thread using new interrupt APIs
6863945 aggr pseudo Tx rings
6796839 allow CPU pools to be associated with data-links
6526471 data-links assigned to an exclusive zone should seamlessly be bound the zone's CPUs
6802595 Per links stats can use some improvement
6889685 Crossbow should provide control over provision of h/w rings to MAC clients.
6708310 ixgbe needs to support VMDq
6869019 ixgbe should support IRM (Interrupt Resource Management framework)
6902266 vnet should support entry point for per ring stat querying
6926790 Integrate Link Protection Phase II
6930358 Make the core set of GLDv3 driver APIs committed
6901419 dladm create-aggr -u incorrectly rejects some valid ethernet addresses
6717042 should support "cpus" link properties for aggregations
6908184 bge_set_priv_prop() and bge_get_priv_prop() can't agree on the set of private properties
6907617 bge_m_getprop() shouldn't return default values for read-only properties
6900833 unused code in vnic_impl.h can be removed
Diffstat (limited to 'usr/src/uts/common/io/elxl')
| -rw-r--r-- | usr/src/uts/common/io/elxl/elxl.c | 56 |
1 files changed, 38 insertions, 18 deletions
diff --git a/usr/src/uts/common/io/elxl/elxl.c b/usr/src/uts/common/io/elxl/elxl.c index b23702cebc..2ffe96aff3 100644 --- a/usr/src/uts/common/io/elxl/elxl.c +++ b/usr/src/uts/common/io/elxl/elxl.c @@ -84,9 +84,11 @@ static int elxl_m_promisc(void *, boolean_t); static int elxl_m_multicst(void *, boolean_t, const uint8_t *); static int elxl_m_unicst(void *, const uint8_t *); static int elxl_m_getprop(void *, const char *, mac_prop_id_t, uint_t, - uint_t, void *, uint_t *); + void *); static int elxl_m_setprop(void *, const char *, mac_prop_id_t, uint_t, const void *); +static void elxl_m_propinfo(void *, const char *, mac_prop_id_t, + mac_prop_info_handle_t); static boolean_t elxl_m_getcapab(void *, mac_capab_t cap, void *); static uint_t elxl_intr(caddr_t, caddr_t); static void elxl_error(elxl_t *, char *, ...); @@ -198,9 +200,10 @@ static const struct ex_product { { 0, NULL, 0 }, }; -mac_priv_prop_t ex_priv_prop[] = { - { "_media", MAC_PROP_PERM_RW }, - { "_available_media", MAC_PROP_PERM_READ }, +static char *ex_priv_prop[] = { + "_media", + "_available_media", + NULL }; static mii_ops_t ex_mii_ops = { @@ -211,7 +214,7 @@ static mii_ops_t ex_mii_ops = { }; static mac_callbacks_t elxl_m_callbacks = { - MC_GETCAPAB | MC_SETPROP | MC_GETPROP, + MC_GETCAPAB | MC_PROPERTIES, elxl_m_stat, elxl_m_start, elxl_m_stop, @@ -220,11 +223,13 @@ static mac_callbacks_t elxl_m_callbacks = { elxl_m_unicst, elxl_m_tx, NULL, + NULL, elxl_m_getcapab, NULL, NULL, elxl_m_setprop, - elxl_m_getprop + elxl_m_getprop, + elxl_m_propinfo }; /* @@ -575,7 +580,6 @@ elxl_attach(dev_info_t *dip) macp->m_max_sdu = ETHERMTU; macp->m_margin = VLAN_TAGSZ; macp->m_priv_props = ex_priv_prop; - macp->m_priv_prop_count = 2; (void) ddi_intr_enable(sc->ex_intrh); @@ -1387,38 +1391,32 @@ elxl_m_getcapab(void *arg, mac_capab_t cap, void *data) } static int -elxl_m_getprop(void *arg, const char *name, mac_prop_id_t num, uint_t flags, - uint_t sz, void *val, uint_t *perm) +elxl_m_getprop(void *arg, const char *name, mac_prop_id_t num, uint_t sz, + void *val) { elxl_t *sc = arg; int rv; - boolean_t isdef = (flags & MAC_PROP_DEFAULT); if (sc->ex_mii_active) { - rv = mii_m_getprop(sc->ex_miih, name, num, flags, sz, - val, perm); + rv = mii_m_getprop(sc->ex_miih, name, num, sz, val); if (rv != ENOTSUP) return (rv); } switch (num) { case MAC_PROP_DUPLEX: - *perm = MAC_PROP_PERM_READ; - *(uint8_t *)val = isdef ? LINK_DUPLEX_HALF : sc->ex_duplex; + *(uint8_t *)val = sc->ex_duplex; break; case MAC_PROP_SPEED: - *perm = MAC_PROP_PERM_READ; *(uint8_t *)val = sc->ex_speed; break; case MAC_PROP_STATUS: - *perm = MAC_PROP_PERM_READ; bcopy(&sc->ex_link, val, sizeof (link_state_t)); break; case MAC_PROP_PRIVATE: if (strcmp(name, "_media") == 0) { char *str; - *perm = MAC_PROP_PERM_RW; switch (sc->ex_xcvr) { case XCVR_SEL_AUTO: @@ -1456,7 +1454,6 @@ elxl_m_getprop(void *arg, const char *name, mac_prop_id_t num, uint_t flags, * MAC_PROP_POSSIBLE with private properties.) */ if (strcmp(name, "_available_media") == 0) { - *perm = MAC_PROP_PERM_READ; (void) snprintf(val, sz, "%s", sc->ex_medias); return (0); } @@ -1577,6 +1574,29 @@ reset: return (0); } +static void +elxl_m_propinfo(void *arg, const char *name, mac_prop_id_t num, + mac_prop_info_handle_t prh) +{ + elxl_t *sc = arg; + + if (sc->ex_mii_active) + mii_m_propinfo(sc->ex_miih, name, num, prh); + + switch (num) { + case MAC_PROP_DUPLEX: + case MAC_PROP_SPEED: + case MAC_PROP_STATUS: + mac_prop_info_set_perm(prh, MAC_PROP_PERM_READ); + break; + + case MAC_PROP_PRIVATE: + if (strcmp(name, "_available_media") == 0) + mac_prop_info_set_perm(prh, MAC_PROP_PERM_READ); + break; + } +} + static int elxl_m_stat(void *arg, uint_t stat, uint64_t *val) { |
