Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 301eacbf authored by David Woodhouse's avatar David Woodhouse Committed by David S. Miller
Browse files

libertas: convert CMD_MESH_ACCESS to a direct command

parent ad9d7a7f
Loading
Loading
Loading
Loading
+11 −17
Original line number Original line Diff line number Diff line
@@ -976,27 +976,25 @@ static int lbs_cmd_fwt_access(struct lbs_private *priv,
	return 0;
	return 0;
}
}


static int lbs_cmd_mesh_access(struct lbs_private *priv,
int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action,
				struct cmd_ds_command *cmd,
		    struct cmd_ds_mesh_access *cmd)
				u16 cmd_action, void *pdata_buf)
{
{
	struct cmd_ds_mesh_access *mesh_access = &cmd->params.mesh;
	int ret;

	lbs_deb_enter_args(LBS_DEB_CMD, "action %d", cmd_action);
	lbs_deb_enter_args(LBS_DEB_CMD, "action %d", cmd_action);


	cmd->command = cpu_to_le16(CMD_MESH_ACCESS);
	cmd->hdr.command = cpu_to_le16(CMD_MESH_ACCESS);
	cmd->size = cpu_to_le16(sizeof(struct cmd_ds_mesh_access) + S_DS_GEN);
	cmd->hdr.size = cpu_to_le16(sizeof(struct cmd_ds_mesh_access) + S_DS_GEN);
	cmd->result = 0;
	cmd->hdr.result = 0;


	if (pdata_buf)
	cmd->action = cpu_to_le16(cmd_action);
		memcpy(mesh_access, pdata_buf, sizeof(*mesh_access));
	else
		memset(mesh_access, 0, sizeof(*mesh_access));


	mesh_access->action = cpu_to_le16(cmd_action);
	ret = lbs_cmd_with_response(priv, CMD_MESH_ACCESS, (*cmd));


	lbs_deb_leave(LBS_DEB_CMD);
	lbs_deb_leave(LBS_DEB_CMD);
	return 0;
	return ret;
}
}
EXPORT_SYMBOL_GPL(lbs_mesh_access);


static int lbs_cmd_bcn_ctrl(struct lbs_private * priv,
static int lbs_cmd_bcn_ctrl(struct lbs_private * priv,
				struct cmd_ds_command *cmd,
				struct cmd_ds_command *cmd,
@@ -1486,10 +1484,6 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
		ret = lbs_cmd_fwt_access(priv, cmdptr, cmd_action, pdata_buf);
		ret = lbs_cmd_fwt_access(priv, cmdptr, cmd_action, pdata_buf);
		break;
		break;


	case CMD_MESH_ACCESS:
		ret = lbs_cmd_mesh_access(priv, cmdptr, cmd_action, pdata_buf);
		break;

	case CMD_GET_TSF:
	case CMD_GET_TSF:
		cmdptr->command = cpu_to_le16(CMD_GET_TSF);
		cmdptr->command = cpu_to_le16(CMD_GET_TSF);
		cmdptr->size = cpu_to_le16(sizeof(struct cmd_ds_get_tsf) +
		cmdptr->size = cpu_to_le16(sizeof(struct cmd_ds_get_tsf) +
+3 −0
Original line number Original line Diff line number Diff line
@@ -24,4 +24,7 @@ int lbs_cmd_copyback(struct lbs_private *priv, unsigned long extra,


int lbs_update_hw_spec(struct lbs_private *priv);
int lbs_update_hw_spec(struct lbs_private *priv);


int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action,
		    struct cmd_ds_mesh_access *cmd);

#endif /* _LBS_CMD_H */
#endif /* _LBS_CMD_H */
+0 −5
Original line number Original line Diff line number Diff line
@@ -653,11 +653,6 @@ static inline int handle_cmd_response(struct lbs_private *priv,
			       sizeof(resp->params.fwt));
			       sizeof(resp->params.fwt));
		spin_unlock_irqrestore(&priv->driver_lock, flags);
		spin_unlock_irqrestore(&priv->driver_lock, flags);
		break;
		break;
	case CMD_RET(CMD_MESH_ACCESS):
		if (priv->cur_cmd->pdata_buf)
			memcpy(priv->cur_cmd->pdata_buf, &resp->params.mesh,
			       sizeof(resp->params.mesh));
		break;
	case CMD_RET(CMD_802_11_BEACON_CTRL):
	case CMD_RET(CMD_802_11_BEACON_CTRL):
		ret = lbs_ret_802_11_bcn_ctrl(priv, resp);
		ret = lbs_ret_802_11_bcn_ctrl(priv, resp);
		break;
		break;
+2 −1
Original line number Original line Diff line number Diff line
@@ -623,6 +623,8 @@ struct cmd_ds_fwt_access {
} __attribute__ ((packed));
} __attribute__ ((packed));


struct cmd_ds_mesh_access {
struct cmd_ds_mesh_access {
	struct cmd_header hdr;

	__le16 action;
	__le16 action;
	__le32 data[32];	/* last position reserved */
	__le32 data[32];	/* last position reserved */
} __attribute__ ((packed));
} __attribute__ ((packed));
@@ -687,7 +689,6 @@ struct cmd_ds_command {
		struct cmd_tx_rate_query txrate;
		struct cmd_tx_rate_query txrate;
		struct cmd_ds_bt_access bt;
		struct cmd_ds_bt_access bt;
		struct cmd_ds_fwt_access fwt;
		struct cmd_ds_fwt_access fwt;
		struct cmd_ds_mesh_access mesh;
		struct cmd_ds_get_tsf gettsf;
		struct cmd_ds_get_tsf gettsf;
		struct cmd_ds_802_11_subscribe_event subscribe_event;
		struct cmd_ds_802_11_subscribe_event subscribe_event;
		struct cmd_ds_802_11_beacon_control bcn_ctrl;
		struct cmd_ds_802_11_beacon_control bcn_ctrl;
+3 −8
Original line number Original line Diff line number Diff line
@@ -990,11 +990,9 @@ static int if_usb_suspend(struct usb_interface *intf, pm_message_t message)
		 */
		 */
		struct cmd_ds_mesh_access mesh_access;
		struct cmd_ds_mesh_access mesh_access;
		memset(&mesh_access, 0, sizeof(mesh_access));
		memset(&mesh_access, 0, sizeof(mesh_access));

		mesh_access.data[0] = cpu_to_le32(1);
		mesh_access.data[0] = cpu_to_le32(1);
		lbs_prepare_and_send_command(priv,
		lbs_mesh_access(priv, CMD_ACT_MESH_SET_AUTOSTART_ENABLED, &mesh_access);
				CMD_MESH_ACCESS,
				CMD_ACT_MESH_SET_AUTOSTART_ENABLED,
				CMD_OPTION_WAITFORRSP, 0, (void *)&mesh_access);
	}
	}


	netif_device_detach(cardp->eth_dev);
	netif_device_detach(cardp->eth_dev);
@@ -1031,10 +1029,7 @@ static int if_usb_resume(struct usb_interface *intf)
		struct cmd_ds_mesh_access mesh_access;
		struct cmd_ds_mesh_access mesh_access;
		memset(&mesh_access, 0, sizeof(mesh_access));
		memset(&mesh_access, 0, sizeof(mesh_access));
		mesh_access.data[0] = cpu_to_le32(0);
		mesh_access.data[0] = cpu_to_le32(0);
		lbs_prepare_and_send_command(priv,
		lbs_mesh_access(priv, CMD_ACT_MESH_SET_AUTOSTART_ENABLED, &mesh_access);
				CMD_MESH_ACCESS,
				CMD_ACT_MESH_SET_AUTOSTART_ENABLED,
				CMD_OPTION_WAITFORRSP, 0, (void *)&mesh_access);
	}
	}


	lbs_deb_leave(LBS_DEB_USB);
	lbs_deb_leave(LBS_DEB_USB);
Loading