Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107097
b: refs/heads/master
c: ed0dbee
h: refs/heads/master
i:
  107095: 3415e80
v: v3
  • Loading branch information
Iwo Mergler authored and John W. Linville committed Jul 29, 2008
1 parent b90d358 commit a956e93
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f2fdbc4847e0d3991474949f21aa439c361391db
refs/heads/master: ed0dbeeb92bdb1030bcec67e20b294bd2020cb31
32 changes: 32 additions & 0 deletions trunk/drivers/net/wireless/rt2x00/rt2x00usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,38 @@ int rt2x00usb_vendor_request_buff(struct rt2x00_dev *rt2x00dev,
}
EXPORT_SYMBOL_GPL(rt2x00usb_vendor_request_buff);

int rt2x00usb_vendor_request_large_buff(struct rt2x00_dev *rt2x00dev,
const u8 request, const u8 requesttype,
const u16 offset, void *buffer,
const u16 buffer_length,
const int timeout)
{
int status = 0;
unsigned char *tb;
u16 off, len, bsize;

mutex_lock(&rt2x00dev->usb_cache_mutex);

tb = buffer;
off = offset;
len = buffer_length;
while (len && !status) {
bsize = min_t(u16, CSR_CACHE_SIZE, len);
status = rt2x00usb_vendor_req_buff_lock(rt2x00dev, request,
requesttype, off, tb,
bsize, timeout);

tb += bsize;
len -= bsize;
off += bsize;
}

mutex_unlock(&rt2x00dev->usb_cache_mutex);

return status;
}
EXPORT_SYMBOL_GPL(rt2x00usb_vendor_request_large_buff);

/*
* TX data handlers.
*/
Expand Down
21 changes: 20 additions & 1 deletion trunk/drivers/net/wireless/rt2x00/rt2x00usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
/*
* Cache size
*/
#define CSR_CACHE_SIZE 8
#define CSR_CACHE_SIZE 64
#define CSR_CACHE_SIZE_FIRMWARE 64

/*
Expand Down Expand Up @@ -171,6 +171,25 @@ int rt2x00usb_vendor_req_buff_lock(struct rt2x00_dev *rt2x00dev,
const u16 offset, void *buffer,
const u16 buffer_length, const int timeout);

/**
* rt2x00usb_vendor_request_large_buff - Send register command to device (buffered)
* @rt2x00dev: Pointer to &struct rt2x00_dev
* @request: USB vendor command (See &enum rt2x00usb_vendor_request)
* @requesttype: Request type &USB_VENDOR_REQUEST_*
* @offset: Register start offset to perform action on
* @buffer: Buffer where information will be read/written to by device
* @buffer_length: Size of &buffer
* @timeout: Operation timeout
*
* This function is used to transfer register data in blocks larger
* then CSR_CACHE_SIZE. Use for firmware upload, keys and beacons.
*/
int rt2x00usb_vendor_request_large_buff(struct rt2x00_dev *rt2x00dev,
const u8 request, const u8 requesttype,
const u16 offset, void *buffer,
const u16 buffer_length,
const int timeout);

/**
* rt2x00usb_vendor_request_sw - Send single register command to device
* @rt2x00dev: Pointer to &struct rt2x00_dev
Expand Down

0 comments on commit a956e93

Please sign in to comment.