Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
commsup.c File Reference
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/pci.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/completion.h>
#include <linux/blkdev.h>
#include <linux/delay.h>
#include <linux/kthread.h>
#include <linux/interrupt.h>
#include <linux/semaphore.h>
#include <scsi/scsi.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_cmnd.h>
#include "aacraid.h"

Go to the source code of this file.

Macros

#define AIF_SNIFF_TIMEOUT   (30*HZ)
 

Functions

void aac_fib_map_free (struct aac_dev *dev)
 
int aac_fib_setup (struct aac_dev *dev)
 
struct fibaac_fib_alloc (struct aac_dev *dev)
 
void aac_fib_free (struct fib *fibptr)
 
void aac_fib_init (struct fib *fibptr)
 
int aac_queue_get (struct aac_dev *dev, u32 *index, u32 qid, struct hw_fib *hw_fib, int wait, struct fib *fibptr, unsigned long *nonotify)
 
int aac_fib_send (u16 command, struct fib *fibptr, unsigned long size, int priority, int wait, int reply, fib_callback callback, void *callback_data)
 
int aac_consumer_get (struct aac_dev *dev, struct aac_queue *q, struct aac_entry **entry)
 
void aac_consumer_free (struct aac_dev *dev, struct aac_queue *q, u32 qid)
 
int aac_fib_adapter_complete (struct fib *fibptr, unsigned short size)
 
int aac_fib_complete (struct fib *fibptr)
 
void aac_printf (struct aac_dev *dev, u32 val)
 
int aac_reset_adapter (struct aac_dev *aac, int forced)
 
int aac_check_health (struct aac_dev *aac)
 
int aac_command_thread (void *data)
 

Macro Definition Documentation

#define AIF_SNIFF_TIMEOUT   (30*HZ)

aac_handle_aif - Handle a message from the firmware : Which adapter this fib is from : Pointer to fibptr from adapter

This routine handles a driver notify fib from the adapter and dispatches it to the appropriate routine for handling.

Definition at line 871 of file commsup.c.

Function Documentation

int aac_check_health ( struct aac_dev aac)

Definition at line 1484 of file commsup.c.

int aac_command_thread ( void data)

aac_command_thread - command processing thread : Adapter to monitor

Waits on the commandready event in it's queue. When the event gets set it will pull FIBs off it's queue. It will continue to pull FIBs off until the queue is empty. When the queue is empty it will wait for more FIBs.

Definition at line 1628 of file commsup.c.

void aac_consumer_free ( struct aac_dev dev,
struct aac_queue q,
u32  qid 
)

aac_consumer_free - free consumer entry : Adapter : Queue : Queue ident

Frees up the current top of the queue we are a consumer of. If the queue was full notify the producer that the queue is no longer full.

Definition at line 666 of file commsup.c.

int aac_consumer_get ( struct aac_dev dev,
struct aac_queue q,
struct aac_entry **  entry 
)

aac_consumer_get - get the top of the queue : Adapter : Queue : Return entry

Will return a pointer to the entry on the top of the queue requested that we are a consumer of, and return the address of the queue entry. It does not change the state of the queue.

Definition at line 634 of file commsup.c.

int aac_fib_adapter_complete ( struct fib fibptr,
unsigned short  size 
)

aac_fib_adapter_complete - complete adapter issued fib : fib to complete : size of fib

Will do all necessary work to complete a FIB that was sent from the adapter.

Definition at line 705 of file commsup.c.

struct fib* aac_fib_alloc ( struct aac_dev dev)
read

aac_fib_alloc - allocate a fib : Adapter to allocate the fib for

Allocate a fib from the adapter fib pool. If the pool is empty we return NULL.

Definition at line 173 of file commsup.c.

int aac_fib_complete ( struct fib fibptr)

aac_fib_complete - fib completion handler : FIB to complete

Will do all necessary work to complete a FIB.

Definition at line 776 of file commsup.c.

void aac_fib_free ( struct fib fibptr)

aac_fib_free - free a fib : fib to free up

Frees up a fib and places it on the appropriate queue

Definition at line 209 of file commsup.c.

void aac_fib_init ( struct fib fibptr)

aac_fib_init - initialise a fib : The fib to initialize

Set up the generic fib fields ready for use

Definition at line 240 of file commsup.c.

void aac_fib_map_free ( struct aac_dev dev)

aac_fib_map_free - free the fib objects : Adapter to free

Free the PCI mappings and the memory allocated for FIB blocks on this adapter.

Definition at line 84 of file commsup.c.

int aac_fib_send ( u16  command,
struct fib fibptr,
unsigned long  size,
int  priority,
int  wait,
int  reply,
fib_callback  callback,
void callback_data 
)

aac_fib_send - send a fib to the adapter : Command to send : The fib : Size of fib data area : Priority of Fib : Async/sync select : True if a reply is wanted : Called with reply : Passed to callback

Sends the requested FIB to the adapter and optionally will wait for a response FIB. If the caller does not wish to wait for a response than an event to wait on must be supplied. This event will be set when a response FIB is received from the adapter.

Definition at line 410 of file commsup.c.

int aac_fib_setup ( struct aac_dev dev)

aac_fib_setup - setup the fibs : Adapter to set up

Allocate the PCI space for the fibs, map it and then initialise the fib area, the unmapped fib data and also the free list

Definition at line 101 of file commsup.c.

void aac_printf ( struct aac_dev dev,
u32  val 
)

aac_printf - handle printf from firmware : Adapter : Message info

Print a message passed to us by the controller firmware on the Adaptec board

Definition at line 837 of file commsup.c.

int aac_queue_get ( struct aac_dev dev,
u32 index,
u32  qid,
struct hw_fib hw_fib,
int  wait,
struct fib fibptr,
unsigned long nonotify 
)

aac_queue_get - get the next free QE : Adapter : Returned index : Priority of fib : Fib to associate with the queue entry : Wait if queue full : Driver fib object to go with fib : Don't notify the adapter

Gets the next free QE off the requested priorty adapter command queue and associates the Fib with the QE. The QE represented by index is ready to insert on the queue when this routine returns success.

Definition at line 348 of file commsup.c.

int aac_reset_adapter ( struct aac_dev aac,
int  forced 
)

Definition at line 1391 of file commsup.c.