aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/greybus.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-11-11staging: greybus: Remove redundant license textGreg Kroah-Hartman1-2/+0
Now that the SPDX tag is in all greybus files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Vaibhav Hiremath <hvaibhav.linux@gmail.com> Reviewed-by: Alex Elder <elder@linaro.org> Acked-by: Vaibhav Agarwal <vaibhav.sr@gmail.com> Acked-by: David Lin <dtwlin@gmail.com> Acked-by: Johan Hovold <johan@kernel.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Mark Greer <mgreer@animalcreek.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Acked-by: "Bryan O'Donoghue" <pure.logic@nexus-software.ie> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-11staging: greybus: add SPDX identifiers to all greybus driver filesGreg Kroah-Hartman1-0/+1
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the drivers/staging/greybus files files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Vaibhav Hiremath <hvaibhav.linux@gmail.com> Cc: "Bryan O'Donoghue" <pure.logic@nexus-software.ie> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Acked-by: Vaibhav Agarwal <vaibhav.sr@gmail.com> Acked-by: David Lin <dtwlin@gmail.com> Reviewed-by: Alex Elder <elder@linaro.org> Acked-by: Johan Hovold <johan@kernel.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Mark Greer <mgreer@animalcreek.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-07staging: greybus: remove timesync protocol supportGreg Kroah-Hartman1-1/+0
While the timesync protocol was a great idea, it never ended up getting implemented by any known hardware devices. It's also a bit "interesting" in how it ties into the platform controller. So, just remove it for now. It's not needed, no one uses it, and it's a stumbling block in getting the greybus core code merged out of the staging tree. If anyone wants it in the future, reverting this patch is a great place to start from. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Johan Hovold <johan@kernel.org> Reviewed-by: Alex Elder <elder@kernel.org> Acked-by: Bryan O'Donoghue <pure.logic@nexus-software.ie> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-19staging: greybus: remove CONFIG_PM_RUNTIME from kernel_ver.hGreg Kroah-Hartman1-1/+0
The last thing remaining in kernel_ver.h was the setting of CONFIG_PM_RUNTIME, which isn't needed in a in-tree implementation. So remove the setting of this value, and the .h file entirely as that was the last thing left in it. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-07-14greybus: interface: add runtime pm supportDavid Lin1-0/+1
Configure and enable runtime pm support for the Interface. Refer to the 12.2. The Interface Lifecycle of the Greybus specification for details on the requirements for transitioning from ENUMERATED to SUSPEND and vice versa. All the Bundles for the Interface have to be either OFF or SUSPENDED before the Interface can be autosuspended. Testing Done: - Check the runtime_status of an interface driver and validate the suspend current of a module. Signed-off-by: David Lin <dtwlin@google.com> Signed-off-by: Axel Haslam <ahaslam@baylibre.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Alex Elder <elder@linaro.org>
2016-06-09greybus: Remove legacy suspend/resume callbacksViresh Kumar1-3/+0
We should be using the PM hooks available within the 'struct device_driver', instead of adding legacy suspend/resume callbacks. Remove them. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-06greybus: timesync: Add timesync core driverBryan O'Donoghue1-1/+1
This patch adds the core timesync functionality. 0. arche-platform.c/arche-apb-ctrl.c Modifies the platform layer to hook the incoming TIME_SYNC signal up to the timesync strobe IRQ handler. If the arche-platform driver can't satisfy the request for the wake-detect line, it will return -EAGAIN and the calling work-queue must reschedule the attempt to get exclusive access to the wake-detect pin logic. A private data field is added to the arche-platform driver to enable passing of a timesync pointer to the ISR responsible for synchronizing time. 1. timesync.c A new file added which contains all of the logic associated with sending greybus commands to SVC, APBx or Interfaces to enable, disable and disseminate timing information. 2. timesync_platform.c Any platform/arch specific code goes into timesync_platform.c. Originally the idea was to keep the x86 and ARM arch dependencies in a timesync_platform_arch.c file - however with further refinement that's currently not necessary however just-in-case it becomes necessary to resuscitate arch or platform specific methods for accessing timer resources that access shouldn't be part of the core timesync.c logic and so for the moment we access these timer resources through a thin access layer in timesync_platform.c. Expect this to go away long term ideally. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Acked-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-20greybus: legacy: remove legacy driver supportDavid Lin1-1/+0
This patch removes the greybus legacy driver support Signed-off-by: David Lin <dtwlin@google.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-04-25greybus: core: add module abstractionJohan Hovold1-0/+7
Add Greybus module abstraction that will be used to implement controlled module removal (eject) and represent module geometry. Greybus module devices correspond to physical modules and have one or more interfaces. Modules have an id that is identical to the id of their primary interface, which in turn is the interface with lowest numbered id. The module name is constructed from the bus and module id: <bus_id>-<module_id> Interfaces, bundles, and control devices are consequently renamed as <bus_id>-<module_id>.<interface_id> <bus_id>-<module_id>.<interface_id>.<bundle_id> <bus_id>-<module_id>.<interface_id>.ctrl As before, interface ids (and therefore in a sense now also module ids) correspond to physical interface positions on the frame. Modules have the following attributes: module_id num_interfaces where module_id is the id of the module and num_interface the number of interfaces the module has. Note that until SVC module-size detection has been implemented, all interfaces are considered to be part of 1x2 modules. Specifically, the two interfaces of a 2x2 module will be presented as two 1x2 modules for now. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-04-21greybus: core: make the control object be a deviceJohan Hovold1-0/+6
Make the control object be a greybus device. The control device will be used to expose attributes specific to greybus-type interfaces. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-02-01greybus: firmware: convert to bundle driverJohan Hovold1-1/+0
Convert the legacy firmware protocol driver to a bundle driver. This also fixes a potential crash should a (malicious) module have sent an early request before the private data had been initialised. Note that the firmware protocol needs to support the version request indefinitely since it has been burnt into ROM. In order to avoid having to update current module-loading scripts, keep this driver internal to greybus core at least until modalias support is added. Note that there is no MODULE_DEVICE_TABLE defined for firmware as we cannot have two greybus tables in one module on ancient 3.10 kernels and that the legacy driver is currently also internal to core. This needs be added once the driver can be built as a module. Testing Done: Tested on DB3. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-09greybus: core: add drvdata accessorsJohan Hovold1-0/+10
Add greybus driver-data accessors. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-25greybus: kill the endoJohan Hovold1-14/+0
Remove the now unused endo and module code. Note that the never-implemented serial and version attributes of the endo can be implemented as svc attributes if needed. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-25greybus: svc: register svc device at helloJohan Hovold1-0/+6
Register the svc device upon reception of the HELLO request. The SVC HELLO request contains the endo id and AP interface id, which will be exposed from the svc device rather than the endo. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-25greybus: hd: make host device a deviceJohan Hovold1-0/+6
Make the host device a proper device in the kernel device model. Host devices will be our new greybus-bus root devices. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-21greybus: add class matching macroJohan Hovold1-0/+4
Add matching macro for bundle class. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-21greybus: remove unique-id matchingJohan Hovold1-4/+0
Remove unique-id matching as it does not make much sense to have a driver match a specific device serial number. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-21greybus: fix bundle-id match macrosJohan Hovold1-4/+4
The matching flags were renamed over a year ago but the so far unused id-macros were never updated. Also rename the GREYBUS_ID_MATCH_DEVICE mask to use the common GREYBUS_ID_MATCH-prefix. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-04greybus: hd: rename host-device structureJohan Hovold1-1/+1
Rename host-device structure gb_host_device to match our other structures. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-04greybus: create host-device compilation unitJohan Hovold1-47/+1
Move everything host-device related to hd.c and hd.h. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-04greybus: remove obsolete commentJohan Hovold1-10/+0
Remove obsolete comment about the driver model. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-04greybus: remove unused connection device typeJohan Hovold1-1/+0
The connection device type is no longer used. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-11-04greybus: remove unused host-device idJohan Hovold1-1/+0
Remove unused device_id field from host-device structure. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-10-21greybus: endo: move greybus_endo_setup() to endo.cViresh Kumar1-2/+0
It belongs to the endo layer and should be placed in endo.c instead. Do it. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-10-19greybus: core: remove uevent handling for gb_connectionGreg Kroah-Hartman1-5/+0
As we are going to be removing the struct device from gb_connection, there is no need to do anything for uevents for them. So just remove the code. It wasn't doing anything anyway, so no functionality is lost here at all. As is_gb_connection() is no longer used, that is also removed in this patch. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
2015-10-15greybus: es1,es2: add USB vendor command to timestampBryan O'Donoghue1-0/+3
As part of an effort to get deep inspection of latencies throughout the greybus network including HSIC, UniPro and firmware incurred latencies a new command to the APBridge to tag a known offset with timestamping data has been introduced. This patch adds that code to the es1 and es2 drivers. - latency_tag_enable - latency_tag_disable Respectively send the enable/disable command to APBridge on a per-CPort basis. This allows only specified cports to have timestamping data added by APBridge, leaving any CPort not specifically enabled untouched. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-09-17greybus: hd: remove connection-create/destroy callbacksJohan Hovold1-2/+0
These host-driver callbacks were intended to allow host drivers to prepare a cport, something which can now be handled by the cport enable/disable callbacks instead. The current create/destroy are somewhat confusingly named as they were not supposed to create or destroy connections. They were however called from the unrelated helper functions that do create and destroy SVC connections. Furthermore, no errors were returned should the create callback fail, which should have caused the connection initialisation to fail. Remove these unused callbacks for now, and let us use the cport enable/disable callbacks that should be able handle all host cport initialisation (possibly after also adding an interface to provide information for endpoint-cport mapping). Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-09-17greybus: hd: add optional cport enable and disable callbacksJohan Hovold1-0/+2
Add optional cport enable and disable callbacks to the greybus host drivers, that can be used to initialise and allocate/release resources associated with a cport during connection setup/teardown (e.g. software queues and hardware state). Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-09-04greybus: Greybus driver: add a new callbacks to driverAlexandre Bailon1-0/+2
Add connection_create and connection_destroy callbacks. ES2 can map a cport to a pair of endpoints. Because ES2 have only a few pair of endpoints, ES2 need to have access to some high level connection information such as protocol id to effectively map the cports. These callback will provide these information and help ES2 to map cports. Signed-off-by: Alexandre Bailon <abailon@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-09-03greybus: fix cport-id definesJohan Hovold1-9/+3
The CPORT_ID_MAX define has been used by host drivers as a device limit, but also for sanity checks when parsing manifests. Now that it's only used for sanity checks we can increase it to the specification maximum (4095) and get rid of the config-option that could be used to override the previous limit (128). Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
2015-09-02greybus: add num_cports field to greybus hdFabien Parent1-3/+7
This commit is doing the preparation work in order to get the number of cports supported from the UniPro IP instead of using a constant defined in a Kconfig file. Greybus host device is now holding the cport count, and all the code will now use this value instead of the constant CPORT_ID_MAX when referring to an AP's CPort ID. Signed-off-by: Fabien Parent <fparent@baylibre.com> [johan: es1 supports 256 cports, minor style changes ] Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
2015-08-11greybus: Merge branch 'master' into branch 'svc'.Greg Kroah-Hartman1-0/+1
This drags in the firmware driver, and the start of some loopback changes. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11greybus: Add firmware protocol driverViresh Kumar1-0/+1
This adds firmware protocol driver based on the latest specs available on mailing lists. This uses the firmware framework present in kernel. Refer Documentation/firmware_class/README on how it works. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-29greybus: remove svc_msg.hViresh Kumar1-1/+0
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-29greybus: remove submit_svc from the host driverGreg Kroah-Hartman1-2/+0
The callback is never used anymore, so remove it from struct greybus_host_driver as well as from the es1 and es2 drivers. Tested-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-29greybus: greybus.h: remove greybus_svc_in()Greg Kroah-Hartman1-1/+0
The function is gone, remove it from the header file as well. Tested-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-29greybus: svc: connection: ask SVC to create connectionsPerry Hung1-0/+1
Ask the SVC to do all the necessary bits for creating a new connection. This is skipped for the initial SVC connection. Tested-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Perry Hung <perry@leaflabs.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-29greybus: get rid of old svc-protocolViresh Kumar1-2/+0
Its not used anymore as we have more sophisticated svc protocol in place, lets get rid of earlier code. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Tested-by: Perry Hung <perry@leaflabs.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-29greybus: svc: revert svc changes to keep things working for a while.Greg Kroah-Hartman1-1/+6
The firmware for the svc changes isn't quite ready, so revert the whole set of patches in one hunk to get things back to a working state for the other firmware developers. The svc patches will be added back in a separate branch. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-27greybus: remove svc_msg.hViresh Kumar1-1/+0
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-27greybus: remove submit_svc from the host driverGreg Kroah-Hartman1-2/+0
The callback is never used anymore, so remove it from struct greybus_host_driver as well as from the es1 and es2 drivers. Tested-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-27greybus: greybus.h: remove greybus_svc_in()Greg Kroah-Hartman1-1/+0
The function is gone, remove it from the header file as well. Tested-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-27greybus: svc: connection: ask SVC to create connectionsPerry Hung1-0/+1
Ask the SVC to do all the necessary bits for creating a new connection. This is skipped for the initial SVC connection. Tested-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Perry Hung <perry@leaflabs.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-27greybus: get rid of old svc-protocolViresh Kumar1-2/+0
Its not used anymore as we have more sophisticated svc protocol in place, lets get rid of earlier code. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Tested-by: Perry Hung <perry@leaflabs.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-22greybus: svc: Add helpers to create AP<->SVC connectionViresh Kumar1-0/+1
SVC connection is required before the AP knows its position on the endo and type of endo. To enable message processing between the AP and SVC at this time, we need a partially initialized connection which can handle these messages. Once the AP receives more information from the SVC, it can discard this partially initialized connection and create a proper one, tied to a bundle and interface. Destroying the partially initialized connection is a bit tricky, as it is required to send a response to svc-hello. That part will be properly fixed separately. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-01greybus: operation/esx: fix message-cancellation lifetime bugsJohan Hovold1-2/+2
The current host-controller message-cancellation implementation suffer from a lifetime bug as dynamically allocated URBs would complete and be deallocated while being unlinked as part of cancellation. The current locking is also insufficient to prevent the related race where the URB is deallocated before being unlinked. Fix this by pushing the cancellation implementation from greybus core down to the host-controller drivers, and replace the "cookie" pointer with a hcpriv field that those drivers can use to maintain their state with the required locking and reference counting in place. Specifically the drivers need to acquire a reference to the URB under a lock before calling usb_kill_urb as part of cancellation. Note that this also removes the insufficient gb_message_mutex, which also effectively prevented us from implementing support for submissions from atomic context. Instead the host-controller drivers must now explicitly make sure that the pre-allocated URBs are not reused while cancellation is in progress. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-01greybus: svc: Drop svc_set_route_send()Viresh Kumar1-3/+0
The responsibility of this routine is to configure ARA switch to establish a connection between a cport on the AP and a cport on an interface. The SVC protocol is responsible for such requests and we already have connection_{create|destroy}_operation() to take care of this. Moreover, this request is not served by the firmware or gbsim today and they just print a debug message on this request. And so it is safe to drop svc_set_route_send() function and fix the required functionality of configuring the switch in svc protocol driver later. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-06-23greybus: Add control protocol supportViresh Kumar1-0/+1
Add control protocol driver that is responsible for handling operations on control CPort. The AP also needs to support incoming requests on its control port. Features not implemented yet are marked as TODO for now. NOTE: This also fixes cport-bundle-id to 0 and cport-id to 2 for control protocol. Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-06-16greybus: Revert "greybus: reserve host cport id 0"Greg Kroah-Hartman1-1/+1
This reverts commit 698d4bd3e7541a660a3c3665f0af9e787650a239 as Alex says it is broken. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-06-15greybus: reserve host cport id 0Alex Elder1-1/+1
For ES1 and ES2, we use pad bytes in an operation message header to encode the CPort ID used for transferring the message. The pad bytes should otherwise be zero, and we ensure this as the message is passed to or from the upper layer. If host-side CPort ID 0 is used, we have no way of knowing whether the CPort field has been "packed" into the header. To allow detection of this, reserve host CPort id 0. Update cport_id_valid() to treat 0 as invalid. (CPort ID 0 is reserved by one of the UniPro standards. We'll assume for now that we never use it for Greybus.) Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>