summaryrefslogtreecommitdiffstats
path: root/drivers/staging/mei
Commit message (Collapse)AuthorAgeFilesLines
* staging/mei: add watchdog device registration wrappersTomas Winkler2011-12-225-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>
* staging/mei: code style - cleanup blanksTomas Winkler2011-12-135-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>
* staging/mei: remove outdated comment about setting iamthif_mtuTomas Winkler2011-12-131-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>
* staging: mei: updating mei driver documentationOren Weil2011-12-081-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>
* staging/mei: fix failure for multiple mei clients connectionNatalia Ovsyanikov2011-12-081-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>
* staging/mei: Don't check if loop cursor is nullTomas Winkler2011-12-081-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>
* staging/mei: don't check if list is empty before loopingTomas Winkler2011-11-284-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>
* staging/mei: remove status member of mei_io_listTomas Winkler2011-11-285-61/+41
| | | | | | | status was never writen Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging/mei: remove BUG_ON for testing of the response buffer size overflowTomas Winkler2011-11-281-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>
* staging/mei: fix check for allocating host client idTomas Winkler2011-11-261-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>
* staging: mei: expose misc interface instead of char deviceOren Weil2011-11-262-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>
* staging:mei: wd_ops and wd_info should be staticTomas Winkler2011-11-261-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>
* staging: mei: clean the TODO file from done tasks.Oren Weil2011-10-171-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>
* staging: mei: Organize the initialization state machine.Oren Weil2011-09-263-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>
* drivers/staging/mei/interface.c: take size of pointed value, not pointerJulia Lawall2011-09-161-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>
* staging: mei: adding watchdog core dependency to kconfigOren Weil2011-09-091-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>
* staging: mei: adding mei_wd_stop function commentOren Weil2011-09-091-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>
* staging: mei: removing wd module parametersOren Weil2011-09-091-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>
* staging: mei: client init code cleanupOren Weil2011-09-091-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>
* staging: mei: resuming timer regardless of the watchdog timeout value.Oren Weil2011-09-091-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>
* staging: mei: renaming delayed work field and function to a meaningful name.Oren Weil2011-09-094-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>
* staging: mei: adding set_timeout watchdog functionOren Weil2011-09-093-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>
* staging: mei: adding watchdog pingOren Weil2011-09-092-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>
* staging: mei: adding watchdog opsOren Weil2011-09-093-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>
* staging: mei: registering the MEI driver with the kernel watchdog core interfaceOren Weil2011-09-096-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>
* staging: mei: fix register access function commentsOren Weil2011-09-091-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>
* staging: mei: removing dependency between WD and AMTHI init function.Oren Weil2011-09-093-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>
* staging: mei: unlock dev->device_lock mutex on error path in mei_open()Alexey Khoroshilov2011-09-061-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>
* staging: mei: enable msi when supportedTomas Winkler2011-08-232-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>
* staging: mei: reordering the exit module cleanupOren Weil2011-07-081-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>
* Merge Linux 3.0-rc6 into staging-nextGreg Kroah-Hartman2011-07-052-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>
| * Staging: mei: fix suspend failureTomas Winkler2011-06-272-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wait_event_interruptible_timeout return value was wrongly used. The remaining timeout was used as the error code. This fix translated wait_event_interruptible_timeout return value into error code that can be propagated. [10291.674121] pci_pm_suspend(): mei_pci_suspend+0x0/0x8b [mei] returns 2500 It's thinkpad t400 with 00:03.0 Communication controller [0780]: Intel Corporation Mobile 4 Series Chipset MEI Controller [8086:2a44] (rev 07) Reported-by: Arkadiusz Miskiewicz <a.miskiewicz@gmail.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | Remove unneeded version.h include from drivers/staging/mei/main.cJesper Juhl2011-06-281-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>
* | staging: mei: fix possible usage of uninitialized variableTomas Winkler2011-06-281-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>
* | staging: mei: io_list functions revampTomas Winkler2011-06-285-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>
* | staging: mei: rename num_mei_me_clients to me_clients_numTomas Winkler2011-06-286-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>
* | staging: mei: mei_dev - kill unused membersTomas Winkler2011-06-284-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>
* | staging: mei: mei_dev - use type bool instead of intTomas Winkler2011-06-286-51/+50
| | | | | | | | | | | | | | | | | | 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>
* | staging: mei: fix mei driver namespaceTomas Winkler2011-06-286-44/+54
| | | | | | | | | | | | | | | | 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>
* | staging: mei: mei_dev.h: don't break lines where not needed.Tomas Winkler2011-06-281-6/+3
|/ | | | | | 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>
* Staging: mei: fix debug codeDan Carpenter2011-06-091-2/+2
| | | | | | | | | ! has higher precedence than !=. H_RDY is 8 and since neither 0 nor 1 are equal to 8 the original condition was always true. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* staging: fix mei build when PM is not enabledRandy Dunlap2011-05-191-1/+1
| | | | | | | | | 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>
* staging/mei: add mei to staging KbuildOren Weil2011-05-182-0/+39
| | | | | | | | | Add mei to Kconfig and Makefile in drivers/staging 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>
* staging/mei: AMT WatchdogOren Weil2011-05-181-0/+183
| | | | | | | | | | | | | | | | | code that open connection and invoke heartbeats to the AMT Watchdog client/feature, if exists Connect to WD Client, if exists Send Start WD Command. Every 2 secs send heartbeats. On System shutdown/suspends, send Stop WD command. This is intermediate stage before moving this code to standalone watchdog driver. 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>
* staging/mei: mei.h defining user space interfaceOren Weil2011-05-181-0/+105
| | | | | | | | | | | | | | | | | | | | | | | | | define IOCTL_MEI_CONNECT_CLIENT and its associated structure When the user wants to connect to a ME feature/client after it open a file descriptor to the driver, he need to use Connect IOCTL. This IOCTL received a struct that contains a union of 2 other structs. 1st struct - Input Parameters: UUID - a predefine unique that identify the ME feature, this id per feature is constant all over the chipsets and versions. 2nd struct Output Parameters: MaxMessageLen - maximum message length that allowed to be send to the feature ProtocolVersion ME feature current protocol version. 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>
* staging/mei: Hardware and MEI driver internal struct definitionOren Weil2011-05-181-0/+333
| | | | | | | | | | define the MEI protocol msg structs and HW registers, also define the MEI internal status and struct 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>
* staging/mei: MEI driver init flow.Oren Weil2011-05-181-0/+770
| | | | | | | | | | | | | | | | | | | | | | | | | | | Init driver list and queue, MEI Hardware reset flow, init of driver specific host client. MEI Init/reset flow: - Ack all waiting interrupts - Hardware reset flow (Set Reset Bit, Generate Interrupt, Clear Reset Bit Generate Interrupt) - Wait for ME Ready Bit (done in interrupt thread) - Set ME Ready Bit (done in interrupt thread) - Send Start request (done in interrupt thread) - wait for answer - Send Enumerate Clients request (done in interrupt thread) - wait for answer - Send Get Client property for each client request (done in interrupt thread) - Wait for answers - Init Done. MEI Driver connect internally to 2 ME clients/features: AMTHI and AMT watchdog. 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>
* staging/mei: MEI link layerOren Weil2011-05-182-0/+509
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implementation of the communication between host and ME. connect/disconnect to/from a client, send MEI message, read MEI message, flow control handling. Each MEI message has mei_msg_hdr followed by a payload. Driver is oblivious the payload. ME Address/ID - This is the logical address of the ME feature/client of that message. Host Address/ID - This is the logical address of the Host client of that message Length - This is the Length of message payload in bytes Reserved - reserved for future use. Message Complete - This bit is used to indicative that this is the last message of multi message MEI transfer of a client message that is larger then the MEI circular buffer. Payload - Message payload (data) up to 512bytes The HW data registers are consist two circular buffers, one for data from ME and other data from Host application. Each buffer has two pointers, read_ptr (H_CBRP) and write_ptr (H_CBWP). The buffers size is defined by depth value that exists in the status registers (H_CBD and ME_CBD_HRA). Every read from ME circular buffer cause read_ptr++ Every write to the Host circular buffer write_ptr++ Flow control MEI message that ME and MEI Driver use to notify each other that a ME feature/client or Host client buffer is ready to receive data. 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>
* staging/mei: Interrupt handling.Oren Weil2011-05-181-0/+1624
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ISR and interrupt thread for handling incoming data. e.g. read bus message, read client message, handle reset requests. quick handler: As MEI may share interrupt with GFX and/or USB the HW register need to be checked and acknowledged. thread handler: Check if HW has data for read. Write data to HW if possible. May init reset flow on error there can be two types of messages: 1) bus messages: Management messages between MEI Driver and ME e.g. Connect request/response, Disconnect request/response Enum clients request/response Flow control request/response those message are indicated by ME Address/ID == 0 && Host Address/ID == 0 2) feature/client messages: message that are sends between ME Feature/Client and an application, the struct of the message is defined by the ME Feature Protocol (e.g. APF Protocol, AMTHI Protocol) those message are indicated by ME Address/ID != 0 && Host Address/ID != 0 MEI Initialization state machine is also managed by this patch. After MEI Reset is preform: Send Start request wait for answer Send Enumerate Clients request wait for answer Send Get Client property for each client request wait for answers Init Done. 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>
* staging/mei: PCI device and char driver support.Oren Weil2011-05-184-0/+2406
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
OpenPOWER on IntegriCloud