Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290737
b: refs/heads/master
c: 09a3311
h: refs/heads/master
i:
  290735: 00f8231
v: v3
  • Loading branch information
Jakub Kicinski authored and John W. Linville committed Feb 27, 2012
1 parent e5b0cd1 commit d627640
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 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: 2530c55ea9a397c4e5f41c0820084dfc27441d14
refs/heads/master: 09a3311c1a061bda809ff78c512855f3b71dcd6b
15 changes: 14 additions & 1 deletion trunk/drivers/net/wireless/rt2x00/rt2800.h
Original file line number Diff line number Diff line change
Expand Up @@ -1637,6 +1637,7 @@ struct mac_iveiv_entry {

/*
* H2M_MAILBOX_CSR: Host-to-MCU Mailbox.
* CMD_TOKEN: Command id, 0xff disable status reporting.
*/
#define H2M_MAILBOX_CSR 0x7010
#define H2M_MAILBOX_CSR_ARG0 FIELD32(0x000000ff)
Expand All @@ -1646,6 +1647,8 @@ struct mac_iveiv_entry {

/*
* H2M_MAILBOX_CID:
* Free slots contain 0xff. MCU will store command's token to lowest free slot.
* If all slots are occupied status will be dropped.
*/
#define H2M_MAILBOX_CID 0x7014
#define H2M_MAILBOX_CID_CMD0 FIELD32(0x000000ff)
Expand All @@ -1655,6 +1658,7 @@ struct mac_iveiv_entry {

/*
* H2M_MAILBOX_STATUS:
* Command status will be saved to same slot as command id.
*/
#define H2M_MAILBOX_STATUS 0x701c

Expand Down Expand Up @@ -2298,6 +2302,12 @@ struct mac_iveiv_entry {

/*
* MCU mailbox commands.
* MCU_SLEEP - go to power-save mode.
* arg1: 1: save as much power as possible, 0: save less power.
* status: 1: success, 2: already asleep,
* 3: maybe MAC is busy so can't finish this task.
* MCU_RADIO_OFF
* arg0: 0: do power-saving, NOT turn off radio.
*/
#define MCU_SLEEP 0x30
#define MCU_WAKEUP 0x31
Expand All @@ -2318,7 +2328,10 @@ struct mac_iveiv_entry {
/*
* MCU mailbox tokens
*/
#define TOKEN_WAKUP 3
#define TOKEN_SLEEP 1
#define TOKEN_RADIO_OFF 2
#define TOKEN_WAKEUP 3


/*
* DMA descriptor defines.
Expand Down
8 changes: 5 additions & 3 deletions trunk/drivers/net/wireless/rt2x00/rt2800pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,14 +522,16 @@ static int rt2800pci_set_state(struct rt2x00_dev *rt2x00dev,
enum dev_state state)
{
if (state == STATE_AWAKE) {
rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, TOKEN_WAKUP, 0, 0x02);
rt2800pci_mcu_status(rt2x00dev, TOKEN_WAKUP);
rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, TOKEN_WAKEUP,
0, 0x02);
rt2800pci_mcu_status(rt2x00dev, TOKEN_WAKEUP);
} else if (state == STATE_SLEEP) {
rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_STATUS,
0xffffffff);
rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_CID,
0xffffffff);
rt2800_mcu_request(rt2x00dev, MCU_SLEEP, 0x01, 0xff, 0x01);
rt2800_mcu_request(rt2x00dev, MCU_SLEEP, TOKEN_SLEEP,
0xff, 0x01);
}

return 0;
Expand Down

0 comments on commit d627640

Please sign in to comment.