Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268518
b: refs/heads/master
c: abc51b6
h: refs/heads/master
v: v3
  • Loading branch information
Oren Weil authored and Greg Kroah-Hartman committed Sep 27, 2011
1 parent 472c171 commit a87b86a
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 25 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: 8f019bfe0a23167d49aa5c364d229ae416f7e675
refs/heads/master: abc51b6de532b1071d8335918970c5d9154da73f
30 changes: 8 additions & 22 deletions trunk/drivers/staging/mei/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,12 @@ void mei_allocate_me_clients_storage(struct mei_device *dev)
*
* @dev: the device structure
*
* returns none.
* returns:
* < 0 - Error.
* = 0 - no more clients.
* = 1 - still have clients to send properties request.
*/
void mei_host_client_properties(struct mei_device *dev)
int mei_host_client_properties(struct mei_device *dev)
{
struct mei_msg_hdr *mei_header;
struct hbm_props_request *host_cli_req;
Expand Down Expand Up @@ -504,32 +507,15 @@ void mei_host_client_properties(struct mei_device *dev)
dev->mei_state = MEI_RESETING;
dev_dbg(&dev->pdev->dev, "write send enumeration request message to FW fail.\n");
mei_reset(dev, 1);
return;
return -EIO;
}

dev->init_clients_timer = INIT_CLIENTS_TIMEOUT;
dev->me_client_index = b;
return;
return 1;
}


/*
* Clear Map for indicating now ME clients
* with associated host client
*/
bitmap_zero(dev->host_clients_map, MEI_CLIENTS_MAX);
dev->open_handle_count = 0;
bitmap_set(dev->host_clients_map, 0, 3);
dev->mei_state = MEI_ENABLED;

/* if wd initialization fails, initialization the AMTHI client,
* otherwise the AMTHI client will be initialized after the WD client connect response
* will be received
*/
if (mei_wd_host_init(dev))
mei_host_init_iamthif(dev);

return;
return 0;
}

/**
Expand Down
34 changes: 33 additions & 1 deletion trunk/drivers/staging/mei/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev,
struct hbm_host_enum_response *enum_res;
struct hbm_client_disconnect_request *disconnect_req;
struct hbm_host_stop_request *host_stop_req;
int res;

unsigned char *buffer;

Expand Down Expand Up @@ -746,7 +747,38 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev,
MEI_CLIENT_PROPERTIES_MESSAGE) {
dev->me_client_index++;
dev->me_client_presentation_num++;
mei_host_client_properties(dev);

/** Send Client Propeties request **/
res = mei_host_client_properties(dev);
if (res < 0) {
dev_dbg(&dev->pdev->dev, "mei_host_client_properties() failed");
return;
} else if (!res) {
/*
* No more clients to send to.
* Clear Map for indicating now ME clients
* with associated host client
*/
bitmap_zero(dev->host_clients_map, MEI_CLIENTS_MAX);
dev->open_handle_count = 0;

/*
* Reserving the first three client IDs
* Client Id 0 - Reserved for MEI Bus Message communications
* Client Id 1 - Reserved for Watchdog
* Client ID 2 - Reserved for AMTHI
*/
bitmap_set(dev->host_clients_map, 0, 3);
dev->mei_state = MEI_ENABLED;

/* if wd initialization fails, initialization the AMTHI client,
* otherwise the AMTHI client will be initialized after the WD client connect response
* will be received
*/
if (mei_wd_host_init(dev))
mei_host_init_iamthif(dev);
}

} else {
dev_dbg(&dev->pdev->dev, "reset due to received host client properties response bus message");
mei_reset(dev, 1);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/mei/mei_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ static inline bool mei_cl_cmp_id(const struct mei_cl *cl1,
*/
void mei_host_start_message(struct mei_device *dev);
void mei_host_enum_clients_message(struct mei_device *dev);
void mei_host_client_properties(struct mei_device *dev);
int mei_host_client_properties(struct mei_device *dev);

/*
* MEI interrupt functions prototype
Expand Down

0 comments on commit a87b86a

Please sign in to comment.