zephyr/drivers/bluetooth/controller/util/work.h
Vinayak Chettimada 0d3d1d5c83 Bluetooth: Controller: Add a util folder with basic primitives
The util folder contains memory management, queue management
and misc utilities used by the Link Layer implementation.
This will be in time replaced by Zephyr's native functionality.

Jira: ZEP-702

Origin: Original
Change-Id: Id8602ea41ec44811801dfc582bab244c339eabe3
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-09-07 08:17:26 +03:00

39 lines
1.0 KiB
C

/*
* Copyright (c) 2016 Nordic Semiconductor ASA
* Copyright (c) 2016 Vinayak Kariappa Chettimada
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _WORK_H_
#define _WORK_H_
typedef void (*work_fp) (void *params);
struct work {
void *next;
uint8_t req;
uint8_t ack;
uint8_t group;
work_fp fp;
void *params;
};
void work_enable(uint8_t group);
void work_disable(uint8_t group);
uint8_t work_enabled(uint8_t group);
uint32_t work_schedule(struct work *w, uint8_t chain);
void work_run(uint8_t group);
#endif /* _WORK_H_ */