summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2003-08-09 20:49:22 +0000
committerimp <imp@FreeBSD.org>2003-08-09 20:49:22 +0000
commite21ea1cb1ed093b94c182384c779973b56867c14 (patch)
treed17d7a61411456618770dab8b2abd63f519eb70d /sys/dev
parentf318bbf9d2ecca80486c91cf0a8855ede363195e (diff)
downloadFreeBSD-src-e21ea1cb1ed093b94c182384c779973b56867c14.zip
FreeBSD-src-e21ea1cb1ed093b94c182384c779973b56867c14.tar.gz
CBB_SOCKET_STAT_ is too long. Change it to CBB_STATE_. Also, make
some minor changes to more closely match the bit names used in the 7.0 version of the PCMCIA standard. Also add bits from the FORCE register.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pccbb/pccbb.c24
-rw-r--r--sys/dev/pccbb/pccbbreg.h51
2 files changed, 44 insertions, 31 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c
index 81b8b4e..357835c 100644
--- a/sys/dev/pccbb/pccbb.c
+++ b/sys/dev/pccbb/pccbb.c
@@ -950,7 +950,7 @@ cbb_event_thread(void *arg)
*/
mtx_lock(&Giant);
status = cbb_get(sc, CBB_SOCKET_STATE);
- if ((status & CBB_SOCKET_STAT_CD) == 0)
+ if ((status & CBB_STATE_CD) == 0)
cbb_insert(sc);
else
cbb_removal(sc);
@@ -1001,11 +1001,11 @@ cbb_insert(struct cbb_softc *sc)
DEVPRINTF((sc->dev, "card inserted: event=0x%08x, state=%08x\n",
sockevent, sockstate));
- if (sockstate & CBB_SOCKET_STAT_16BIT) {
+ if (sockstate & CBB_STATE_R2_CARD) {
if (sc->exca.pccarddev)
sc->flags |= CBB_16BIT_CARD | CBB_CARD_OK;
exca_insert(&sc->exca);
- } else if (sockstate & CBB_SOCKET_STAT_CB) {
+ } else if (sockstate & CBB_STATE_CB_CARD) {
if (sc->cbdev != NULL) {
sc->flags &= ~CBB_16BIT_CARD;
sc->flags |= CBB_CARD_OK;
@@ -1110,13 +1110,13 @@ cbb_detect_voltage(device_t brdev)
psr = cbb_get(sc, CBB_SOCKET_STATE);
- if (psr & CBB_SOCKET_STAT_5VCARD)
+ if (psr & CBB_STATE_5VCARD)
vol |= CARD_5V_CARD;
- if (psr & CBB_SOCKET_STAT_3VCARD)
+ if (psr & CBB_STATE_3VCARD)
vol |= CARD_3V_CARD;
- if (psr & CBB_SOCKET_STAT_XVCARD)
+ if (psr & CBB_STATE_XVCARD)
vol |= CARD_XV_CARD;
- if (psr & CBB_SOCKET_STAT_YVCARD)
+ if (psr & CBB_STATE_YVCARD)
vol |= CARD_YV_CARD;
return (vol);
@@ -1240,7 +1240,7 @@ cbb_power(device_t brdev, int volts)
*/
DELAY(400*1000);
- if (status & CBB_SOCKET_STAT_BADVCC) {
+ if (status & CBB_STATE_BAD_VCC_REQ) {
device_printf(sc->dev,
"bad Vcc request. ctrl=0x%x, status=0x%x\n",
sock_ctrl ,status);
@@ -1300,7 +1300,7 @@ cbb_cardbus_reset(device_t brdev)
DELAY(delay_us);
/* If a card exists, unreset it! */
- if ((cbb_get(sc, CBB_SOCKET_STATE) & CBB_SOCKET_STAT_CD) == 0) {
+ if ((cbb_get(sc, CBB_SOCKET_STATE) & CBB_STATE_CD) == 0) {
PCI_MASK_CONFIG(brdev, CBBR_BRIDGECTRL,
&~CBBM_BRIDGECTRL_RESET, 2);
DELAY(delay_us);
@@ -1313,8 +1313,8 @@ cbb_cardbus_power_enable_socket(device_t brdev, device_t child)
struct cbb_softc *sc = device_get_softc(brdev);
int err;
- if ((cbb_get(sc, CBB_SOCKET_STATE) & CBB_SOCKET_STAT_CD) ==
- CBB_SOCKET_STAT_CD)
+ if ((cbb_get(sc, CBB_SOCKET_STATE) & CBB_STATE_CD) ==
+ CBB_STATE_CD)
return (ENODEV);
err = cbb_do_power(brdev);
@@ -1964,7 +1964,7 @@ cbb_child_present(device_t self)
uint32_t sockstate;
sockstate = cbb_get(sc, CBB_SOCKET_STATE);
- return ((sockstate & CBB_SOCKET_STAT_CD) != 0 &&
+ return ((sockstate & CBB_STATE_CD) != 0 &&
(sc->flags & CBB_CARD_OK) != 0);
}
diff --git a/sys/dev/pccbb/pccbbreg.h b/sys/dev/pccbb/pccbbreg.h
index ef1f21d..fddf467 100644
--- a/sys/dev/pccbb/pccbbreg.h
+++ b/sys/dev/pccbb/pccbbreg.h
@@ -185,25 +185,25 @@
#define CBB_SOCKET_MASK_POWER 0x08 /* Power Cycle */
#define CBB_SOCKET_MASK_ALL 0x0F /* all of the above */
-#define CBB_SOCKET_STAT_CARDSTS 0x00000001 /* Card Status Change */
-#define CBB_SOCKET_STAT_CD1 0x00000002 /* Card Detect 1 */
-#define CBB_SOCKET_STAT_CD2 0x00000004 /* Card Detect 2 */
-#define CBB_SOCKET_STAT_CD 0x00000006 /* Card Detect all */
-#define CBB_SOCKET_STAT_PWRCYCLE 0x00000008 /* Power Cycle */
-#define CBB_SOCKET_STAT_16BIT 0x00000010 /* 16-bit Card */
-#define CBB_SOCKET_STAT_CB 0x00000020 /* Cardbus Card */
-#define CBB_SOCKET_STAT_IREQ 0x00000040 /* Ready */
-#define CBB_SOCKET_STAT_NOTCARD 0x00000080 /* Unrecognized Card */
-#define CBB_SOCKET_STAT_DATALOST 0x00000100 /* Data Lost */
-#define CBB_SOCKET_STAT_BADVCC 0x00000200 /* Bad VccRequest */
-#define CBB_SOCKET_STAT_5VCARD 0x00000400 /* 5 V Card */
-#define CBB_SOCKET_STAT_3VCARD 0x00000800 /* 3.3 V Card */
-#define CBB_SOCKET_STAT_XVCARD 0x00001000 /* X.X V Card */
-#define CBB_SOCKET_STAT_YVCARD 0x00002000 /* Y.Y V Card */
-#define CBB_SOCKET_STAT_5VSOCK 0x10000000 /* 5 V Socket */
-#define CBB_SOCKET_STAT_3VSOCK 0x20000000 /* 3.3 V Socket */
-#define CBB_SOCKET_STAT_XVSOCK 0x40000000 /* X.X V Socket */
-#define CBB_SOCKET_STAT_YVSOCK 0x80000000 /* Y.Y V Socket */
+#define CBB_STATE_CSTCHG (1UL << 0) /* Card Status Change */
+#define CBB_STATE_CD1_CHANGE (1UL << 1) /* Card Detect 1 */
+#define CBB_STATE_CD2_CHANGE (1UL << 2) /* Card Detect 2 */
+#define CBB_STATE_CD (3UL << 1) /* Card Detect all */
+#define CBB_STATE_POWER_CYCLE (1UL << 3) /* Power Cycle */
+#define CBB_STATE_R2_CARD (1UL << 4) /* 16-bit Card */
+#define CBB_STATE_CB_CARD (1UL << 5) /* Cardbus Card */
+#define CBB_STATE_IREQ (1UL << 6) /* Ready */
+#define CBB_STATE_NOT_A_CARD (1UL << 7) /* Unrecognized Card */
+#define CBB_STATE_DATA_LOST (1UL << 8) /* Data Lost */
+#define CBB_STATE_BAD_VCC_REQ (1UL << 9) /* Bad VccRequest */
+#define CBB_STATE_5VCARD (1UL << 10) /* 5 V Card */
+#define CBB_STATE_3VCARD (1UL << 11) /* 3.3 V Card */
+#define CBB_STATE_XVCARD (1UL << 12) /* X.X V Card */
+#define CBB_STATE_YVCARD (1UL << 13) /* Y.Y V Card */
+#define CBB_STATE_5VSOCK (1UL << 28) /* 5 V Socket */
+#define CBB_STATE_3VSOCK (1UL << 29) /* 3.3 V Socket */
+#define CBB_STATE_XVSOCK (1UL << 30) /* X.X V Socket */
+#define CBB_STATE_YVSOCK (1UL << 31) /* Y.Y V Socket */
#define CBB_SOCKET_CTRL_VPPMASK 0x07
#define CBB_SOCKET_CTRL_VPP_OFF 0x00
@@ -222,6 +222,19 @@
#define CBB_SOCKET_CTRL_STOPCLK 0x80
+#define CBB_FORCE_CV_TEST (1UL << 14)
+#define CBB_FORCE_3VCARD (1UL << 11)
+#define CBB_FORCE_5VCARD (1UL << 10)
+#define CBB_FORCE_BAD_VCC_REQ (1UL << 9)
+#define CBB_FORCE_DATA_LOST (1UL << 8)
+#define CBB_FORCE_NOT_A_CARD (1UL << 7)
+#define CBB_FORCE_CB_CARD (1UL << 5)
+#define CBB_FORCE_R2_CARD (1UL << 4)
+#define CBB_FORCE_POWER_CYCLE (1UL << 3)
+#define CBB_FORCE_CD2_CHANGE (1UL << 2)
+#define CBB_FORCE_CD1_CHANGE (1UL << 1)
+#define CBB_FORCE_CSTCHG (1UL << 0)
+
#include <dev/pccbb/pccbbdevid.h>
#define CBB_SOCKET_EVENT 0x00
OpenPOWER on IntegriCloud