Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90429
b: refs/heads/master
c: 0472f88
h: refs/heads/master
i:
  90427: 1ed12c0
v: v3
  • Loading branch information
Emmanuel Grumbach authored and John W. Linville committed Mar 27, 2008
1 parent 6283384 commit 6731661
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 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: 24709182754625829e499b5d628affa881d1dba0
refs/heads/master: 0472f887e0689fff2dce82c01d40698432965b5a
30 changes: 28 additions & 2 deletions trunk/drivers/net/wireless/iwlwifi/iwl-hcmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,31 @@ EXPORT_SYMBOL(get_cmd_string);

#define HOST_COMPLETE_TIMEOUT (HZ / 2)

static int iwl_generic_cmd_callback(struct iwl_priv *priv,
struct iwl_cmd *cmd, struct sk_buff *skb)
{
struct iwl4965_rx_packet *pkt = NULL;

if (!skb) {
IWL_ERROR("Error: Response NULL in %s.\n",
get_cmd_string(cmd->hdr.cmd));
return 1;
}

pkt = (struct iwl4965_rx_packet *)skb->data;
if (pkt->hdr.flags & IWL_CMD_FAILED_MSK) {
IWL_ERROR("Bad return from %s (0x%08X)\n",
get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags);
return 1;
}

IWL_DEBUG_HC("back from %s (0x%08X)\n",
get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags);

/* Let iwl_tx_complete free the response skb */
return 1;
}

static int iwl_send_cmd_async(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
{
int ret;
Expand All @@ -106,8 +131,9 @@ static int iwl_send_cmd_async(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
/* An asynchronous command can not expect an SKB to be set. */
BUG_ON(cmd->meta.flags & CMD_WANT_SKB);

/* An asynchronous command MUST have a callback. */
BUG_ON(!cmd->meta.u.callback);
/* Assign a generic callback if one is not provided */
if (!cmd->meta.u.callback)
cmd->meta.u.callback = iwl_generic_cmd_callback;

if (test_bit(STATUS_EXIT_PENDING, &priv->status))
return -EBUSY;
Expand Down

0 comments on commit 6731661

Please sign in to comment.