Template Version: @(#)sac_nextcase %I% %G% SMI
This information is Copyright 2008 Sun Microsystems
1. Introduction
1.1. Project/Component Working Name:
brussels property permissions
1.2. Name of Document Author/Supplier:
Author: Vasumathi Sundaram
1.3 Date of This Document:
24 September, 2008
4. Technical Description
Brussels framework enhancements to get driver property permissions.
----------------------------------------------------------------
1. Summary
----------
This case proposes enhancements to the driver administration framework
to get the permissions for properties from the driver from the user-space
libdladm library.
Release binding: minor
2. Description
--------------
The permissions of the driver public and private properties may not
be known a priori to dladm. In addition, the permissions for a given
property varies based on the driver hardware. For example, the property
adv_1000hdx_cap is read/write on a e1000g ethernet card while it is
read-only on nge. To learn the right permissions based on the hardware,
dladm will have to send a system call to the driver to obtain the property
permissions.
The command dladm will display an additional permissions field. It obtains
the value of this field by calling the library interface
dladm_get_linkprop() with the required field set to the perms field, which
will be identified by DLADM_PROP_VAL_PERM defined in <libdllink.h>.
This enhancement is achieved by adding a new permissions field to
the dld_ioc_macprop_t data structure sent to the dld through a
DLDIOC_GETMACPROP ioctl.
The permissions associated with the property is obtained by passing
an additional parameter to the driver through the mc_getprop callback
function. The driver may then return permissions value of the property
in this new parameter. Details of the mc_getprop callback are described in
Section 4.
3. dld_ioc_macprop_t definition
-------------------------------
A new field called pr_perm_flags will be added to dld_ioc_macprop_t
structure in <sys/dld.h>. The new structure will be:
typedef struct dld_ioc_macprop_s {
int pr_version;
uint_t pr_flags;
datalink_id_t pr_linkid;
mac_prop_id_t pr_num;
uint_t pr_perm_flags;
char pr_name[MAXLINKPROPNAME];
uint_t pr_valsize; /* sizeof pr_val */
char pr_val[1];
} dld_ioc_macprop_t;
4. mc_getprop callback definition
---------------------------------
The prototype for the mc_getprop callback function defined in <sys/mac.h>
will be as follows:
typedef int (*mac_get_prop_t)(void *arg, const char *pr_name,
mac_prop_id_t pr_num, uint_t pr_flags,
uint_t pr_valsize, void *pr_val,
uint_t *perms);
where the driver should return the applicable permissions for the property
identified by the parameters pr_name/pr_num in the perms value.
The values taken by perms must be one of MAC_PROP_PERM_READ or
MAC_PROP_PERM_RW defined in <sys/mac.h>.
By default, the mac layer will return (MAC_PROP_PERM_RW) unless the
driver over-rides it.
5. Interface Table
------------------
| Interfaces Exported |
|_________________________|_______________________|_________________________|
| Interface | Classification | Comments |
|_________________________|_______________________|_________________________|
| *(mac_get_prop_t)() | Consolidation Private | <mac.h> (modified) |
| | | |
| dld_ioc_macprop_t | Consolidation Private | <dld.h> (modified) |
| | | |
| DLADM_PROP_VAL_PERM | Consolidation Private | <libdllink.h> |
6. Proposed man page changes
----------------------------
--- dladm.old Fri Sep 19 12:05:59 2008
+++ dladm.new Fri Sep 19 12:19:16 2008
@@ -1697,6 +1697,11 @@
The name of the property.
+ PERMS
+
+ The read/write permissions of the property. The
+ value shown is one of "ro" or "rw".
+
VALUE
The current (or persistent) property value. If
A sample output is as follows:
LINK PROPERTY PERMS VALUE DEFAULT POSSIBLE
bge0 speed ro 1000 -- --
bge0 flowctrl rw bi bi no,tx,rx,bi
6. Resources and Schedule
6.4. Steering Committee requested information
6.4.1. Consolidation C-team Name:
ON
6.5. ARC review type: FastTrack
6.6. ARC Exposure: open