Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
bsg-lib.c File Reference
#include <linux/slab.h>
#include <linux/blkdev.h>
#include <linux/delay.h>
#include <linux/scatterlist.h>
#include <linux/bsg-lib.h>
#include <linux/export.h>
#include <scsi/scsi_cmnd.h>

Go to the source code of this file.

Functions

void bsg_job_done (struct bsg_job *job, int result, unsigned int reply_payload_rcv_len)
 
 EXPORT_SYMBOL_GPL (bsg_job_done)
 
void bsg_goose_queue (struct request_queue *q)
 
 EXPORT_SYMBOL_GPL (bsg_goose_queue)
 
void bsg_request_fn (struct request_queue *q)
 
 EXPORT_SYMBOL_GPL (bsg_request_fn)
 
: device to give bsg device

bsg_setup_queue - Create and add the bsg hooks so we can receive requests : device to attach bsg device to : request queue setup by caller

: bsg job handler : size of LLD data needed for each job

The caller should have setup the reuqest queue with bsg_request_fn as the request_fn.

int bsg_setup_queue (struct device *dev, struct request_queue *q, char *name, bsg_job_fn *job_fn, int dd_job_size)
 
 EXPORT_SYMBOL_GPL (bsg_setup_queue)
 

Function Documentation

void bsg_goose_queue ( struct request_queue q)

Definition at line 158 of file bsg-lib.c.

void bsg_job_done ( struct bsg_job job,
int  result,
unsigned int  reply_payload_rcv_len 
)

bsg_job_done - completion routine for bsg requests : bsg_job that is complete

Returns
: job reply result : length of payload recvd

The LLD should call this when the bsg job has completed.

Definition at line 52 of file bsg-lib.c.

void bsg_request_fn ( struct request_queue q)

bsg_request_fn - generic handler for bsg requests : request queue to manage

On error the create_bsg_job function should return a -Exyz error value that will be set to the req->errors.

Drivers/subsys should pass this to the queue init function.

Definition at line 176 of file bsg-lib.c.

int bsg_setup_queue ( struct device dev,
struct request_queue q,
char name,
bsg_job_fn *  job_fn,
int  dd_job_size 
)

Definition at line 224 of file bsg-lib.c.

EXPORT_SYMBOL_GPL ( bsg_job_done  )
EXPORT_SYMBOL_GPL ( bsg_goose_queue  )
EXPORT_SYMBOL_GPL ( bsg_request_fn  )
EXPORT_SYMBOL_GPL ( bsg_setup_queue  )