Author: imp
Date: Tue Mar  3 18:57:59 2009
New Revision: 189318
URL: http://svn.freebsd.org/changeset/base/189318

Log:
  Add in parsing of the disk FUNCE tuples.

Modified:
  head/sys/dev/pccard/pccard.c
  head/sys/dev/pccard/pccardvar.h
  head/sys/dev/pccard/pccardvarp.h

Modified: head/sys/dev/pccard/pccard.c
==============================================================================
--- head/sys/dev/pccard/pccard.c        Tue Mar  3 18:54:57 2009        
(r189317)
+++ head/sys/dev/pccard/pccard.c        Tue Mar  3 18:57:59 2009        
(r189318)
@@ -1066,6 +1066,10 @@ pccard_read_ivar(device_t bus, device_t 
        switch (which) {
        default:
                return (EINVAL);
+       case PCCARD_IVAR_FUNCE_DISK:
+               *(uint16_t *)result = pf->pf_funce_disk_interface |
+                   (pf->pf_funce_disk_power << 8);
+               break;
        case PCCARD_IVAR_ETHADDR:
                bcopy(pf->pf_funce_lan_nid, result, ETHER_ADDR_LEN);
                break;

Modified: head/sys/dev/pccard/pccardvar.h
==============================================================================
--- head/sys/dev/pccard/pccardvar.h     Tue Mar  3 18:54:57 2009        
(r189317)
+++ head/sys/dev/pccard/pccardvar.h     Tue Mar  3 18:57:59 2009        
(r189318)
@@ -194,7 +194,8 @@ enum {
        PCCARD_IVAR_PRODUCT_STR,/* CIS strnig for "Product" */
        PCCARD_IVAR_CIS3_STR,
        PCCARD_IVAR_CIS4_STR,
-       PCCARD_IVAR_FUNCTION
+       PCCARD_IVAR_FUNCTION,
+       PCCARD_IVAR_FUNCE_DISK
 };
 
 #define PCCARD_ACCESSOR(A, B, T)                                       \
@@ -211,6 +212,7 @@ PCCARD_ACCESSOR(product,    PRODUCT,                uint3
 PCCARD_ACCESSOR(prodext,       PRODEXT,                uint16_t)
 PCCARD_ACCESSOR(function_number,FUNCTION_NUMBER,       uint32_t)
 PCCARD_ACCESSOR(function,      FUNCTION,               uint32_t)
+PCCARD_ACCESSOR(funce_disk,    FUNCE_DISK,             uint16_t)
 PCCARD_ACCESSOR(vendor_str,    VENDOR_STR,             const char *)
 PCCARD_ACCESSOR(product_str,   PRODUCT_STR,            const char *)
 PCCARD_ACCESSOR(cis3_str,      CIS3_STR,               const char *)
@@ -250,3 +252,23 @@ enum {
                { NULL, PCMCIA_VENDOR_ ## v1, PCCARD_P(v1, p1), \
                  PCMCIA_CIS_ ## p2}
 #endif
+
+/*
+ * Defines to decoe the get_funce_disk return value.  See the PCMCIA standard
+ * for all the details of what these bits mean.
+ */
+#define        PFD_I_V_MASK            0x3
+#define PFD_I_V_NONE_REQUIRED  0x0
+#define PFD_I_V_REQ_MOD_ACC    0x1
+#define PFD_I_V_REQ_ACC                0x2
+#define PFD_I_V_REQ_ALWYS      0x1
+#define PFD_I_S                        0x4     /* 0 rotating, 1 silicon */
+#define PFD_I_U                        0x8     /* SN Uniq? */
+#define        PFD_I_D                 0x10    /* 0 - 1 drive, 1 - 2 drives */
+#define PFD_P_P0               0x100
+#define PFD_P_P1               0x200
+#define PFD_P_P2               0x400
+#define PFD_P_P3               0x800
+#define PFD_P_N                        0x1000  /* 3f7/377 excluded? */
+#define PFD_P_E                        0x2000  /* Index bit supported? */
+#define        PFD_P_I                 0x4000  /* twincard */

Modified: head/sys/dev/pccard/pccardvarp.h
==============================================================================
--- head/sys/dev/pccard/pccardvarp.h    Tue Mar  3 18:54:57 2009        
(r189317)
+++ head/sys/dev/pccard/pccardvarp.h    Tue Mar  3 18:57:59 2009        
(r189318)
@@ -76,22 +76,7 @@ struct pccard_config_entry {
 
 struct pccard_funce_disk {
        uint8_t pfd_interface;
-#define        PFD_I_V_MASK            0x3
-#define PFD_I_V_NONE_REQUIRED  0x0
-#define PFD_I_V_REQ_MOD_ACC    0x1
-#define PFD_I_V_REQ_ACC                0x2
-#define PFD_I_V_REQ_ALWYS      0x1
-#define PFD_I_S                        0x4     /* 0 rotating, 1 silicon */
-#define PFD_I_U                        0x8     /* SN Uniq? */
-#define        PFD_I_D                 0x10    /* 0 - 1 drive, 1 - 2 drives */
        uint8_t pfd_power;
-#define PFD_P_P0               0x1
-#define PFD_P_P1               0x2
-#define PFD_P_P2               0x4
-#define PFD_P_P3               0x8
-#define PFD_P_N                        0x10    /* 3f7/377 excluded? */
-#define PFD_P_E                        0x20    /* Index bit supported? */
-#define        PFD_P_I                 0x40    /* twincard */
 };
 
 struct pccard_funce_lan {
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to