struct ieee80211_low_level_stats low_stats;
};
-#define ADD_ONE_WITH_WRAP_AROUND(var, modulo) { \
- if ((var) >= ((modulo) - 1)) \
- (var) = 0; \
- else \
- (var)++; \
-}
-
int vnt_init(struct vnt_private *priv);
#endif
schedule_delayed_work(&priv->run_command_work, msecs_to_jiffies(msecs));
}
+static u32 add_one_with_wrap_around(u32 var, u8 modulo)
+{
+ if (var >= (modulo - 1))
+ var = 0;
+ else
+ var++;
+ return var;
+}
+
static int vnt_cmd_complete(struct vnt_private *priv)
{
priv->command_state = WLAN_CMD_IDLE;
priv->command = priv->cmd_queue[priv->cmd_dequeue_idx];
- ADD_ONE_WITH_WRAP_AROUND(priv->cmd_dequeue_idx, CMD_Q_SIZE);
+ priv->cmd_dequeue_idx = add_one_with_wrap_around(priv->cmd_dequeue_idx, CMD_Q_SIZE);
priv->free_cmd_queue++;
priv->cmd_running = true;
priv->cmd_queue[priv->cmd_enqueue_idx] = command;
- ADD_ONE_WITH_WRAP_AROUND(priv->cmd_enqueue_idx, CMD_Q_SIZE);
+ priv->cmd_enqueue_idx = add_one_with_wrap_around(priv->cmd_enqueue_idx, CMD_Q_SIZE);
priv->free_cmd_queue--;
if (!priv->cmd_running)