* Returns a pointer to the new connection if successful, or a null
* pointer otherwise.
*/
-struct gb_connection *gb_connection_create(struct gb_bundle *bundle,
- u16 cport_id, u8 protocol_id)
+struct gb_connection *
+gb_connection_create_range(struct gb_bundle *bundle, u16 cport_id,
+ u8 protocol_id, u32 ida_start, u32 ida_end)
{
struct gb_connection *connection;
struct greybus_host_device *hd = bundle->intf->hd;
if (!connection)
return NULL;
- retval = ida_simple_get(id_map, 0, CPORT_ID_MAX, GFP_KERNEL);
+ retval = ida_simple_get(id_map, ida_start, ida_end, GFP_KERNEL);
if (retval < 0) {
kfree(connection);
return NULL;
return connection;
}
+struct gb_connection *gb_connection_create(struct gb_bundle *bundle,
+ u16 cport_id, u8 protocol_id)
+{
+ return gb_connection_create_range(bundle, cport_id, protocol_id, 0,
+ CPORT_ID_MAX);
+}
+
/*
* Cancel all active operations on a connection.
*
struct gb_connection *gb_connection_create(struct gb_bundle *bundle,
u16 cport_id, u8 protocol_id);
+struct gb_connection *gb_connection_create_range(struct gb_bundle *bundle,
+ u16 cport_id, u8 protocol_id, u32 ida_start,
+ u32 ida_end);
void gb_connection_destroy(struct gb_connection *connection);
int gb_connection_init(struct gb_connection *connection);