summaryrefslogtreecommitdiff
path: root/drivers/staging/mei/main.c
AgeCommit message (Collapse)Author
2012-04-10staging/mei: cleanup driver naming stringsTomas Winkler
1. use only mei_driver_name and remove define MEI_DRIVER_NAME 2. drop MEI_DEV_NAME and assign device name directly 3. drop mei_driver_string, it is not used Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10staging/mei: remove unused variableTomas Winkler
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10staging/mei: define pr_fmt prefix for pr_ macrosTomas Winkler
define pr_fmt macro and remove mei: from the messages Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-14staging: mei: remove driver internal versioningTomas Winkler
There is no need for internal module versioning for in-kernel driver: remove mei_version.h Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-14staging/mei: propagate error codes up in the write flowTomas Winkler
Change mei_write_message's return type from bool to int to enable propagation of the error code up to caller functions. The function now returns -EIO when low level write fails and 0 on success. A similar change is done in intermediate caller functions: mei_send_flow_control, mei_connect, and mei_disconnect This makes code more alike to typical Linux kernel error handling. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-13drivers:staging:mei Fix some typos in staging/meiJustin P. Mattock
The below patch fixes some typos in drivers/staging/mei/* that I have found while doing a little bit of reading. Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09staging/mei: update copyright year to 2012Tomas Winkler
1. Update Copyright to 2012 2. Also fix mei.h copyright format checkpaatch complained: WARNING: please, no spaces at the start of a line Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2011-12-22staging/mei: add watchdog device registration wrappersTomas Winkler
add mei_watchdog_register/unregister wrappers for cleaner encapsulation Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-14staging/mei: code style - cleanup blanksTomas Winkler
1. Remove redundant blanks 2. Straighten code lines that don't go over 80 characters Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-27staging/mei: don't check if list is empty before loopingTomas Winkler
1. No need to check if a list is empty before list_for_each_ looping as this is already checked by loop stopping conditional. The side effect is reduced indentation depth from: if (!list_empty) list_for_each() to: list_for_each() 2. drop cb_ prefix from cl_pos, cl_next variables used in list_for_each loops. The code is more compact and readable Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-27staging/mei: remove status member of mei_io_listTomas Winkler
status was never writen Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-27staging/mei: fix check for allocating host client idTomas Winkler
MEI_CLIENTS_MAX is 255 and host_client_id is u8 therefore for check to work we need to first assign the return value of find_first_zero_bit to unsigned long variable Fix warning drivers/staging/mei/main.c: In function mei_open drivers/staging/mei/main.c:260:2: warning: comparison is always false due to limited range of data type Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-27staging: mei: expose misc interface instead of char deviceOren Weil
Misc device provides everything MEI needs for registration, it doesn't required separate driver class. Signed-off-by: Oren Weil <oren.jer.weil@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-09staging: mei: resuming timer regardless of the watchdog timeout value.Oren Weil
the timer_work does not only handle watchdog but also handles mei timeouts. Signed-off-by: Oren Weil <oren.jer.weil@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-09staging: mei: renaming delayed work field and function to a meaningful name.Oren Weil
the wd_work and mei_wd_timer() function was not just for watchdog. mei managing the AMT watchdog going to be replace by the kernel watchdog interface. the mei_timer() will still manage the mei driver timeouts. Signed-off-by: Oren Weil <oren.jer.weil@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-09staging: mei: adding set_timeout watchdog functionOren Weil
add the ability to let the watchdog core set the AMT watchdog timeout value. the default value will be only set in the start function. Signed-off-by: Oren Weil <oren.jer.weil@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-09staging: mei: adding watchdog opsOren Weil
adding start and stop function. start - check if AMT wd client is connected, which is been connected on driver load. stop - send stop command to AMT wd. Signed-off-by: Oren Weil <oren.jer.weil@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-09staging: mei: registering the MEI driver with the kernel watchdog core interfaceOren Weil
Adding kernel watchdog interface (/dev/watchdog) to the MEI Driver to support AMT Watchdog feature. This patch and the following one will replace MEI Driver self management of the AMT watchdog with the standard kernel watchdog interface. Signed-off-by: Oren Weil <oren.jer.weil@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06staging: mei: unlock dev->device_lock mutex on error path in mei_open()Alexey Khoroshilov
mei_open() acquires dev->device_lock mutex and try to allocate mei_cl, but if the allocation fails it goes to return statement. As a result dev->device_lock left locked. The patch fixes goto to unlock dev->device_lock mutex on this path. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23staging: mei: enable msi when supportedTomas Winkler
enable msi when supported also in that case we can drop the quick handler from the threaded interrupt that protected us from handling USB interrupts Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08staging: mei: reordering the exit module cleanupOren Weil
keeping the exit flow in a reverse order then the init flow. Signed-off-by: Oren Weil <oren.jer.weil@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28Remove unneeded version.h include from drivers/staging/mei/main.cJesper Juhl
It was pointed out by 'make versioncheck' that include of linux/version.h is not needed in drivers/staging/mei/main.c . This patch removes it. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging: mei: io_list functions revampTomas Winkler
1. remove list used for loop. There were only 2 loops used in non time critical places so we can safely unroll them 2. normalize functions names operating on io_list to mei_io_list_<op> 3. rename mei_fe_same_id to mei_cl_cmp_id used for comparing list elements containing struct mei_cl 4. group together io_list functions in the header file Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Oren Weil <oren.jer.weil@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging: mei: rename num_mei_me_clients to me_clients_numTomas Winkler
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Oren Weil <oren.jer.weil@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging: mei: mei_dev - use type bool instead of intTomas Winkler
use type bool for boolean variables in struct mei_dev this should save some space providing boolean is 8 bits Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Oren Weil <oren.jer.weil@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging: mei: fix mei driver namespaceTomas Winkler
All global functions must start with mei_ to reduce the risk of name colisions Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Oren Weil <oren.jer.weil@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging: fix mei build when PM is not enabledRandy Dunlap
Fix mei build when CONFIG_PM is not enabled (i.e., fix typo): drivers/staging/mei/main.c:1159: error: 'MEI_PM_OPS' undeclared here (not in a function) Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-18staging/mei: PCI device and char driver support.Oren Weil
contains module entries and PCI driver and char device definitions (using file_operations, pci_driver struts). The HW interface is exposed on PCI interface. PCI: The MEI HW resources are memory map 32 bit registers (Host and ME Status Registers and Data Registers) and interrupt (shared, with Intel GFX on some chipsets and USB2 controller on others). The device is part of the chipsets and cannot be hotplugged. The MEI device present is determined by BIOS configuration. Probe: The driver starts the init MEI flow, that is explained in the patch "MEI driver init flow" [06/10], then schedules a timer that handles timeouts and watchdog heartbeats. Remove: The driver closes all connections and stops the watchdog. The driver expose char device that supports: open, release, write, read, ioctl, poll. Open: Upon open the driver allocates HOST data structure on behalf of application which will resides in the file's private data and assign a host ID number which will identify messages between driver client instance and MEI client. The driver also checks readiness of the device. The number of simultaneously opened instances is limited to 253. (255 - (amthi + watchdog)) Release: In release the driver sends a Disconnect Command to ME feature and clean all the data structs. IOCTL: MEI adds new IOCTL: (IOCTL_MEI_CONNECT_CLIENT) The IOCTL links the current file descriptor to ME feature. This is done by sending MEI Bus command: 'hbm_client_connect_request' to the ME and waiting for an answer :'hbm_client_connect_response'. Upon answer reception the driver updates its and HOST data structures in file structure to indicate that the file descriptor is associated to ME feature. Each ME feature is represented by UUID which is given as an input parameter to the IOCTL, upon success connect command the IOCTL will return the ME feature properties. ME can reject CONNECT commands due to several reasons, most common are: Invalid UUID ME or feature does not exists in ME. No More Connection allowed to this is feature, usually only one connection is allowed. Write: Upon write, the driver splits the user data into several MEI messages up to 512 bytes each and sends it to the HW. If the user wants to write data to AMTHI ME feature then the drivers routes the messages through AMTHI queues. Read: In read the driver checks is a connection exists to current file descriptor and then wait until a data is available. Message might be received (by interrupt from ME) in multiple chunks. Only complete message is released to the application. Poll: Nothing special here. Waiting for see if we have data available for reading. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Itzhak Tzeel-Krupp <itzhak.tzeel-krupp@intel.com> Signed-off-by: Oren Weil <oren.jer.weil@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>