ADC Home > Reference Library > Reference > Darwin > Kernel Framework Reference

 


IOCardBusDevice

Inherits from:
Declared In:

Overview

Class that represents a 32-bit CardBus device.

Discussion

Introduction

After the discovery of a 32-bit PC Card, the PC Card Family creates and publishes an instance of the IOCardBusDevice provider nub.

The same driver should work for CardBus cards and PCI cards in most cases. For more information on writing CardBus drivers please refer to the documentation for writing PCI device drivers. It is recommended that CardBus drivers list their provider as IOPCIDevice instead of IOCardBusDevice to avoid having to pull in the PC Card Family if it is not required.

CardBus cards can be shut down from the menu bar or physically ejected. The driver will first receive a Card Services event through its message method before being terminated. If your driver can handle being unloaded by using the shell command "kextunload" it should also be ready and able to handle being ejected.

Types of Driver Matching Supported by IOCardBusDevice

Matching is done by comparing the driver's matching properties against information retrieved from the Configuration Space and its CIS information. In addition to what is provided by IOService and IOPCIDevice, the following matching is also supported:

"VersionOneInfo"

The "VersionOneInfo" property match is based on the CISTPL_VERS_1 tuple. It matches against an array of strings, where each string is one of the entries from the version one tuple. Trailing entries that are omitted from the driver's matching entry are treated as wild matches.



Functions

cardServices

Makes a call to Card Services.

getCardServicesHandle

Returns the Card Services client handle for this card.

getState

Returns the current state of the card.


cardServices


Makes a call to Card Services.

public

virtual int cardServices( int func, void *arg1 = 0, void *arg2 = 0, void *arg3 = 0);
Parameters
func

The Card Services function index.

arg1

Argument number one.

arg2

Argument number two.

arg3

Argument number three.

Return Value

See "IOKit/pccard/cs.h" for return codes.

Discussion

This method is used to directly make calls to Card Services. You should always call Card Services using this method. This will ensure that it is run on the correct IOPCCardBridge workloop. See the file "doc/PCMCIA-PROG" in the IOPCCardFamily Darwin project and header file "IOKit/pccard/cs.h" for more info.

In most cases, you should never need to use this method and its misuse will cause problems.


getCardServicesHandle


Returns the Card Services client handle for this card.

public

virtual client_handle_t getCardServicesHandle( void);
Return Value

Returns Card Services client handle. This should always be successful.

Discussion

This method returns the Card Services client handle for this card. This handle is created for the driver when the card was bound to Card Services. This handle is needed to make most Card Services calls. In most cases you should not need to use this method.


getState


Returns the current state of the card.

public

virtual u_int getState( void);
Return Value

Current state of card.

Discussion

This method returns the current state of the card.


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.

 

Last Updated: 2008-12-19