~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/staging/ath6kl/include/hif.h

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
 
40
40
typedef struct htc_callbacks HTC_CALLBACKS;
41
 
typedef struct hif_device HIF_DEVICE;
 
41
struct hif_device;
42
42
 
43
43
/*
44
44
 * direction - Direction of transfer (HIF_READ/HIF_WRITE).
153
153
 *
154
154
 *   HIF_DEVICE_GET_MBOX_ADDR
155
155
 *   input : none
156
 
 *   output : HIF_DEVICE_MBOX_INFO
 
156
 *   output : struct hif_device_mbox_info
157
157
 *   notes: 
158
158
 *
159
159
 *   HIF_DEVICE_GET_PENDING_EVENTS_FUNC
190
190
 *   HIF_DEVICE_GET_IRQ_YIELD_PARAMS
191
191
 * 
192
192
 *   input : none
193
 
 *   output : HIF_DEVICE_IRQ_YIELD_PARAMS
 
193
 *   output : struct hif_device_irq_yield_params
194
194
 *   note: This query checks if the HIF layer wishes to impose a processing yield count for the DSR handler.
195
195
 *   The DSR callback handler will exit after a fixed number of RX packets or events are processed.  
196
196
 *   This query is only made if the device reports an IRQ processing mode of HIF_DEVICE_IRQ_SYNC_ONLY. 
203
203
 *   
204
204
 *   HIF_CONFIGURE_QUERY_SCATTER_REQUEST_SUPPORT
205
205
 *   input : none
206
 
 *   output : HIF_DEVICE_SCATTER_SUPPORT_INFO
 
206
 *   output : struct hif_device_scatter_support_info
207
207
 *   note:  This query checks if the HIF layer implements the SCATTER request interface.  Scatter requests
208
208
 *   allows upper layers to submit mailbox I/O operations using a list of buffers.  This is useful for
209
209
 *   multi-message transfers that can better utilize the bus interconnect.
211
211
 * 
212
212
 *   HIF_DEVICE_GET_OS_DEVICE
213
213
 *   intput : none
214
 
 *   output : HIF_DEVICE_OS_DEVICE_INFO;
 
214
 *   output : struct hif_device_os_device_info;
215
215
 *   note: On some operating systems, the HIF layer has a parent device object for the bus.  This object
216
216
 *         may be required to register certain types of logical devices.
217
217
 * 
223
223
 * 
224
224
 */
225
225
 
226
 
typedef struct {
227
 
    A_UINT32    ExtendedAddress;  /* extended address for larger writes */  
228
 
    A_UINT32    ExtendedSize;
229
 
} HIF_MBOX_PROPERTIES;
 
226
struct hif_mbox_properties {
 
227
    u32 ExtendedAddress;  /* extended address for larger writes */
 
228
    u32 ExtendedSize;
 
229
};
230
230
 
231
231
#define HIF_MBOX_FLAG_NO_BUNDLING   (1 << 0)   /* do not allow bundling over the mailbox */
232
232
 
235
235
    MBOX_BUS_IF_SPI = 1,    
236
236
} MBOX_BUF_IF_TYPE;
237
237
 
238
 
typedef struct {
239
 
    A_UINT32 MboxAddresses[4];  /* must be first element for legacy HIFs that return the address in  
 
238
struct hif_device_mbox_info {
 
239
    u32 MboxAddresses[4];  /* must be first element for legacy HIFs that return the address in
240
240
                                   and ARRAY of 32-bit words */
241
241
    
242
242
        /* the following describe extended mailbox properties */
243
 
    HIF_MBOX_PROPERTIES MboxProp[4];
 
243
    struct hif_mbox_properties MboxProp[4];
244
244
        /* if the HIF supports the GMbox extended address region it can report it
245
245
         * here, some interfaces cannot support the GMBOX address range and not set this */
246
 
    A_UINT32 GMboxAddress;  
247
 
    A_UINT32 GMboxSize;
248
 
    A_UINT32 Flags;             /* flags to describe mbox behavior or usage */
 
246
    u32 GMboxAddress;
 
247
    u32 GMboxSize;
 
248
    u32 Flags;             /* flags to describe mbox behavior or usage */
249
249
    MBOX_BUF_IF_TYPE MboxBusIFType;   /* mailbox bus interface type */
250
 
} HIF_DEVICE_MBOX_INFO;
 
250
};
251
251
 
252
252
typedef enum {
253
253
    HIF_DEVICE_IRQ_SYNC_ONLY,   /* for HIF implementations that require the DSR to process all
265
265
                            */
266
266
} HIF_DEVICE_POWER_CHANGE_TYPE;
267
267
 
268
 
typedef struct {
 
268
struct hif_device_irq_yield_params {
269
269
    int     RecvPacketYieldCount; /* max number of packets to force DSR to return */
270
 
} HIF_DEVICE_IRQ_YIELD_PARAMS;
271
 
 
272
 
 
273
 
typedef struct _HIF_SCATTER_ITEM {
274
 
    A_UINT8     *pBuffer;             /* CPU accessible address of buffer */
 
270
};
 
271
 
 
272
 
 
273
struct hif_scatter_item {
 
274
    u8 *pBuffer;             /* CPU accessible address of buffer */
275
275
    int          Length;              /* length of transfer to/from this buffer */
276
276
    void        *pCallerContexts[2];  /* space for caller to insert a context associated with this item */
277
 
} HIF_SCATTER_ITEM;
278
 
 
279
 
struct _HIF_SCATTER_REQ;
280
 
 
281
 
typedef void ( *HIF_SCATTER_COMP_CB)(struct _HIF_SCATTER_REQ *);
 
277
};
 
278
 
 
279
struct hif_scatter_req;
 
280
typedef void ( *HIF_SCATTER_COMP_CB)(struct hif_scatter_req *);
282
281
 
283
282
typedef enum _HIF_SCATTER_METHOD {
284
283
    HIF_SCATTER_NONE = 0,
286
285
    HIF_SCATTER_DMA_BOUNCE,            /* Uses SG DMA but HIF layer uses an internal bounce buffer */    
287
286
} HIF_SCATTER_METHOD;
288
287
 
289
 
typedef struct _HIF_SCATTER_REQ {
290
 
    DL_LIST             ListLink;           /* link management */
291
 
    A_UINT32            Address;            /* address for the read/write operation */
292
 
    A_UINT32            Request;            /* request flags */
293
 
    A_UINT32            TotalLength;        /* total length of entire transfer */
294
 
    A_UINT32            CallerFlags;        /* caller specific flags can be stored here */
 
288
struct hif_scatter_req {
 
289
    struct dl_list             ListLink;           /* link management */
 
290
    u32 Address;            /* address for the read/write operation */
 
291
    u32 Request;            /* request flags */
 
292
    u32 TotalLength;        /* total length of entire transfer */
 
293
    u32 CallerFlags;        /* caller specific flags can be stored here */
295
294
    HIF_SCATTER_COMP_CB CompletionRoutine;  /* completion routine set by caller */
296
 
    A_STATUS            CompletionStatus;   /* status of completion */
 
295
    int            CompletionStatus;   /* status of completion */
297
296
    void                *Context;           /* caller context for this request */
298
297
    int                 ValidScatterEntries;  /* number of valid entries set by caller */
299
298
    HIF_SCATTER_METHOD  ScatterMethod;        /* scatter method handled by HIF */  
300
299
    void                *HIFPrivate[4];     /* HIF private area */
301
 
    A_UINT8             *pScatterBounceBuffer;  /* bounce buffer for upper layers to copy to/from */
302
 
    HIF_SCATTER_ITEM    ScatterList[1];     /* start of scatter list */
303
 
} HIF_SCATTER_REQ;
304
 
 
305
 
typedef HIF_SCATTER_REQ * ( *HIF_ALLOCATE_SCATTER_REQUEST)(HIF_DEVICE *device);
306
 
typedef void ( *HIF_FREE_SCATTER_REQUEST)(HIF_DEVICE *device, HIF_SCATTER_REQ *request);
307
 
typedef A_STATUS ( *HIF_READWRITE_SCATTER)(HIF_DEVICE *device, HIF_SCATTER_REQ *request);
308
 
 
309
 
typedef struct _HIF_DEVICE_SCATTER_SUPPORT_INFO {
 
300
    u8 *pScatterBounceBuffer;  /* bounce buffer for upper layers to copy to/from */
 
301
    struct hif_scatter_item    ScatterList[1];     /* start of scatter list */
 
302
};
 
303
 
 
304
typedef struct hif_scatter_req * ( *HIF_ALLOCATE_SCATTER_REQUEST)(struct hif_device *device);
 
305
typedef void ( *HIF_FREE_SCATTER_REQUEST)(struct hif_device *device, struct hif_scatter_req *request);
 
306
typedef int ( *HIF_READWRITE_SCATTER)(struct hif_device *device, struct hif_scatter_req *request);
 
307
 
 
308
struct hif_device_scatter_support_info {
310
309
        /* information returned from HIF layer */
311
310
    HIF_ALLOCATE_SCATTER_REQUEST    pAllocateReqFunc;
312
311
    HIF_FREE_SCATTER_REQUEST        pFreeReqFunc;
313
312
    HIF_READWRITE_SCATTER           pReadWriteScatterFunc;    
314
313
    int                             MaxScatterEntries;
315
314
    int                             MaxTransferSizePerScatterReq;
316
 
} HIF_DEVICE_SCATTER_SUPPORT_INFO;
 
315
};
317
316
                      
318
 
typedef struct {
 
317
struct hif_device_os_device_info {
319
318
    void    *pOSDevice;
320
 
} HIF_DEVICE_OS_DEVICE_INFO;
 
319
};
321
320
                      
322
321
#define HIF_MAX_DEVICES                 1
323
322
 
324
323
struct htc_callbacks {
325
324
    void      *context;     /* context to pass to the dsrhandler
326
325
                               note : rwCompletionHandler is provided the context passed to HIFReadWrite  */
327
 
    A_STATUS (* rwCompletionHandler)(void *rwContext, A_STATUS status);
328
 
    A_STATUS (* dsrHandler)(void *context);
 
326
    int (* rwCompletionHandler)(void *rwContext, int status);
 
327
    int (* dsrHandler)(void *context);
329
328
};
330
329
 
331
330
typedef struct osdrv_callbacks {
332
331
    void      *context;     /* context to pass for all callbacks except deviceRemovedHandler 
333
332
                               the deviceRemovedHandler is only called if the device is claimed */
334
 
    A_STATUS (* deviceInsertedHandler)(void *context, void *hif_handle);
335
 
    A_STATUS (* deviceRemovedHandler)(void *claimedContext, void *hif_handle);
336
 
    A_STATUS (* deviceSuspendHandler)(void *context);
337
 
    A_STATUS (* deviceResumeHandler)(void *context);
338
 
    A_STATUS (* deviceWakeupHandler)(void *context);  
339
 
    A_STATUS (* devicePowerChangeHandler)(void *context, HIF_DEVICE_POWER_CHANGE_TYPE config);  
 
333
    int (* deviceInsertedHandler)(void *context, void *hif_handle);
 
334
    int (* deviceRemovedHandler)(void *claimedContext, void *hif_handle);
 
335
    int (* deviceSuspendHandler)(void *context);
 
336
    int (* deviceResumeHandler)(void *context);
 
337
    int (* deviceWakeupHandler)(void *context);
 
338
    int (* devicePowerChangeHandler)(void *context, HIF_DEVICE_POWER_CHANGE_TYPE config);
340
339
} OSDRV_CALLBACKS;
341
340
 
342
341
#define HIF_OTHER_EVENTS     (1 << 0)   /* other interrupts (non-Recv) are pending, host
343
342
                                           needs to read the register table to figure out what */
344
343
#define HIF_RECV_MSG_AVAIL   (1 << 1)   /* pending recv packet */
345
344
 
346
 
typedef struct _HIF_PENDING_EVENTS_INFO {
347
 
    A_UINT32 Events;
348
 
    A_UINT32 LookAhead;
349
 
    A_UINT32 AvailableRecvBytes;
 
345
struct hif_pending_events_info {
 
346
    u32 Events;
 
347
    u32 LookAhead;
 
348
    u32 AvailableRecvBytes;
350
349
#ifdef THREAD_X
351
 
    A_UINT32 Polling;
352
 
    A_UINT32 INT_CAUSE_REG;
 
350
    u32 Polling;
 
351
    u32 INT_CAUSE_REG;
353
352
#endif
354
 
} HIF_PENDING_EVENTS_INFO;
 
353
};
355
354
 
356
355
    /* function to get pending events , some HIF modules use special mechanisms
357
356
     * to detect packet available and other interrupts */
358
 
typedef A_STATUS ( *HIF_PENDING_EVENTS_FUNC)(HIF_DEVICE              *device,
359
 
                                             HIF_PENDING_EVENTS_INFO *pEvents,
 
357
typedef int ( *HIF_PENDING_EVENTS_FUNC)(struct hif_device              *device,
 
358
                                             struct hif_pending_events_info *pEvents,
360
359
                                             void                    *AsyncContext);
361
360
 
362
 
#define HIF_MASK_RECV    TRUE
363
 
#define HIF_UNMASK_RECV  FALSE
 
361
#define HIF_MASK_RECV    true
 
362
#define HIF_UNMASK_RECV  false
364
363
    /* function to mask recv events */
365
 
typedef A_STATUS ( *HIF_MASK_UNMASK_RECV_EVENT)(HIF_DEVICE  *device,
366
 
                                                A_BOOL      Mask,
 
364
typedef int ( *HIF_MASK_UNMASK_RECV_EVENT)(struct hif_device  *device,
 
365
                                                bool      Mask,
367
366
                                                void        *AsyncContext);
368
367
 
369
368
 
372
371
 * and to set OS driver callbacks (i.e. insertion/removal) to the HIF layer
373
372
 * 
374
373
 */
375
 
A_STATUS HIFInit(OSDRV_CALLBACKS *callbacks);
 
374
int HIFInit(OSDRV_CALLBACKS *callbacks);
376
375
 
377
376
/* This API claims the HIF device and provides a context for handling removal.
378
377
 * The device removal callback is only called when the OSDRV layer claims
379
378
 * a device.  The claimed context must be non-NULL */
380
 
void HIFClaimDevice(HIF_DEVICE *device, void *claimedContext);
 
379
void HIFClaimDevice(struct hif_device *device, void *claimedContext);
381
380
/* release the claimed device */
382
 
void HIFReleaseDevice(HIF_DEVICE *device);
 
381
void HIFReleaseDevice(struct hif_device *device);
383
382
 
384
383
/* This API allows the HTC layer to attach to the HIF device */
385
 
A_STATUS HIFAttachHTC(HIF_DEVICE *device, HTC_CALLBACKS *callbacks);
 
384
int HIFAttachHTC(struct hif_device *device, HTC_CALLBACKS *callbacks);
386
385
/* This API detaches the HTC layer from the HIF device */
387
 
void     HIFDetachHTC(HIF_DEVICE *device);
 
386
void     HIFDetachHTC(struct hif_device *device);
388
387
 
389
388
/*
390
389
 * This API is used to provide the read/write interface over the specific bus
398
397
 * length - Amount of data to be transmitted or received.
399
398
 * request - Characterizes the attributes of the command.
400
399
 */
401
 
A_STATUS
402
 
HIFReadWrite(HIF_DEVICE    *device,
403
 
             A_UINT32       address,
404
 
             A_UCHAR       *buffer,
405
 
             A_UINT32       length,
406
 
             A_UINT32       request,
 
400
int
 
401
HIFReadWrite(struct hif_device    *device,
 
402
             u32 address,
 
403
             u8       *buffer,
 
404
             u32 length,
 
405
             u32 request,
407
406
             void          *context);
408
407
 
409
408
/*
410
409
 * This can be initiated from the unload driver context when the OSDRV layer has no more use for
411
410
 * the device.
412
411
 */
413
 
void HIFShutDownDevice(HIF_DEVICE *device);
 
412
void HIFShutDownDevice(struct hif_device *device);
414
413
 
415
414
/*
416
415
 * This should translate to an acknowledgment to the bus driver indicating that
419
418
 * This should prevent the bus driver from raising an interrupt unless the
420
419
 * previous one has been serviced and acknowledged using the previous API.
421
420
 */
422
 
void HIFAckInterrupt(HIF_DEVICE *device);
423
 
 
424
 
void HIFMaskInterrupt(HIF_DEVICE *device);
425
 
 
426
 
void HIFUnMaskInterrupt(HIF_DEVICE *device);
 
421
void HIFAckInterrupt(struct hif_device *device);
 
422
 
 
423
void HIFMaskInterrupt(struct hif_device *device);
 
424
 
 
425
void HIFUnMaskInterrupt(struct hif_device *device);
427
426
 
428
427
#ifdef THREAD_X
429
428
/*
441
440
int HIFRWCompleteEventNotify(void);
442
441
#endif
443
442
 
444
 
A_STATUS
445
 
HIFConfigureDevice(HIF_DEVICE *device, HIF_DEVICE_CONFIG_OPCODE opcode,
446
 
                   void *config, A_UINT32 configLen);
 
443
int
 
444
HIFConfigureDevice(struct hif_device *device, HIF_DEVICE_CONFIG_OPCODE opcode,
 
445
                   void *config, u32 configLen);
447
446
 
448
447
/* 
449
448
 * This API wait for the remaining MBOX messages to be drained
450
449
 * This should be moved to HTC AR6K layer
451
450
 */
452
 
A_STATUS hifWaitForPendingRecv(HIF_DEVICE *device);
 
451
int hifWaitForPendingRecv(struct hif_device *device);
453
452
 
454
453
#ifdef __cplusplus
455
454
}