1 /* 2 * Copyright (C) 2020 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #pragma once 18 19 #include <lib/tipc/tipc_srv.h> 20 #include <lk/compiler.h> 21 22 __BEGIN_CDECLS 23 24 /** 25 * add_spi_service() - Add new SPI service to service set 26 * @hset: pointer to handle set to add service to 27 * @ports: an array of &struct tipc_port describing ports for this 28 * service 29 * @num_ports: number of ports in array pointed by @ports 30 * 31 * Caller must provide a pointer to &struct spi_dev_ctx as port-specific private 32 * data in @priv field of &struct tipc_port. 33 * 34 * This routine can be called multiple times to register multiple services. 35 * 36 * Each port in @ports may have at most one active connection. 37 * 38 * Return: 0 on success, negative error code otherwise 39 */ 40 int add_spi_service(struct tipc_hset* hset, 41 const struct tipc_port* ports, 42 size_t num_ports); 43 44 __END_CDECLS 45