summaryrefslogtreecommitdiffstats
path: root/drivers/staging/mei
AgeCommit message (Collapse)AuthorFilesLines
2012-03-27watchdog: fix set_timeout operationsWim Van Sebroeck1-0/+1
Since we changed the behaviour of the set_timeout operation in the watchdog API, we need to change the allready converted drivers so that they update the timeout field at the end of the set_timeout operation. Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2012-03-14staging: mei: remove driver internal versioningTomas Winkler3-37/+1
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 Winkler6-80/+61
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. Mattock9-15/+15
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-03-07staging/mei: don't use read buffer for writingTomas Winkler1-0/+1
In mei_irq_thread_read_bus_message we reused mei_hdr allocated on read buffer to write the stop message. There is no bug associated with this but for code clarity we use write buffer also for message header. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-29staging: mei: kill struct hbm_cmd bit fieldsTomas Winkler4-33/+31
Replace bitfield struct hbm_cmd with simple u8 as we always access the value as whole. This allows us to remove few ugly type casts For possible further uses and documentation purposes we add corresponding bitmask defines Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-29staging: mei: fix typo in error code returnDevin J. Pohly1-1/+1
~ENODEV is a different number than -ENODEV Signed-off-by: Devin J. Pohly <djpohly@gmail.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24staging/mei: mei-amt-version - make all function static and usedTomas Winkler1-5/+7
This patch eliminates following type of warnings warning: no previous prototype for '...func...' [-Wmissing-prototypes] For this is a single file example lets make all API-like functions be static. Since all static functions should be used so let's call to amt_host_if_deinit() even if in this example it's not really necessary Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Acked-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24staging/mei: fix hbm_host_version_response structureTomas Winkler1-1/+1
Looks during cleanup we converted type of host_version_supported member from UINT8 into int instead of u8. Since we've queried only for boolean value of this variable the bug wasn't really visible. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09staging/mei: TODO : how to handle example code after unstagingTomas Winkler1-0/+3
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09staging/mei: add mei user space exampleTomas Winkler1-0/+479
this example tries to connect to amt host interface client and retrieve versions of its sub components When AMT is enabled an output might look like that: Intel AMT: ENABLED Flash: 6.1.0 Netstack: 6.1.0 AMTApps: 6.1.0 AMT: 6.1.0 Sku: 258 VendorID: 8086 Build Number: 1042 Recovery Version: 6.1.0 Recovery Build Num: 1042 Legacy Mode: False otherwise: Intel AMT: DISABLED Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09staging/mei: normalize prototypes of all read buffersTomas Winkler4-30/+18
1. convert all read buffers to unsigned char and drop useless castings 2. simplify mei_read_slots implementation Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09staging/mei: update copyright year to 2012Tomas Winkler11-70/+75
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>
2012-02-08staging: Fix typo in mei/interrupt.cMasanari Iida1-1/+1
Correct spelling "reseting" to "resetting" in drivers/staging/mei/interrupt.c Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2011-12-22staging/mei: add watchdog device registration wrappersTomas Winkler5-24/+41
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-13staging/mei: code style - cleanup blanksTomas Winkler5-34/+23
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-12-13staging/mei: remove outdated comment about setting iamthif_mtuTomas Winkler1-7/+2
iamthif_mtu doesn't have default value anymore it is always supplied by the ME firmware Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08staging: mei: updating mei driver documentationOren Weil1-100/+126
The following changes were made in the document: 1. Update URLs to working links 2. remove old information about module parameters 3. Add IOCTL information. 4. cleanups and fix spelling 5. driver changed from character device to misc character device 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-12-08staging/mei: fix failure for multiple mei clients connectionNatalia Ovsyanikov1-1/+1
The irq handler processes queued mei clients connect requests, which were not transferred to the device in ioctl context due to unavailability of the write buffer. The handler may transfer the connection request only if there is no other ongoing requests for the same mei id. This condition was implemented inversely which depending on the write buffer availability lead to seemingly random failures during connection attempts. Cc: Oren Weil <oren.jer.weil@intel.com> Signed-off-by: Natalia Ovsyanikov <natalia.ovsyanikov@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08staging/mei: Don't check if loop cursor is nullTomas Winkler1-8/+5
list_for_each_entry_safe(pos, next, &head, list) if (pos) { .... } This check isn't needed. The list cursor in a list_for_each() loop is always a valid pointer Cc: Oren Weil <oren.jer.weil@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28staging/mei: don't check if list is empty before loopingTomas Winkler4-183/+152
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-28staging/mei: remove status member of mei_io_listTomas Winkler5-61/+41
status was never writen Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28staging/mei: remove BUG_ON for testing of the response buffer size overflowTomas Winkler1-3/+0
We can remove BUG_ON in mei_irq_thread_read_client_message() as the testing for response buffer size overflow has already graceful handling in place. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26staging/mei: fix check for allocating host client idTomas Winkler1-4/+7
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-26staging: mei: expose misc interface instead of char deviceOren Weil2-330/+207
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-11-26staging:mei: wd_ops and wd_info should be staticTomas Winkler1-2/+2
wd_ops and wd_info structures are local to wd.c so mark them static Cc: 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-10-17staging: mei: clean the TODO file from done tasks.Oren Weil1-10/+0
1) We move the AMT Watchdog to use the kernel watchdog core. the new code is still part of the MEI driver. we didn't find any good reason to extract the the MEI driver watchdog code from the MEI Driver to a new module. 2) Since the watchdog remains in the mei driver, exposing in-kernel API just for AMTHI is unnecessary. MEI new Watchdog Core Interface Patches set: https://lkml.org/lkml/2011/9/7/26 3) Code cleanup (init and probe, bug_on usage, headers and etc) was submitted in previous patches. Patches: https://lkml.org/lkml/2011/9/21/231 https://lkml.org/lkml/2011/6/15/358 https://lkml.org/lkml/2011/7/7/177 https://lkml.org/lkml/2011/9/7/38 https://lkml.org/lkml/2011/9/7/37 https://lkml.org/lkml/2011/9/7/28 4) mei.txt was updated with additional information. Patch: https://lkml.org/lkml/2011/10/16/52 Acked-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-09-26staging: mei: Organize the initialization state machine.Oren Weil3-24/+42
moving the final state, clearing of the client maps and updating of mei state out from mei_host_client_properties function. Acked-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-09-16drivers/staging/mei/interface.c: take size of pointed value, not pointerJulia Lawall1-2/+2
Sizeof a pointer-typed expression returns the size of the pointer, not that of the pointed data. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression *e; type T; identifier f; @@ f(...,(T)e,..., -sizeof(e) +sizeof(*e) ,...) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-09staging: mei: adding watchdog core dependency to kconfigOren Weil1-1/+1
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 mei_wd_stop function commentOren Weil1-0/+10
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: removing wd module parametersOren Weil1-10/+0
wd module parameter is not needed now that driver is using watchdog core. 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: client init code cleanupOren Weil1-22/+15
starting removing the dependency from the module parameters. setting the default timeout on init so don't need to check if it is bigger then zero. 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: resuming timer regardless of the watchdog timeout value.Oren Weil1-5/+3
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 Weil4-9/+9
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 Weil3-7/+36
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 pingOren Weil2-27/+54
adding watchdog ping to send ping/heartbeat to the the AMT watchdog client. in addition removing the heartbeat sending from the driver timers 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 Weil3-16/+86
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 Weil6-3/+47
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-09staging: mei: fix register access function commentsOren Weil1-2/+2
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: removing dependency between WD and AMTHI init function.Oren Weil3-6/+20
AMTHI need to be initialized after WD Client was initialized, moving the AMTHI outside of the WD initialization function. in order to remove the coupling between the initialization of those clients. AMTHI is getting initialized (getting connected to the FW feature/client) in two ways: 1) if mei driver fails to send connect message to watchdog client (WD initialization), then immediately the AMTHI client getting initialized right after the watchdog initialization function. 2) if Watchdog client success to send connect message to watchdog client, then only after the driver is getting the connect response message the AMTHI client is getting initialized 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 Khoroshilov1-1/+1
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 Winkler2-5/+31
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 Weil1-1/+1
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-07-05Merge Linux 3.0-rc6 into staging-nextGreg Kroah-Hartman2-5/+10
This handles the merge conflicts with the drivers/staging/brcm80211/Kconfig file due to changes on the two different branches. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28Remove unneeded version.h include from drivers/staging/mei/main.cJesper Juhl1-3/+0
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: fix possible usage of uninitialized variableTomas Winkler1-1/+1
Fix warning: reported in http://marc.info/?l=linux-kernel&m=130812960402606&w=2 drivers/staging/mei/interrupt.c: warning: 'buffer' may be used uninitialized in this function: => 198 It is a real issue and wrong path in execution is taken when list is empty or (cl && _mei_irq_thread_state_ok(cl, mei_hdr)) evaluates to false Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging: mei: io_list functions revampTomas Winkler5-82/+74
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 Winkler6-21/+21
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 - kill unused membersTomas Winkler4-6/+0
remove write only/unsed variables mei_dev.write_hang and mei_io_lis.tdevice_extension 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>