Commit ee43f745 authored by Nicolas Saenz Julienne's avatar Nicolas Saenz Julienne Committed by Greg Kroah-Hartman

staging: vchiq_arm: get rid of vchi_mh.h

The concept of VCHI_MEM_HANDLE_T is introduced by this header file and
was meant to be used with bulk transfers. After a quick look in
vchiq_core.c it is pretty clear that it actually accomplishes nothing
nor alters the bulk transfers in any way.
Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Acked-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 46e4b9ec
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include "interface/vchi/vchi_cfg.h" #include "interface/vchi/vchi_cfg.h"
#include "interface/vchi/vchi_common.h" #include "interface/vchi/vchi_common.h"
#include "vchi_mh.h"
/****************************************************************************** /******************************************************************************
Global defs Global defs
...@@ -239,7 +238,6 @@ extern int32_t vchi_bulk_queue_receive(VCHI_SERVICE_HANDLE_T handle, ...@@ -239,7 +238,6 @@ extern int32_t vchi_bulk_queue_receive(VCHI_SERVICE_HANDLE_T handle,
// Prepare interface for a transfer from the other side into relocatable memory. // Prepare interface for a transfer from the other side into relocatable memory.
int32_t vchi_bulk_queue_receive_reloc(const VCHI_SERVICE_HANDLE_T handle, int32_t vchi_bulk_queue_receive_reloc(const VCHI_SERVICE_HANDLE_T handle,
VCHI_MEM_HANDLE_T h_dst,
uint32_t offset, uint32_t offset,
uint32_t data_size, uint32_t data_size,
const VCHI_FLAGS_T flags, const VCHI_FLAGS_T flags,
...@@ -261,7 +259,6 @@ extern int32_t vchi_bulk_queue_transmit(VCHI_SERVICE_HANDLE_T handle, ...@@ -261,7 +259,6 @@ extern int32_t vchi_bulk_queue_transmit(VCHI_SERVICE_HANDLE_T handle,
#endif #endif
extern int32_t vchi_bulk_queue_transmit_reloc(VCHI_SERVICE_HANDLE_T handle, extern int32_t vchi_bulk_queue_transmit_reloc(VCHI_SERVICE_HANDLE_T handle,
VCHI_MEM_HANDLE_T h_src,
uint32_t offset, uint32_t offset,
uint32_t data_size, uint32_t data_size,
VCHI_FLAGS_T flags, VCHI_FLAGS_T flags,
......
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) */
/**
* Copyright (c) 2010-2012 Broadcom. All rights reserved.
*/
#ifndef VCHI_MH_H_
#define VCHI_MH_H_
#include <linux/types.h>
typedef s32 VCHI_MEM_HANDLE_T;
#define VCHI_MEM_HANDLE_INVALID 0
#endif
...@@ -247,13 +247,10 @@ remote_event_signal(REMOTE_EVENT_T *event) ...@@ -247,13 +247,10 @@ remote_event_signal(REMOTE_EVENT_T *event)
} }
VCHIQ_STATUS_T VCHIQ_STATUS_T
vchiq_prepare_bulk_data(VCHIQ_BULK_T *bulk, VCHI_MEM_HANDLE_T memhandle, vchiq_prepare_bulk_data(VCHIQ_BULK_T *bulk, void *offset, int size, int dir)
void *offset, int size, int dir)
{ {
struct vchiq_pagelist_info *pagelistinfo; struct vchiq_pagelist_info *pagelistinfo;
WARN_ON(memhandle != VCHI_MEM_HANDLE_INVALID);
pagelistinfo = create_pagelist((char __user *)offset, size, pagelistinfo = create_pagelist((char __user *)offset, size,
(dir == VCHIQ_BULK_RECEIVE) (dir == VCHIQ_BULK_RECEIVE)
? PAGELIST_READ ? PAGELIST_READ
...@@ -262,7 +259,6 @@ vchiq_prepare_bulk_data(VCHIQ_BULK_T *bulk, VCHI_MEM_HANDLE_T memhandle, ...@@ -262,7 +259,6 @@ vchiq_prepare_bulk_data(VCHIQ_BULK_T *bulk, VCHI_MEM_HANDLE_T memhandle,
if (!pagelistinfo) if (!pagelistinfo)
return VCHIQ_ERROR; return VCHIQ_ERROR;
bulk->handle = memhandle;
bulk->data = (void *)(unsigned long)pagelistinfo->dma_addr; bulk->data = (void *)(unsigned long)pagelistinfo->dma_addr;
/* /*
......
...@@ -419,9 +419,9 @@ vchiq_bulk_transmit(VCHIQ_SERVICE_HANDLE_T handle, const void *data, ...@@ -419,9 +419,9 @@ vchiq_bulk_transmit(VCHIQ_SERVICE_HANDLE_T handle, const void *data,
switch (mode) { switch (mode) {
case VCHIQ_BULK_MODE_NOCALLBACK: case VCHIQ_BULK_MODE_NOCALLBACK:
case VCHIQ_BULK_MODE_CALLBACK: case VCHIQ_BULK_MODE_CALLBACK:
status = vchiq_bulk_transfer(handle, status = vchiq_bulk_transfer(handle, (void *)data, size,
VCHI_MEM_HANDLE_INVALID, (void *)data, size, userdata, userdata, mode,
mode, VCHIQ_BULK_TRANSMIT); VCHIQ_BULK_TRANSMIT);
break; break;
case VCHIQ_BULK_MODE_BLOCKING: case VCHIQ_BULK_MODE_BLOCKING:
status = vchiq_blocking_bulk_transfer(handle, status = vchiq_blocking_bulk_transfer(handle,
...@@ -444,9 +444,8 @@ vchiq_bulk_receive(VCHIQ_SERVICE_HANDLE_T handle, void *data, ...@@ -444,9 +444,8 @@ vchiq_bulk_receive(VCHIQ_SERVICE_HANDLE_T handle, void *data,
switch (mode) { switch (mode) {
case VCHIQ_BULK_MODE_NOCALLBACK: case VCHIQ_BULK_MODE_NOCALLBACK:
case VCHIQ_BULK_MODE_CALLBACK: case VCHIQ_BULK_MODE_CALLBACK:
status = vchiq_bulk_transfer(handle, status = vchiq_bulk_transfer(handle, data, size, userdata,
VCHI_MEM_HANDLE_INVALID, data, size, userdata, mode, VCHIQ_BULK_RECEIVE);
mode, VCHIQ_BULK_RECEIVE);
break; break;
case VCHIQ_BULK_MODE_BLOCKING: case VCHIQ_BULK_MODE_BLOCKING:
status = vchiq_blocking_bulk_transfer(handle, status = vchiq_blocking_bulk_transfer(handle,
...@@ -513,9 +512,8 @@ vchiq_blocking_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, void *data, ...@@ -513,9 +512,8 @@ vchiq_blocking_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, void *data,
} }
} }
status = vchiq_bulk_transfer(handle, VCHI_MEM_HANDLE_INVALID, status = vchiq_bulk_transfer(handle, data, size, &waiter->bulk_waiter,
data, size, &waiter->bulk_waiter, VCHIQ_BULK_MODE_BLOCKING, VCHIQ_BULK_MODE_BLOCKING, dir);
dir);
if ((status != VCHIQ_RETRY) || fatal_signal_pending(current) || if ((status != VCHIQ_RETRY) || fatal_signal_pending(current) ||
!waiter->bulk_waiter.bulk) { !waiter->bulk_waiter.bulk) {
VCHIQ_BULK_T *bulk = waiter->bulk_waiter.bulk; VCHIQ_BULK_T *bulk = waiter->bulk_waiter.bulk;
...@@ -1149,14 +1147,13 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1149,14 +1147,13 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
current->pid); current->pid);
args.userdata = &waiter->bulk_waiter; args.userdata = &waiter->bulk_waiter;
} }
status = vchiq_bulk_transfer
(args.handle, status = vchiq_bulk_transfer(args.handle, args.data, args.size,
VCHI_MEM_HANDLE_INVALID, args.userdata, args.mode, dir);
args.data, args.size,
args.userdata, args.mode,
dir);
if (!waiter) if (!waiter)
break; break;
if ((status != VCHIQ_RETRY) || fatal_signal_pending(current) || if ((status != VCHIQ_RETRY) || fatal_signal_pending(current) ||
!waiter->bulk_waiter.bulk) { !waiter->bulk_waiter.bulk) {
if (waiter->bulk_waiter.bulk) { if (waiter->bulk_waiter.bulk) {
......
...@@ -3313,10 +3313,10 @@ vchiq_remove_service(VCHIQ_SERVICE_HANDLE_T handle) ...@@ -3313,10 +3313,10 @@ vchiq_remove_service(VCHIQ_SERVICE_HANDLE_T handle)
* When called in blocking mode, the userdata field points to a bulk_waiter * When called in blocking mode, the userdata field points to a bulk_waiter
* structure. * structure.
*/ */
VCHIQ_STATUS_T VCHIQ_STATUS_T vchiq_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle,
vchiq_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, void *offset, int size, void *userdata,
VCHI_MEM_HANDLE_T memhandle, void *offset, int size, void *userdata, VCHIQ_BULK_MODE_T mode,
VCHIQ_BULK_MODE_T mode, VCHIQ_BULK_DIR_T dir) VCHIQ_BULK_DIR_T dir)
{ {
VCHIQ_SERVICE_T *service = find_service_by_handle(handle); VCHIQ_SERVICE_T *service = find_service_by_handle(handle);
VCHIQ_BULK_QUEUE_T *queue; VCHIQ_BULK_QUEUE_T *queue;
...@@ -3328,10 +3328,8 @@ vchiq_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, ...@@ -3328,10 +3328,8 @@ vchiq_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle,
VCHIQ_MSG_BULK_TX : VCHIQ_MSG_BULK_RX; VCHIQ_MSG_BULK_TX : VCHIQ_MSG_BULK_RX;
VCHIQ_STATUS_T status = VCHIQ_ERROR; VCHIQ_STATUS_T status = VCHIQ_ERROR;
if (!service || if (!service || service->srvstate != VCHIQ_SRVSTATE_OPEN ||
(service->srvstate != VCHIQ_SRVSTATE_OPEN) || !offset || vchiq_check_service(service) != VCHIQ_SUCCESS)
((memhandle == VCHI_MEM_HANDLE_INVALID) && (offset == NULL)) ||
(vchiq_check_service(service) != VCHIQ_SUCCESS))
goto error_exit; goto error_exit;
switch (mode) { switch (mode) {
...@@ -3388,8 +3386,7 @@ vchiq_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, ...@@ -3388,8 +3386,7 @@ vchiq_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle,
bulk->size = size; bulk->size = size;
bulk->actual = VCHIQ_BULK_ACTUAL_ABORTED; bulk->actual = VCHIQ_BULK_ACTUAL_ABORTED;
if (vchiq_prepare_bulk_data(bulk, memhandle, offset, size, dir) != if (vchiq_prepare_bulk_data(bulk, offset, size, dir) != VCHIQ_SUCCESS)
VCHIQ_SUCCESS)
goto unlock_error_exit; goto unlock_error_exit;
wmb(); wmb();
......
...@@ -242,7 +242,6 @@ typedef struct vchiq_bulk_struct { ...@@ -242,7 +242,6 @@ typedef struct vchiq_bulk_struct {
short mode; short mode;
short dir; short dir;
void *userdata; void *userdata;
VCHI_MEM_HANDLE_T handle;
void *data; void *data;
int size; int size;
void *remote_data; void *remote_data;
...@@ -566,9 +565,9 @@ extern void ...@@ -566,9 +565,9 @@ extern void
remote_event_pollall(VCHIQ_STATE_T *state); remote_event_pollall(VCHIQ_STATE_T *state);
extern VCHIQ_STATUS_T extern VCHIQ_STATUS_T
vchiq_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, vchiq_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, void *offset, int size,
VCHI_MEM_HANDLE_T memhandle, void *offset, int size, void *userdata, void *userdata, VCHIQ_BULK_MODE_T mode,
VCHIQ_BULK_MODE_T mode, VCHIQ_BULK_DIR_T dir); VCHIQ_BULK_DIR_T dir);
extern void extern void
vchiq_dump_state(void *dump_context, VCHIQ_STATE_T *state); vchiq_dump_state(void *dump_context, VCHIQ_STATE_T *state);
...@@ -624,8 +623,7 @@ unlock_service(VCHIQ_SERVICE_T *service); ...@@ -624,8 +623,7 @@ unlock_service(VCHIQ_SERVICE_T *service);
** implementations must be provided. */ ** implementations must be provided. */
extern VCHIQ_STATUS_T extern VCHIQ_STATUS_T
vchiq_prepare_bulk_data(VCHIQ_BULK_T *bulk, vchiq_prepare_bulk_data(VCHIQ_BULK_T *bulk, void *offset, int size, int dir);
VCHI_MEM_HANDLE_T memhandle, void *offset, int size, int dir);
extern void extern void
vchiq_transfer_bulk(VCHIQ_BULK_T *bulk); vchiq_transfer_bulk(VCHIQ_BULK_T *bulk);
......
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
#ifndef VCHIQ_IF_H #ifndef VCHIQ_IF_H
#define VCHIQ_IF_H #define VCHIQ_IF_H
#include "interface/vchi/vchi_mh.h"
#define VCHIQ_SERVICE_HANDLE_INVALID 0 #define VCHIQ_SERVICE_HANDLE_INVALID 0
#define VCHIQ_SLOT_SIZE 4096 #define VCHIQ_SLOT_SIZE 4096
...@@ -156,11 +154,11 @@ extern VCHIQ_STATUS_T vchiq_bulk_receive(VCHIQ_SERVICE_HANDLE_T service, ...@@ -156,11 +154,11 @@ extern VCHIQ_STATUS_T vchiq_bulk_receive(VCHIQ_SERVICE_HANDLE_T service,
void *data, unsigned int size, void *userdata, void *data, unsigned int size, void *userdata,
VCHIQ_BULK_MODE_T mode); VCHIQ_BULK_MODE_T mode);
extern VCHIQ_STATUS_T vchiq_bulk_transmit_handle(VCHIQ_SERVICE_HANDLE_T service, extern VCHIQ_STATUS_T vchiq_bulk_transmit_handle(VCHIQ_SERVICE_HANDLE_T service,
VCHI_MEM_HANDLE_T handle, const void *offset, unsigned int size, const void *offset, unsigned int size,
void *userdata, VCHIQ_BULK_MODE_T mode); void *userdata, VCHIQ_BULK_MODE_T mode);
extern VCHIQ_STATUS_T vchiq_bulk_receive_handle(VCHIQ_SERVICE_HANDLE_T service, extern VCHIQ_STATUS_T vchiq_bulk_receive_handle(VCHIQ_SERVICE_HANDLE_T service,
VCHI_MEM_HANDLE_T handle, void *offset, unsigned int size, void *offset, unsigned int size, void *userdata,
void *userdata, VCHIQ_BULK_MODE_T mode); VCHIQ_BULK_MODE_T mode);
extern int vchiq_get_client_id(VCHIQ_SERVICE_HANDLE_T service); extern int vchiq_get_client_id(VCHIQ_SERVICE_HANDLE_T service);
extern void *vchiq_get_service_userdata(VCHIQ_SERVICE_HANDLE_T service); extern void *vchiq_get_service_userdata(VCHIQ_SERVICE_HANDLE_T service);
extern int vchiq_get_service_fourcc(VCHIQ_SERVICE_HANDLE_T service); extern int vchiq_get_service_fourcc(VCHIQ_SERVICE_HANDLE_T service);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment