summaryrefslogtreecommitdiff
path: root/drivers/staging/vc04_services/interface/vchi/vchi_common.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-05-07 13:31:29 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-07 13:31:29 -0700
commite0dccbdf5ac7ccb9da5612100dedba302f3ebcfe (patch)
tree0bdabbf13844ae18da61bc060348850a8038f0ba /drivers/staging/vc04_services/interface/vchi/vchi_common.h
parentcf482a49af564a3044de3178ea28f10ad5921b38 (diff)
parente2a5be107f52cefb9010ccae6f569c3ddaa954cc (diff)
Merge tag 'staging-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging / IIO driver updates from Greg KH: "Here is the big staging and iio driver update for 5.2-rc1. Lots of tiny fixes all over the staging and IIO driver trees here, along with some new IIO drivers. The "counter" subsystem was added in here as well, as it is needed by the IIO drivers and subsystem. Also we ended up deleting two drivers, making this pull request remove a few hundred thousand lines of code, always a nice thing to see. Both of the drivers removed have been replaced with "real" drivers in their various subsystem directories, and they will be coming to you from those locations during this merge window. There are some core vt/selection changes in here, that was due to some cleanups needed for the speakup fixes. Those have all been acked by the various subsystem maintainers (i.e. me), so those are ok. We also added a few new drivers, for some odd hardware, giving new developers plenty to work on with basic coding style cleanups to come in the near future. Other than that, nothing unusual here. All of these have been in linux-next for a while with no reported issues, other than an odd gcc warning for one of the new drivers that should be fixed up soon" [ I fixed up the warning myself - Linus ] * tag 'staging-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (663 commits) staging: kpc2000: kpc_spi: Fix build error for {read,write}q Staging: rtl8192e: Remove extra space before break statement Staging: rtl8192u: ieee80211: Fix if-else indentation warning Staging: rtl8192u: ieee80211: Fix indentation errors by removing extra spaces staging: most: cdev: fix chrdev_region leak in mod_exit staging: wlan-ng: Fix improper SPDX comment style staging: rtl8192u: ieee80211: Resolve ERROR reported by checkpatch staging: vc04_services: bcm2835-camera: Compress two lines into one line staging: rtl8723bs: core: Use !x in place of NULL comparison. staging: rtl8723bs: core: Prefer using the BIT Macro. staging: fieldbus: anybus-s: fix wait_for_completion_timeout return handling staging: kpc2000: fix up build problems with readq() staging: rtlwifi: move remaining phydm .h files staging: rtlwifi: strip down phydm .h files staging: rtlwifi: delete the staging driver staging: fieldbus: anybus-s: rename bus id field to avoid confusion staging: fieldbus: anybus-s: keep device bus id in bus endianness Staging: sm750fb: Change *array into *const array staging: rtl8192u: ieee80211: Fix spelling mistake staging: rtl8192u: ieee80211: Replace bit shifting with BIT macro ...
Diffstat (limited to 'drivers/staging/vc04_services/interface/vchi/vchi_common.h')
-rw-r--r--drivers/staging/vc04_services/interface/vchi/vchi_common.h176
1 files changed, 73 insertions, 103 deletions
diff --git a/drivers/staging/vc04_services/interface/vchi/vchi_common.h b/drivers/staging/vc04_services/interface/vchi/vchi_common.h
index 35f331f80812..e7955cbaf26a 100644
--- a/drivers/staging/vc04_services/interface/vchi/vchi_common.h
+++ b/drivers/staging/vc04_services/interface/vchi/vchi_common.h
@@ -1,124 +1,94 @@
-/**
- * Copyright (c) 2010-2012 Broadcom. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions, and the following disclaimer,
- * without modification.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The names of the above-listed copyright holders may not be used
- * to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * ALTERNATIVELY, this software may be distributed under the terms of the
- * GNU General Public License ("GPL") version 2, as published by the Free
- * Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
+/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
+/* Copyright (c) 2010-2012 Broadcom. All rights reserved. */
#ifndef VCHI_COMMON_H_
#define VCHI_COMMON_H_
//flags used when sending messages (must be bitmapped)
typedef enum {
- VCHI_FLAGS_NONE = 0x0,
- VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE = 0x1, // waits for message to be received, or sent (NB. not the same as being seen on other side)
- VCHI_FLAGS_CALLBACK_WHEN_OP_COMPLETE = 0x2, // run a callback when message sent
- VCHI_FLAGS_BLOCK_UNTIL_QUEUED = 0x4, // return once the transfer is in a queue ready to go
- VCHI_FLAGS_ALLOW_PARTIAL = 0x8,
- VCHI_FLAGS_BLOCK_UNTIL_DATA_READ = 0x10,
- VCHI_FLAGS_CALLBACK_WHEN_DATA_READ = 0x20,
-
- VCHI_FLAGS_ALIGN_SLOT = 0x000080, // internal use only
- VCHI_FLAGS_BULK_AUX_QUEUED = 0x010000, // internal use only
- VCHI_FLAGS_BULK_AUX_COMPLETE = 0x020000, // internal use only
- VCHI_FLAGS_BULK_DATA_QUEUED = 0x040000, // internal use only
- VCHI_FLAGS_BULK_DATA_COMPLETE = 0x080000, // internal use only
- VCHI_FLAGS_INTERNAL = 0xFF0000
+ VCHI_FLAGS_NONE = 0x0,
+ VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE = 0x1, // waits for message to be received, or sent (NB. not the same as being seen on other side)
+ VCHI_FLAGS_CALLBACK_WHEN_OP_COMPLETE = 0x2, // run a callback when message sent
+ VCHI_FLAGS_BLOCK_UNTIL_QUEUED = 0x4, // return once the transfer is in a queue ready to go
+ VCHI_FLAGS_ALLOW_PARTIAL = 0x8,
+ VCHI_FLAGS_BLOCK_UNTIL_DATA_READ = 0x10,
+ VCHI_FLAGS_CALLBACK_WHEN_DATA_READ = 0x20,
+
+ VCHI_FLAGS_ALIGN_SLOT = 0x000080, // internal use only
+ VCHI_FLAGS_BULK_AUX_QUEUED = 0x010000, // internal use only
+ VCHI_FLAGS_BULK_AUX_COMPLETE = 0x020000, // internal use only
+ VCHI_FLAGS_BULK_DATA_QUEUED = 0x040000, // internal use only
+ VCHI_FLAGS_BULK_DATA_COMPLETE = 0x080000, // internal use only
+ VCHI_FLAGS_INTERNAL = 0xFF0000
} VCHI_FLAGS_T;
// constants for vchi_crc_control()
typedef enum {
- VCHI_CRC_NOTHING = -1,
- VCHI_CRC_PER_SERVICE = 0,
- VCHI_CRC_EVERYTHING = 1,
+ VCHI_CRC_NOTHING = -1,
+ VCHI_CRC_PER_SERVICE = 0,
+ VCHI_CRC_EVERYTHING = 1,
} VCHI_CRC_CONTROL_T;
//callback reasons when an event occurs on a service
typedef enum {
- VCHI_CALLBACK_REASON_MIN,
-
- //This indicates that there is data available
- //handle is the msg id that was transmitted with the data
- // When a message is received and there was no FULL message available previously, send callback
- // Tasks get kicked by the callback, reset their event and try and read from the fifo until it fails
- VCHI_CALLBACK_MSG_AVAILABLE,
- VCHI_CALLBACK_MSG_SENT,
- VCHI_CALLBACK_MSG_SPACE_AVAILABLE, // XXX not yet implemented
-
- // This indicates that a transfer from the other side has completed
- VCHI_CALLBACK_BULK_RECEIVED,
- //This indicates that data queued up to be sent has now gone
- //handle is the msg id that was used when sending the data
- VCHI_CALLBACK_BULK_SENT,
- VCHI_CALLBACK_BULK_RX_SPACE_AVAILABLE, // XXX not yet implemented
- VCHI_CALLBACK_BULK_TX_SPACE_AVAILABLE, // XXX not yet implemented
-
- VCHI_CALLBACK_SERVICE_CLOSED,
-
- // this side has sent XOFF to peer due to lack of data consumption by service
- // (suggests the service may need to take some recovery action if it has
- // been deliberately holding off consuming data)
- VCHI_CALLBACK_SENT_XOFF,
- VCHI_CALLBACK_SENT_XON,
-
- // indicates that a bulk transfer has finished reading the source buffer
- VCHI_CALLBACK_BULK_DATA_READ,
-
- // power notification events (currently host side only)
- VCHI_CALLBACK_PEER_OFF,
- VCHI_CALLBACK_PEER_SUSPENDED,
- VCHI_CALLBACK_PEER_ON,
- VCHI_CALLBACK_PEER_RESUMED,
- VCHI_CALLBACK_FORCED_POWER_OFF,
-
- // some extra notifications provided by vchiq_arm
- VCHI_CALLBACK_SERVICE_OPENED,
- VCHI_CALLBACK_BULK_RECEIVE_ABORTED,
- VCHI_CALLBACK_BULK_TRANSMIT_ABORTED,
-
- VCHI_CALLBACK_REASON_MAX
+ VCHI_CALLBACK_REASON_MIN,
+
+ //This indicates that there is data available
+ //handle is the msg id that was transmitted with the data
+ // When a message is received and there was no FULL message available previously, send callback
+ // Tasks get kicked by the callback, reset their event and try and read from the fifo until it fails
+ VCHI_CALLBACK_MSG_AVAILABLE,
+ VCHI_CALLBACK_MSG_SENT,
+ VCHI_CALLBACK_MSG_SPACE_AVAILABLE, // XXX not yet implemented
+
+ // This indicates that a transfer from the other side has completed
+ VCHI_CALLBACK_BULK_RECEIVED,
+ //This indicates that data queued up to be sent has now gone
+ //handle is the msg id that was used when sending the data
+ VCHI_CALLBACK_BULK_SENT,
+ VCHI_CALLBACK_BULK_RX_SPACE_AVAILABLE, // XXX not yet implemented
+ VCHI_CALLBACK_BULK_TX_SPACE_AVAILABLE, // XXX not yet implemented
+
+ VCHI_CALLBACK_SERVICE_CLOSED,
+
+ // this side has sent XOFF to peer due to lack of data consumption by service
+ // (suggests the service may need to take some recovery action if it has
+ // been deliberately holding off consuming data)
+ VCHI_CALLBACK_SENT_XOFF,
+ VCHI_CALLBACK_SENT_XON,
+
+ // indicates that a bulk transfer has finished reading the source buffer
+ VCHI_CALLBACK_BULK_DATA_READ,
+
+ // power notification events (currently host side only)
+ VCHI_CALLBACK_PEER_OFF,
+ VCHI_CALLBACK_PEER_SUSPENDED,
+ VCHI_CALLBACK_PEER_ON,
+ VCHI_CALLBACK_PEER_RESUMED,
+ VCHI_CALLBACK_FORCED_POWER_OFF,
+
+ // some extra notifications provided by vchiq_arm
+ VCHI_CALLBACK_SERVICE_OPENED,
+ VCHI_CALLBACK_BULK_RECEIVE_ABORTED,
+ VCHI_CALLBACK_BULK_TRANSMIT_ABORTED,
+
+ VCHI_CALLBACK_REASON_MAX
} VCHI_CALLBACK_REASON_T;
// service control options
typedef enum {
- VCHI_SERVICE_OPTION_MIN,
+ VCHI_SERVICE_OPTION_MIN,
- VCHI_SERVICE_OPTION_TRACE,
- VCHI_SERVICE_OPTION_SYNCHRONOUS,
+ VCHI_SERVICE_OPTION_TRACE,
+ VCHI_SERVICE_OPTION_SYNCHRONOUS,
- VCHI_SERVICE_OPTION_MAX
+ VCHI_SERVICE_OPTION_MAX
} VCHI_SERVICE_OPTION_T;
//Callback used by all services / bulk transfers
typedef void (*VCHI_CALLBACK_T)(void *callback_param, //my service local param
- VCHI_CALLBACK_REASON_T reason,
- void *handle); //for transmitting msg's only
+ VCHI_CALLBACK_REASON_T reason,
+ void *handle); //for transmitting msg's only
/*
* Define vector struct for scatter-gather (vector) operations
@@ -138,8 +108,8 @@ typedef void (*VCHI_CALLBACK_T)(void *callback_param, //my service local param
*
*/
struct vchi_msg_vector {
- const void *vec_base;
- int32_t vec_len;
+ const void *vec_base;
+ int32_t vec_len;
};
// Opaque type for a connection API
@@ -155,10 +125,10 @@ typedef struct opaque_vchi_message_driver_t VCHI_MESSAGE_DRIVER_T;
// is used again after messages for that service are removed/dequeued by any
// means other than vchi_msg_iter_... calls on the iterator itself.
struct vchi_msg_iter {
- struct opaque_vchi_service_t *service;
- void *last;
- void *next;
- void *remove;
+ struct opaque_vchi_service_t *service;
+ void *last;
+ void *next;
+ void *remove;
};
#endif // VCHI_COMMON_H_