BUILD module: copied updated headers from the main module, and removed
some unneeded ones, which still had the be copyright. Also removed BufferIO from the build and deleted the implementation, since it wasn't used. There are still some more... +alphabranch git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32829 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Master include file for the App Kit.
|
||||
*
|
||||
*/
|
||||
#include <AppDefs.h>
|
||||
#include <Application.h>
|
||||
#include <Clipboard.h>
|
||||
#include <Handler.h>
|
||||
#include <Invoker.h>
|
||||
#include <Looper.h>
|
||||
#include <Message.h>
|
||||
#include <MessageFilter.h>
|
||||
#include <MessageQueue.h>
|
||||
#include <MessageRunner.h>
|
||||
#include <Messenger.h>
|
||||
#include <PropertyInfo.h>
|
||||
#include <Roster.h>
|
||||
@@ -1,15 +0,0 @@
|
||||
/*
|
||||
* All-in-one include file for the entire system.
|
||||
*
|
||||
*/
|
||||
#include <AppKit.h>
|
||||
#include <DeviceKit.h>
|
||||
#include <GameKit.h>
|
||||
#include <InterfaceKit.h>
|
||||
#include <KernelKit.h>
|
||||
#include <MediaKit.h>
|
||||
#include <MidiKit.h>
|
||||
#include <NetKit.h>
|
||||
#include <StorageKit.h>
|
||||
#include <SupportKit.h>
|
||||
#include <TranslationKit.h>
|
||||
@@ -1,15 +0,0 @@
|
||||
/*
|
||||
* Master include file for the Device Kit.
|
||||
*
|
||||
*/
|
||||
#include <A2D.h>
|
||||
#include <D2A.h>
|
||||
#include <DigitalPort.h>
|
||||
#include <Joystick.h>
|
||||
#include <SerialPort.h>
|
||||
#include <graphic_driver.h>
|
||||
/*
|
||||
#include <perfmon_cpu.h>
|
||||
#include <scsi.h>
|
||||
#include <scsiprobe_driver.h>
|
||||
*/
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Master include file for the Interface Kit.
|
||||
*
|
||||
* <UnicodeBlockObjects.h> is not included on purpose.
|
||||
*/
|
||||
#include <Alert.h>
|
||||
#include <Bitmap.h>
|
||||
#include <Box.h>
|
||||
#include <Button.h>
|
||||
#include <CheckBox.h>
|
||||
#include <ColorControl.h>
|
||||
#include <Control.h>
|
||||
#include <Dragger.h>
|
||||
#include <Font.h>
|
||||
#include <GraphicsDefs.h>
|
||||
#include <Input.h>
|
||||
#include <InterfaceDefs.h>
|
||||
#include <ListItem.h>
|
||||
#include <ListView.h>
|
||||
#include <Menu.h>
|
||||
#include <MenuBar.h>
|
||||
#include <MenuField.h>
|
||||
#include <MenuItem.h>
|
||||
#include <OutlineListView.h>
|
||||
#include <Picture.h>
|
||||
#include <PictureButton.h>
|
||||
#include <Point.h>
|
||||
#include <Polygon.h>
|
||||
#include <PopUpMenu.h>
|
||||
#include <PrintJob.h>
|
||||
#include <RadioButton.h>
|
||||
#include <Rect.h>
|
||||
#include <Region.h>
|
||||
#include <Screen.h>
|
||||
#include <ScrollBar.h>
|
||||
#include <ScrollView.h>
|
||||
#include <Shape.h>
|
||||
#include <Shelf.h>
|
||||
#include <Slider.h>
|
||||
#include <StatusBar.h>
|
||||
#include <StringView.h>
|
||||
#include <TabView.h>
|
||||
#include <TextControl.h>
|
||||
#include <TextView.h>
|
||||
#include <View.h>
|
||||
#include <Window.h>
|
||||
@@ -1,12 +0,0 @@
|
||||
/*
|
||||
* Master include file for the Kernel Kit.
|
||||
*
|
||||
*/
|
||||
#include <OS.h>
|
||||
#include <debugger.h>
|
||||
#include <fs_attr.h>
|
||||
#include <fs_index.h>
|
||||
#include <fs_info.h>
|
||||
#include <fs_query.h>
|
||||
#include <image.h>
|
||||
#include <scheduler.h>
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* Master include file for the Storage Kit.
|
||||
*
|
||||
*/
|
||||
#include <AppFileInfo.h>
|
||||
#include <Directory.h>
|
||||
#include <Entry.h>
|
||||
#include <EntryList.h>
|
||||
#include <File.h>
|
||||
#include <FilePanel.h>
|
||||
#include <FindDirectory.h>
|
||||
#include <Mime.h>
|
||||
#include <Node.h>
|
||||
#include <NodeInfo.h>
|
||||
#include <NodeMonitor.h>
|
||||
#include <Path.h>
|
||||
#include <Query.h>
|
||||
#include <Resources.h>
|
||||
#include <ResourceStrings.h>
|
||||
#include <Statable.h>
|
||||
#include <StorageDefs.h>
|
||||
#include <SymLink.h>
|
||||
#include <Volume.h>
|
||||
#include <VolumeRoster.h>
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Master include file for the Support Kit.
|
||||
*
|
||||
*/
|
||||
#include <Archivable.h>
|
||||
#include <Autolock.h>
|
||||
#include <Beep.h>
|
||||
#include <BlockCache.h>
|
||||
#include <BufferIO.h>
|
||||
#include <ByteOrder.h>
|
||||
#include <ClassInfo.h>
|
||||
#include <DataIO.h>
|
||||
#include <Debug.h>
|
||||
#include <Errors.h>
|
||||
#include <Flattenable.h>
|
||||
#include <List.h>
|
||||
#include <Locker.h>
|
||||
#include <StopWatch.h>
|
||||
#include <String.h>
|
||||
#include <SupportDefs.h>
|
||||
#include <TypeConstants.h>
|
||||
#include <UTF8.h>
|
||||
#include <syslog.h>
|
||||
@@ -1,98 +0,0 @@
|
||||
#ifndef ZOIDBERG_MAIL_CHAIN_RUNNER_H
|
||||
#define ZOIDBERG_MAIL_CHAIN_RUNNER_H
|
||||
/* ChainRunner - runs the mail inbound and outbound chains
|
||||
**
|
||||
** Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
#include <MailAddon.h>
|
||||
#include <MailSettings.h>
|
||||
#include <Looper.h>
|
||||
|
||||
class BStringList;
|
||||
class BMailStatusWindow;
|
||||
class BMailStatusView;
|
||||
class BMailChain;
|
||||
|
||||
class BMailChainCallback {
|
||||
public:
|
||||
virtual void Callback(status_t result) = 0;
|
||||
// Called by the callback routines in ChainRunner
|
||||
// result is the message that ended the chain
|
||||
// (MD_HANDLED, MD_DISCARD, MD_NO_MORE_MESSAGES)
|
||||
// Obviously, for process callbacks, result is
|
||||
// gauranteed to be MD_NO_MORE_MESSAGES.
|
||||
};
|
||||
|
||||
class BMailChainRunner : public BLooper {
|
||||
public:
|
||||
BMailChainRunner(BMailChain *chain, BMailStatusWindow *status,
|
||||
bool self_destruct_when_done = true, bool save_chain_when_done = false,
|
||||
bool destruct_chain_when_done = false);
|
||||
~BMailChainRunner();
|
||||
|
||||
//----Callback functions. Callback objects will be deleted for you.
|
||||
|
||||
void RegisterMessageCallback(BMailChainCallback *callback);
|
||||
// Your callback->Callback() function will be called when
|
||||
// the current message is done being processed.
|
||||
|
||||
void RegisterProcessCallback(BMailChainCallback *callback);
|
||||
// Your callback->Callback() function will be called when
|
||||
// a filter returns MD_PASS_COMPLETE and before we go back
|
||||
// to waiting for new messages, or when the fetch list
|
||||
// runs out.
|
||||
|
||||
void RegisterChainCallback(BMailChainCallback *callback);
|
||||
// Your callback->Callback() function will be called when
|
||||
// a filter returns MD_ALL_PASSES_DONE and before everything
|
||||
// is unloaded and sent home.
|
||||
|
||||
void Stop(bool immediately = false);
|
||||
void ReportProgress(int bytes, int messages, const char *message = NULL);
|
||||
void ResetProgress(const char *message = NULL);
|
||||
|
||||
void GetMessages(BStringList *list, int32 bytes);
|
||||
void GetSingleMessage(const char *uid, int32 length, BPath *into);
|
||||
// The bytes or length field is the total size, used for updating the
|
||||
// progress bar. Use -1 for unknown maximum size.
|
||||
|
||||
bool QuitRequested();
|
||||
|
||||
void ShowError(const char *error);
|
||||
void ShowMessage(const char *message);
|
||||
|
||||
BMailChain *Chain();
|
||||
|
||||
//----The big, bad asynchronous RunChain() function. Pretty harmless looking, huh?
|
||||
status_t RunChain(bool asynchronous = true);
|
||||
|
||||
void MessageReceived (BMessage *msg);
|
||||
|
||||
private:
|
||||
void CallCallbacksFor(BList &list, status_t code);
|
||||
void get_messages(BStringList *list);
|
||||
status_t Init();
|
||||
#if USE_NASTY_SYNC_THREAD_HACK
|
||||
static int32 thread_sync_func(void *arg);
|
||||
status_t init_addons();
|
||||
#endif
|
||||
|
||||
BMailChain *_chain;
|
||||
BList message_cb, process_cb, chain_cb;
|
||||
|
||||
bool destroy_self, destroy_chain, save_chain;
|
||||
|
||||
BMailStatusWindow *_status;
|
||||
BMailStatusView *_statview;
|
||||
BList addons;
|
||||
|
||||
bool suicide;
|
||||
uint8 _other_reserved[3];
|
||||
uint32 _reserved[4];
|
||||
};
|
||||
|
||||
BMailChainRunner *GetMailChainRunner(int32 chain_id, BMailStatusWindow *status, bool selfDestruct = true);
|
||||
|
||||
#endif /* ZOIDBERG_MAIL_CHAIN_RUNNER_H */
|
||||
@@ -1,151 +0,0 @@
|
||||
#ifndef ZOIDBERG_MAIL_ADDON_H
|
||||
#define ZOIDBERG_MAIL_ADDON_H
|
||||
/* Filter - the base class for all mail filters
|
||||
**
|
||||
** Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
class BMessage;
|
||||
class BView;
|
||||
class BPositionIO;
|
||||
class BEntry;
|
||||
class BPath;
|
||||
class BView;
|
||||
class BString;
|
||||
class BPositionIO;
|
||||
class BEntry;
|
||||
|
||||
enum {
|
||||
B_MAIL_DISCARD = B_MAIL_ERROR_BASE + 8,
|
||||
//--- This terminates the chain and removes the message being processed
|
||||
// both from disk and from the server.
|
||||
B_MAIL_END_FETCH,
|
||||
//--- Terminates the current operation
|
||||
B_MAIL_END_CHAIN
|
||||
//--- This is for yikes errors, like an unreachable server.
|
||||
};
|
||||
|
||||
class BMailStatusView;
|
||||
class BMailChainRunner;
|
||||
|
||||
class BMailFilter
|
||||
{
|
||||
public:
|
||||
BMailFilter(BMessage* settings);
|
||||
// How to support queueing messages until a time of the
|
||||
// day/week/month/year? The settings will contain a
|
||||
// persistent ChainID field, the same for all Filters
|
||||
// on the same "chain".
|
||||
|
||||
virtual ~BMailFilter();
|
||||
// This will be called when the settings for this Filter
|
||||
// are changed, or there are no new messages to consume
|
||||
// after settings->FindInt32("timeout") seconds.
|
||||
|
||||
virtual status_t InitCheck(BString* out_message = NULL) = 0;
|
||||
// Returns B_OK if the Filter was constructed success-
|
||||
// fully. Otherwise it returns an error code. If it is
|
||||
// passed a valid BString*, it may add an error message
|
||||
// to the end of that BString iff it returns an error.
|
||||
// If it returns an error code then the MailFilter will
|
||||
// probably be deleted and the error shown to the user.
|
||||
|
||||
virtual status_t ProcessMailMessage
|
||||
(
|
||||
BPositionIO** io_message, BEntry* io_entry,
|
||||
BMessage* io_headers, BPath* io_folder, const char *io_uid
|
||||
) = 0;
|
||||
// Filters a message. On input and output, the arguments
|
||||
// are expected to be as below; however it is allowed for
|
||||
// the MailFilter to alter any of these values as nece-
|
||||
// ssary, so long as the constraints are as described when
|
||||
// the function returns:
|
||||
//
|
||||
// * io_message - a PositionIO that contains the message
|
||||
// data, pointing to the first byte of the message's
|
||||
// header. This can be swapped if, eg, the message
|
||||
// is copied across volume boundries. When the chain
|
||||
// begins this is a file in /tmp.
|
||||
// * io_entry - The entry for the PositionIO above.
|
||||
// * io_headers - a list of attributes that will be added
|
||||
// to the message file.
|
||||
// * io_folder - The message's "folder"---may be com-
|
||||
// pletely unrelated to its on-disk Entry.
|
||||
// * io_uid - The unique ID provided by the message's
|
||||
// Protocol
|
||||
//
|
||||
// At most one Filter::ProcessMailMessage() for a given
|
||||
// chain (and thus ChainID) will be called at a time.
|
||||
|
||||
private:
|
||||
virtual void _ReservedFilter1();
|
||||
virtual void _ReservedFilter2();
|
||||
virtual void _ReservedFilter3();
|
||||
virtual void _ReservedFilter4();
|
||||
};
|
||||
|
||||
//
|
||||
// The addon interface: export instantiate_mailfilter()
|
||||
// and instantiate_mailconfig() to create a Filter addon
|
||||
//
|
||||
|
||||
extern "C" _EXPORT BView* instantiate_config_panel(BMessage *settings,BMessage *metadata);
|
||||
// return a view that configures the MailProtocol or MailFilter
|
||||
// returned by the functions below. BView::Archive(foo,true)
|
||||
// produces this addon's settings, which are passed to the in-
|
||||
// stantiate_* functions and stored persistently. This function
|
||||
// should gracefully handle empty and NULL settings.
|
||||
// A note on the metadata argument: The metadata pointer is
|
||||
// guaranteed to remain valid as long as this view exists. As it is
|
||||
// a pointer to the chain's metadata, your view can save any
|
||||
// chain-global settings to it in its Archive() function. Note that
|
||||
// you must cache this pointer yourself! You will never get it again.
|
||||
// Also note that it is possible for it to be NULL.
|
||||
|
||||
extern "C" _EXPORT BMailFilter* instantiate_mailfilter(BMessage *settings,
|
||||
BMailChainRunner *runner);
|
||||
// Return a MailProtocol or MailFilter ready to do its thing,
|
||||
// based on settings produced by archiving your config panel.
|
||||
// Note that a Mail::Protocol is a Mail::Filter, so use
|
||||
// instantiate_mailfilter to start things up.
|
||||
|
||||
extern "C" _EXPORT status_t descriptive_name(BMessage *msg, char *buffer);
|
||||
// the config panel will show this name in the chains filter
|
||||
// list if this function returns B_OK.
|
||||
// The buffer is as big as B_FILE_NAME_LENGTH.
|
||||
|
||||
// standard Filters:
|
||||
//
|
||||
// * Parser - does ParseRFC2822(io_message,io_headers)
|
||||
// * Folder - stores the message in the specified folder,
|
||||
// optionally under io_folder, returns MD_HANDLED
|
||||
// * HeaderFilter(regex,Yes_fiters,No_filters) -
|
||||
// Applies Nes_filters to messages that have a header
|
||||
// matching regex; applies No_filters otherwise.
|
||||
// * CompatabilityFilter - Invokes the standard mail_dae-
|
||||
// mon filter ~/config/settings/add-ons/MailDaemon/Filter
|
||||
// on the message's Entry.
|
||||
// * Producer - Reads outbound messages from disk and inserts
|
||||
// them into the queue.
|
||||
// * SMTPSender - Sends the message, via the specified
|
||||
// SMTP server, to the people in header field
|
||||
// "MAIL:recipients", changes the the Entry's
|
||||
// "MAIL:flags" field to no longer pending, changes the
|
||||
// "MAIL:status" header field to "Sent", and adds a header
|
||||
// field "MAIL:when" with the time it was sent.
|
||||
// * Dumper - returns MD_DISCARD
|
||||
//
|
||||
//
|
||||
// Standard chain types:
|
||||
//
|
||||
// Incoming Mail: Protocol - Parser - Notifier - Folder
|
||||
// Outgoing Mail: Producer - SMTPSender
|
||||
//
|
||||
// "chains" are lists of addons that appear in, or can be
|
||||
// added to, the "Accounts" list in the config panel, a tree-
|
||||
// view ordered by the chain type and the chain's AccountName().
|
||||
// Their config views should be shown, one after the other,
|
||||
// in the config panel.
|
||||
|
||||
#endif /* ZOIDBERG_MAIL_ADDON_H */
|
||||
@@ -1,107 +0,0 @@
|
||||
#ifndef ZOIDBERG_MAIL_PROTOCOL_H
|
||||
#define ZOIDBERG_MAIL_PROTOCOL_H
|
||||
/* Protocol - the base class for protocol filters
|
||||
**
|
||||
** Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
#include <OS.h>
|
||||
|
||||
#include <MailAddon.h>
|
||||
|
||||
|
||||
class BHandler;
|
||||
class BStringList;
|
||||
class BMailChainRunner;
|
||||
|
||||
class BMailProtocol : public BMailFilter
|
||||
{
|
||||
public:
|
||||
BMailProtocol(BMessage* settings, BMailChainRunner *runner);
|
||||
// Open a connection based on 'settings'. 'settings' will
|
||||
// contain a persistent uint32 ChainID field. At most one
|
||||
// Protocol per ChainID will exist at a given time.
|
||||
// The constructor of Mail::Protocol initializes manifest.
|
||||
// It is your responsibility to fill in unique_ids, *and
|
||||
// to keep it updated* in the course of whatever nefarious
|
||||
// things your protocol does.
|
||||
|
||||
virtual ~BMailProtocol();
|
||||
// Close the connection and clean up. This will be cal-
|
||||
// led after FetchMessage() or FetchNewMessage() returns
|
||||
// B_TIMED_OUT or B_ERROR, or when the settings for this
|
||||
// Protocol are changed.
|
||||
|
||||
virtual status_t GetMessage(
|
||||
const char* uid,
|
||||
BPositionIO** out_file, BMessage* out_headers,
|
||||
BPath* out_folder_location
|
||||
)=0;
|
||||
// Downloads the message with id uid, writing the message's
|
||||
// RFC2822 contents to *out_file and storing any headers it
|
||||
// wants to add other than those from the message itself into
|
||||
// out_headers. It may store a path (if this type of account
|
||||
// supports folders) in *out_folder_location.
|
||||
//
|
||||
// Returns B_OK if the message is now available in out_file,
|
||||
// B_NAME_NOT_FOUND if there is no message with id 'uid' on
|
||||
// the server, or another error if the connection failed.
|
||||
//
|
||||
// B_OK will cause the message to be stored and processed.
|
||||
// B_NAME_NOT_FOUND will cause appropriate recovery to be
|
||||
// taken (if such exists) but not cause the connection to
|
||||
// be terminated. Any other error will cause anything writen
|
||||
// to be discarded and and the connection closed.
|
||||
|
||||
// OBS:
|
||||
// The Protocol may replace *out_file with a custom (read-
|
||||
// only) BPositionIO-derived object that preserves the il-
|
||||
// lusion that the message is writen to *out_file, but in
|
||||
// fact only reads from the server and writes to *out_file
|
||||
// on demand. This BPositionIO must guarantee that any
|
||||
// data returned by Read() has also been writen to *out_-
|
||||
// file. It must return a read error if reading from the
|
||||
// network or writing to *out_file fails.
|
||||
//
|
||||
// The mail_daemon will delete *out_file before invoking
|
||||
// FetchMessage() or FetchNewMessage() again.
|
||||
|
||||
virtual status_t DeleteMessage(const char* uid)=0;
|
||||
// Removes the message from the server. After this, it's
|
||||
// assumed (but not required) that GetMessage(uid,...)
|
||||
// et al will fail with B_NAME_NOT_FOUND.
|
||||
|
||||
void CheckForDeletedMessages();
|
||||
// You can call this to trigger a sweep for deleted messages.
|
||||
// Automatically called at the beginning of the chain.
|
||||
|
||||
//------MailFilter calls
|
||||
virtual status_t ProcessMailMessage
|
||||
(
|
||||
BPositionIO** io_message, BEntry* io_entry,
|
||||
BMessage* io_headers, BPath* io_folder, const char* io_uid
|
||||
);
|
||||
|
||||
protected:
|
||||
BStringList *manifest, *unique_ids;
|
||||
BMessage *settings;
|
||||
|
||||
BMailChainRunner *runner;
|
||||
private:
|
||||
inline void error_alert(const char *process, status_t error);
|
||||
virtual void _ReservedProtocol1();
|
||||
virtual void _ReservedProtocol2();
|
||||
virtual void _ReservedProtocol3();
|
||||
virtual void _ReservedProtocol4();
|
||||
virtual void _ReservedProtocol5();
|
||||
|
||||
friend class DeletePass;
|
||||
|
||||
BHandler *trash_monitor;
|
||||
BStringList *uids_on_disk;
|
||||
|
||||
uint32 _reserved[3];
|
||||
};
|
||||
|
||||
#endif // ZOIDBERG_MAIL_PROTOCOL_H
|
||||
@@ -1,38 +0,0 @@
|
||||
#ifndef ZOIDBERG_PROTOCOL_CONFIG_VIEW_H
|
||||
#define ZOIDBERG_PROTOCOL_CONFIG_VIEW_H
|
||||
/* ProtocolConfigView - the standard config view for all protocols
|
||||
**
|
||||
** Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <View.h>
|
||||
|
||||
typedef enum {
|
||||
B_MAIL_PROTOCOL_HAS_AUTH_METHODS = 1,
|
||||
B_MAIL_PROTOCOL_HAS_FLAVORS = 2,
|
||||
B_MAIL_PROTOCOL_HAS_USERNAME = 4,
|
||||
B_MAIL_PROTOCOL_HAS_PASSWORD = 8,
|
||||
B_MAIL_PROTOCOL_HAS_HOSTNAME = 16,
|
||||
B_MAIL_PROTOCOL_CAN_LEAVE_MAIL_ON_SERVER = 32
|
||||
} b_mail_protocol_config_options;
|
||||
|
||||
class BMailProtocolConfigView : public BView {
|
||||
public:
|
||||
BMailProtocolConfigView(uint32 options_mask = B_MAIL_PROTOCOL_HAS_FLAVORS | B_MAIL_PROTOCOL_HAS_USERNAME | B_MAIL_PROTOCOL_HAS_PASSWORD | B_MAIL_PROTOCOL_HAS_HOSTNAME);
|
||||
virtual ~BMailProtocolConfigView();
|
||||
|
||||
void SetTo(BMessage *archive);
|
||||
|
||||
void AddFlavor(const char *label);
|
||||
void AddAuthMethod(const char *label,bool needUserPassword = true);
|
||||
|
||||
virtual status_t Archive(BMessage *into, bool deep = true) const;
|
||||
virtual void GetPreferredSize(float *width, float *height);
|
||||
virtual void AttachedToWindow();
|
||||
virtual void MessageReceived(BMessage *msg);
|
||||
|
||||
private:
|
||||
uint32 _reserved[5];
|
||||
};
|
||||
|
||||
#endif /* ZOIDBERG_PROTOCOL_CONFIG_VIEW_H */
|
||||
@@ -1,41 +0,0 @@
|
||||
#ifndef ZOIDBERG_MAIL_REMOTESTORAGEPROTOCOL_H
|
||||
#define ZOIDBERG_MAIL_REMOTESTORAGEPROTOCOL_H
|
||||
/* RemoteStorageProtocol - the base class for protocol filters
|
||||
**
|
||||
** Copyright 2003 Dr. Zoidberg Enterprises. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <MailProtocol.h>
|
||||
#include <StringList.h>
|
||||
|
||||
class BRemoteMailStorageProtocol : public BMailProtocol {
|
||||
public:
|
||||
BRemoteMailStorageProtocol(BMessage *settings, BMailChainRunner *runner);
|
||||
virtual ~BRemoteMailStorageProtocol();
|
||||
|
||||
virtual status_t GetMessage(const char *mailbox, const char *message, BPositionIO **, BMessage *headers) = 0;
|
||||
virtual status_t AddMessage(const char *mailbox, BPositionIO *data, BString *id) = 0;
|
||||
|
||||
virtual status_t DeleteMessage(const char *mailbox, const char *message) = 0;
|
||||
virtual status_t CopyMessage(const char *mailbox, const char *to_mailbox, BString *message) = 0;
|
||||
|
||||
virtual status_t CreateMailbox(const char *mailbox) = 0;
|
||||
virtual status_t DeleteMailbox(const char *mailbox) = 0;
|
||||
|
||||
void SyncMailbox(const char *mailbox);
|
||||
|
||||
//----Mail::Protocol stuff
|
||||
virtual status_t GetMessage(
|
||||
const char* uid,
|
||||
BPositionIO** out_file, BMessage* out_headers,
|
||||
BPath* out_folder_location);
|
||||
virtual status_t DeleteMessage(const char* uid);
|
||||
|
||||
//---Data members
|
||||
BStringList mailboxes;
|
||||
|
||||
private:
|
||||
BHandler *handler;
|
||||
};
|
||||
|
||||
#endif // ZOIDBERG_MAIL_REMOTESTORAGEPROTOCOL_H
|
||||
@@ -1,73 +0,0 @@
|
||||
#ifndef ZOIDBERG_STRING_LIST_H
|
||||
#define ZOIDBERG_STRING_LIST_H
|
||||
/* StringList - a string list implementation
|
||||
**
|
||||
** Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
#include <Flattenable.h>
|
||||
|
||||
class BList;
|
||||
|
||||
class BStringList : public BFlattenable {
|
||||
public:
|
||||
BStringList();
|
||||
BStringList(const BStringList&);
|
||||
|
||||
~BStringList(void);
|
||||
|
||||
BStringList &operator=(const BStringList &from);
|
||||
|
||||
/* Flattenable stuff */
|
||||
virtual bool IsFixedSize() const; //--false for obvious reasons
|
||||
virtual type_code TypeCode() const;
|
||||
virtual ssize_t FlattenedSize() const;
|
||||
virtual status_t Flatten(void *buffer, ssize_t size) const;
|
||||
virtual bool AllowsTypeCode(type_code code) const;
|
||||
virtual status_t Unflatten(type_code c, const void *buf, ssize_t size);
|
||||
|
||||
/* Adding and removing items. */
|
||||
void AddItem(const char *item);
|
||||
void AddList(const BStringList *newItems);
|
||||
bool RemoveItem(const char *item);
|
||||
void MakeEmpty();
|
||||
|
||||
/* Retrieving items. */
|
||||
const char *ItemAt(int32) const;
|
||||
int32 IndexOf(const char *) const;
|
||||
|
||||
/* Querying the list. */
|
||||
bool HasItem(const char *item) const;
|
||||
int32 CountItems() const;
|
||||
bool IsEmpty() const;
|
||||
|
||||
/* Determining differences between lists */
|
||||
void NotHere(BStringList &other_list, BStringList *results);
|
||||
void NotThere(BStringList &other_list, BStringList *results);
|
||||
|
||||
/* Useful list logic operators */
|
||||
BStringList &operator += (const char *item);
|
||||
BStringList &operator += (BStringList &list);
|
||||
|
||||
BStringList &operator -= (const char *item);
|
||||
BStringList &operator -= (BStringList &list);
|
||||
|
||||
BStringList operator | (BStringList &list);
|
||||
BStringList &operator |= (BStringList &list);
|
||||
|
||||
BStringList operator ^ (BStringList &list);
|
||||
BStringList &operator ^= (BStringList &list);
|
||||
|
||||
bool operator == (BStringList &list);
|
||||
const char *operator [] (int32 index);
|
||||
|
||||
private:
|
||||
void *_buckets[256];
|
||||
int32 _items;
|
||||
BList *_indexed;
|
||||
|
||||
uint32 _reserved[5];
|
||||
};
|
||||
|
||||
#endif /* ZOIDBERG_STRING_LIST_H */
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef _DESKBAR_H
|
||||
// I don't know why this file exists in addition to the one we include
|
||||
// below, but who cares... (originally, in R5, both files exist and are
|
||||
// identical).
|
||||
# include <interface/Deskbar.h>
|
||||
#endif
|
||||
@@ -1,51 +0,0 @@
|
||||
/*******************************************************************************
|
||||
/
|
||||
/ File: NetPositive.h
|
||||
/
|
||||
/ Description: Defines all public APIs for communicating with NetPositive
|
||||
/
|
||||
/ Copyright 1998-1999, Be Incorporated, All Rights Reserved
|
||||
/
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef _NETPOSITIVE_H
|
||||
#define _NETPOSITIVE_H
|
||||
|
||||
/*----------------------------------------------------------------*/
|
||||
/*----- message command constants -------------------------------*/
|
||||
|
||||
enum {
|
||||
/* Can be sent to the NetPositive application, a window, or a replicant */
|
||||
/* view. Put the URL in a String field named be:url */
|
||||
B_NETPOSITIVE_OPEN_URL = 'NPOP',
|
||||
|
||||
/* Can be sent to a window or replicant view */
|
||||
B_NETPOSITIVE_BACK = 'NPBK',
|
||||
B_NETPOSITIVE_FORWARD = 'NPFW',
|
||||
B_NETPOSITIVE_HOME = 'NPHM',
|
||||
B_NETPOSITIVE_RELOAD = 'NPRL',
|
||||
B_NETPOSITIVE_STOP = 'NPST',
|
||||
B_NETPOSITIVE_DOWN = 'NPDN',
|
||||
B_NETPOSITIVE_UP = 'NPUP'
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------*/
|
||||
/*----- NetPositive-related MIME types --------------------------*/
|
||||
|
||||
/* The MIME types for the NetPositive application and its bookmark files */
|
||||
#define B_NETPOSITIVE_APP_SIGNATURE "application/x-vnd.Be-NPOS"
|
||||
#define B_NETPOSITIVE_BOOKMARK_SIGNATURE "application/x-vnd.Be-bookmark"
|
||||
|
||||
/* To set up your application to receive notification when the user */
|
||||
/* clicks on a specific type of URL (telnet URL's, for example), see the */
|
||||
/* details in TypeConstants.h. NetPositive will use external handlers */
|
||||
/* for all URL types except for http, https, file, netpositive, and */
|
||||
/* javascript, which it always handles internally. To maintain */
|
||||
/* compatibility with its previous behavior, if NetPositive does not */
|
||||
/* find a handler for mailto URL's, it will instead launch the handler */
|
||||
/* for "text/x-email". */
|
||||
|
||||
/*----------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------*/
|
||||
|
||||
#endif /* _NETPOSITIVE_H */
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
Open Tracker License
|
||||
|
||||
Terms and Conditions
|
||||
|
||||
Copyright (c) 1991-2000, Be Incorporated. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice applies to all licensees
|
||||
and shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of Be Incorporated shall not be
|
||||
used in advertising or otherwise to promote the sale, use or other dealings in
|
||||
this Software without prior written authorization from Be Incorporated.
|
||||
|
||||
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
|
||||
of Be Incorporated in the United States and other countries. Other brand product
|
||||
names are registered trademarks or trademarks of their respective holders.
|
||||
All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _TRACKER_BACKGROUND_H
|
||||
#define _TRACKER_BACKGROUND_H
|
||||
|
||||
/*----------------------------------------------------------------*/
|
||||
/*----- Tracker background attribute name ----------------------*/
|
||||
|
||||
#define B_BACKGROUND_INFO "be:bgndimginfo"
|
||||
|
||||
/*----------------------------------------------------------------*/
|
||||
/*----- Tracker background BMessage entries --------------------*/
|
||||
|
||||
#define B_BACKGROUND_IMAGE "be:bgndimginfopath" // string path
|
||||
#define B_BACKGROUND_MODE "be:bgndimginfomode" // int32, the enum below
|
||||
#define B_BACKGROUND_ORIGIN "be:bgndimginfooffset" // BPoint
|
||||
#define B_BACKGROUND_ERASE_TEXT "be:bgndimginfoerasetext" // bool
|
||||
#define B_BACKGROUND_WORKSPACES "be:bgndimginfoworkspaces" // uint32
|
||||
|
||||
/*----------------------------------------------------------------*/
|
||||
/*----- Background mode values ---------------------------------*/
|
||||
|
||||
enum {
|
||||
B_BACKGROUND_MODE_USE_ORIGIN,
|
||||
B_BACKGROUND_MODE_CENTERED, // only works on Desktop
|
||||
B_BACKGROUND_MODE_SCALED, // only works on Desktop
|
||||
B_BACKGROUND_MODE_TILED
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------*/
|
||||
|
||||
const int32 B_RESTORE_BACKGROUND_IMAGE = 'Tbgr'; // force a Tracker window to
|
||||
// use a new background image
|
||||
|
||||
#endif /* _TRACKER_BACKGROUND_H */
|
||||
@@ -1,207 +0,0 @@
|
||||
/*
|
||||
Open Tracker License
|
||||
|
||||
Terms and Conditions
|
||||
|
||||
Copyright (c) 1991-2000, Be Incorporated. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice applies to all licensees
|
||||
and shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of Be Incorporated shall not be
|
||||
used in advertising or otherwise to promote the sale, use or other dealings in
|
||||
this Software without prior written authorization from Be Incorporated.
|
||||
|
||||
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
|
||||
of Be Incorporated in the United States and other countries. Other brand product
|
||||
names are registered trademarks or trademarks of their respective holders.
|
||||
All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef __RECENT_ITEMS_LIST__
|
||||
#define __RECENT_ITEMS_LIST__
|
||||
|
||||
#include <Entry.h>
|
||||
#include <Message.h>
|
||||
#include <String.h>
|
||||
|
||||
/* BRecentItemsList classes allow creating an entire menu with
|
||||
* recent files, folders, apps. If the user wishes to add items to
|
||||
* their own menu, they can instead use the GetNextMenuItem call to
|
||||
* get one menu at a time to add it to their app.
|
||||
*/
|
||||
|
||||
class BMenuItem;
|
||||
class BMenu;
|
||||
|
||||
class BRecentItemsList {
|
||||
public:
|
||||
BRecentItemsList(int32 maxItems, bool navMenuFolders);
|
||||
/* if <navMenuFolders> passed, folder items get NavMenu-style
|
||||
* subdirectories attached to them
|
||||
*/
|
||||
|
||||
virtual ~BRecentItemsList() {}
|
||||
|
||||
virtual void Rewind();
|
||||
/* resets the iteration */
|
||||
|
||||
virtual BMenuItem *GetNextMenuItem(const BMessage *fileOpenMessage = NULL,
|
||||
const BMessage *containerOpenMessage = NULL,
|
||||
BHandler *target = NULL, entry_ref *currentItemRef = NULL);
|
||||
/* if <fileOpenMessage> specified, the item for a file gets a copy with
|
||||
* the item ref attached as "refs", otherwise a default B_REFS_RECEIVED
|
||||
* message message gets attached
|
||||
* if <containerOpenMessage> specified, the item for a folder, volume or query
|
||||
* gets a copy with the item ref attached as "refs", otherwise a default
|
||||
* B_REFS_RECEIVED message message gets attached
|
||||
* if <currentItemRef> gets passed, the caller gets to look at the
|
||||
* entry_ref corresponding to the item
|
||||
*/
|
||||
|
||||
virtual status_t GetNextRef(entry_ref *);
|
||||
|
||||
protected:
|
||||
BMessage fItems;
|
||||
int32 fIndex;
|
||||
int32 fMaxItems;
|
||||
bool fNavMenuFolders;
|
||||
|
||||
private:
|
||||
|
||||
virtual void _r1();
|
||||
virtual void _r2();
|
||||
virtual void _r3();
|
||||
virtual void _r4();
|
||||
virtual void _r5();
|
||||
virtual void _r6();
|
||||
virtual void _r7();
|
||||
virtual void _r8();
|
||||
virtual void _r9();
|
||||
virtual void _r10();
|
||||
|
||||
uint32 _reserved[20];
|
||||
};
|
||||
|
||||
class BRecentFilesList : public BRecentItemsList {
|
||||
public:
|
||||
|
||||
/* use one of the two constructors to set up next item iteration */
|
||||
BRecentFilesList(int32 maxItems = 10, bool navMenuFolders = false,
|
||||
const char *ofType = NULL, const char *openedByAppSig = NULL);
|
||||
BRecentFilesList(int32 maxItems, bool navMenuFolders, const char *ofTypeList[],
|
||||
int32 ofTypeListCount, const char *openedByAppSig = NULL);
|
||||
virtual ~BRecentFilesList();
|
||||
|
||||
/* use one of the two NewFileListMenu calls to get an entire menu */
|
||||
static BMenu *NewFileListMenu(const char *title,
|
||||
BMessage *openFileMessage = NULL, BMessage *openFolderMessage = NULL,
|
||||
BHandler *target = NULL,
|
||||
int32 maxItems = 10, bool navMenuFolders = false,
|
||||
const char *ofType = NULL, const char *openedByAppSig = NULL);
|
||||
|
||||
static BMenu *NewFileListMenu(const char *title,
|
||||
BMessage *openFileMessage, BMessage *openFolderMessage,
|
||||
BHandler *target,
|
||||
int32 maxItems, bool navMenuFolders,
|
||||
const char *ofTypeList[], int32 ofTypeListCount,
|
||||
const char *openedByAppSig);
|
||||
|
||||
virtual status_t GetNextRef(entry_ref *);
|
||||
|
||||
protected:
|
||||
|
||||
BString fType;
|
||||
char **fTypes;
|
||||
int32 fTypeCount;
|
||||
BString fAppSig;
|
||||
|
||||
private:
|
||||
virtual void _r11();
|
||||
virtual void _r12();
|
||||
virtual void _r13();
|
||||
virtual void _r14();
|
||||
virtual void _r15();
|
||||
virtual void _r16();
|
||||
virtual void _r17();
|
||||
virtual void _r18();
|
||||
virtual void _r19();
|
||||
virtual void _r110();
|
||||
|
||||
uint32 _reserved[20];
|
||||
};
|
||||
|
||||
class BRecentFoldersList : public BRecentItemsList {
|
||||
public:
|
||||
/* use the constructor to set up next item iteration */
|
||||
BRecentFoldersList(int32 maxItems, bool navMenuFolders = false,
|
||||
const char *openedByAppSig = NULL);
|
||||
|
||||
/* use NewFolderListMenu to get an entire menu */
|
||||
static BMenu *NewFolderListMenu(const char *title,
|
||||
BMessage *openMessage = NULL, BHandler *target = NULL,
|
||||
int32 maxItems = 10, bool navMenuFolders = false,
|
||||
const char *openedByAppSig = NULL);
|
||||
|
||||
virtual status_t GetNextRef(entry_ref *);
|
||||
|
||||
protected:
|
||||
BString fAppSig;
|
||||
|
||||
private:
|
||||
virtual void _r21();
|
||||
virtual void _r22();
|
||||
virtual void _r23();
|
||||
virtual void _r24();
|
||||
virtual void _r25();
|
||||
virtual void _r26();
|
||||
virtual void _r27();
|
||||
virtual void _r28();
|
||||
virtual void _r29();
|
||||
virtual void _r210();
|
||||
|
||||
uint32 _reserved[20];
|
||||
};
|
||||
|
||||
class BRecentAppsList : public BRecentItemsList {
|
||||
public:
|
||||
/* use the constructor to set up next item iteration */
|
||||
BRecentAppsList(int32 maxItems);
|
||||
|
||||
/* use NewFolderListMenu to get an entire menu */
|
||||
static BMenu *NewAppListMenu(const char *title,
|
||||
BMessage *openMessage = NULL, BHandler *target = NULL,
|
||||
int32 maxItems = 10);
|
||||
|
||||
virtual status_t GetNextRef(entry_ref *);
|
||||
|
||||
private:
|
||||
virtual void _r31();
|
||||
virtual void _r32();
|
||||
virtual void _r33();
|
||||
virtual void _r34();
|
||||
virtual void _r35();
|
||||
virtual void _r36();
|
||||
virtual void _r37();
|
||||
virtual void _r38();
|
||||
virtual void _r39();
|
||||
virtual void _r310();
|
||||
|
||||
uint32 _reserved[20];
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,43 +0,0 @@
|
||||
/********************************************************************************
|
||||
/
|
||||
/ File: A2D.h
|
||||
/
|
||||
/ Description: Analog-to-Digital converter class header.
|
||||
/
|
||||
/ Copyright 1996-98, Be Incorporated, All Rights Reserved.
|
||||
/
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
#ifndef _A2D_H
|
||||
#define _A2D_H
|
||||
|
||||
#include <BeBuild.h>
|
||||
#include <stddef.h>
|
||||
#include <SupportDefs.h>
|
||||
|
||||
/* -----------------------------------------------------------------------*/
|
||||
class BA2D {
|
||||
|
||||
public:
|
||||
BA2D();
|
||||
virtual ~BA2D();
|
||||
|
||||
status_t Open(const char *portName);
|
||||
void Close(void);
|
||||
bool IsOpen(void);
|
||||
|
||||
ssize_t Read(ushort *buf);
|
||||
|
||||
/* -----------------------------------------------------------------------*/
|
||||
|
||||
private:
|
||||
virtual void _ReservedA2D1();
|
||||
virtual void _ReservedA2D2();
|
||||
virtual void _ReservedA2D3();
|
||||
|
||||
int ffd;
|
||||
uint32 _fReserved[3];
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,711 +0,0 @@
|
||||
/* ++++++++++
|
||||
CAM.h
|
||||
Copyright (c) 1996-98 by Be Incorporated. All Rights Reserved.
|
||||
|
||||
Definitions for the SCSI Common Access Method as implemented in the Be OS.
|
||||
|
||||
See also "Draft Proposed American National Standard, SCSI-2 Common
|
||||
Access Method Transport and SCSI Interface Module", Revision 12,
|
||||
ANSI refernce number X3.232-199x.
|
||||
|
||||
This file consists of the definitions for the fictional "UNIVOS"
|
||||
operating system described in the standard. The file is mostly
|
||||
the same text as the standard, with Be-provided additions as needed.
|
||||
+++++ */
|
||||
|
||||
|
||||
#ifndef _CAM_H
|
||||
#define _CAM_H
|
||||
|
||||
#include <bus_manager.h>
|
||||
|
||||
/* ---
|
||||
Be-provided additions to the standard include file.
|
||||
--- */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef U32
|
||||
typedef unsigned long U32;
|
||||
#endif
|
||||
|
||||
#ifndef I32
|
||||
typedef long I32;
|
||||
#endif
|
||||
|
||||
#ifndef U16
|
||||
typedef unsigned short U16;
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
uint32 serial; /* operation serial number */
|
||||
uint32 micros; /* operation time in microseconds (4294s max) */
|
||||
uint32 bytes; /* number of bytes to transfer */
|
||||
uchar path; /* target SIM ID */
|
||||
uchar target; /* target device ID */
|
||||
uchar sgcount; /* # of sg segments (0 if non-sg operation) */
|
||||
uchar scsi_op; /* scsi operation byte */
|
||||
} cam_iostat;
|
||||
|
||||
|
||||
/* -----
|
||||
The rest of this file contains the definitions and data structures for
|
||||
the CAM Subsystem interface. The contents of this file should match the
|
||||
data structures and constants that are specified in the CAM document
|
||||
----- */
|
||||
|
||||
/* Defines for the XPT function codes, Table 8-2 in the CAM spec. */
|
||||
|
||||
/* Common function commands, 0x00 - 0x0F */
|
||||
#define XPT_NOOP 0x00 /* Execute Nothing */
|
||||
#define XPT_SCSI_IO 0x01 /* Execute the requested SCSI IO */
|
||||
#define XPT_GDEV_TYPE 0x02 /* Get the device type information */
|
||||
#define XPT_PATH_INQ 0x03 /* Path Inquiry */
|
||||
#define XPT_REL_SIMQ 0x04 /* Release the SIM queue that is frozen */
|
||||
#define XPT_SASYNC_CB 0x05 /* Set Async callback parameters */
|
||||
#define XPT_SDEV_TYPE 0x06 /* Set the device type information */
|
||||
#define XPT_SCAN_BUS 0x07 /* Scan the Scsi Bus */
|
||||
|
||||
/* XPT SCSI control functions, 0x10 - 0x1F */
|
||||
#define XPT_ABORT 0x10 /* Abort the selected CCB */
|
||||
#define XPT_RESET_BUS 0x11 /* Reset the SCSI bus */
|
||||
#define XPT_RESET_DEV 0x12 /* Reset the SCSI device, BDR */
|
||||
#define XPT_TERM_IO 0x13 /* Terminate the I/O process */
|
||||
|
||||
/* HBA engine commands, 0x20 - 0x2F */
|
||||
#define XPT_ENG_INQ 0x20 /* HBA engine inquiry */
|
||||
#define XPT_ENG_EXEC 0x21 /* HBA execute engine request */
|
||||
|
||||
/* Target mode commands, 0x30 - 0x3F */
|
||||
#define XPT_EN_LUN 0x30 /* Enable LUN, Target mode support */
|
||||
#define XPT_TARGET_IO 0x31 /* Execute the target IO request */
|
||||
#define XPT_ACCEPT_TARG 0x32 /* Accept Host Target Mode CDB */
|
||||
#define XPT_CONT_TARG 0x33 /* Cont. Host Target I/O Connection */
|
||||
#define XPT_IMMED_NOTIFY 0x34 /* Notify Host Target driver of event*/
|
||||
#define XPT_NOTIFY_ACK 0x35 /* Acknowledgement of event */
|
||||
|
||||
#define XPT_FUNC 0x7F /* TEMPLATE */
|
||||
#define XPT_VUNIQUE 0x80 /* All the rest are vendor unique commands */
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
/* General allocation length defines for the CCB structures. */
|
||||
|
||||
#define IOCDBLEN 12 /* Space for the CDB bytes/pointer */
|
||||
#define VUHBA 14 /* Vendor Unique HBA length */
|
||||
#define SIM_ID 16 /* ASCII string len for SIM ID */
|
||||
#define HBA_ID 16 /* ASCII string len for HBA ID */
|
||||
|
||||
#define BE_SIM_CCB_SIZE 1536 /* we want to allocate 1.5k chunks */
|
||||
#define BE_SIM_SCSIIO_SIZE 88 /* sizeof(CAM_CCB_SCSIIO) - SIM_PRIV */
|
||||
#define SIM_PRIV (BE_SIM_CCB_SIZE - BE_SIM_SCSIIO_SIZE) /* Length of SIM private data area */
|
||||
|
||||
/* SIM_PRIV (sim private data area) Terms and Conditions:
|
||||
|
||||
- the size of SIM_PRIV shall be such that sizeof(CCB_SIZE_UNION) = 1.5k
|
||||
- all CCB's shall be allocated from locked, contiguous memory
|
||||
- CCB's shall be aligned on 512 byte boundaries
|
||||
- SIM_PRIV will be >= 1408 bytes
|
||||
- this provides 128 8byte sg entries (512mb worth of pages, worstcase fragmentation)
|
||||
- and 256 bytes for sense data and 128 bytes for whatever else the SIM needs
|
||||
|
||||
- These conditions are NULL and (void) where prohibited by law.
|
||||
- All sales are final.
|
||||
- Do not use near open flame.
|
||||
*/
|
||||
|
||||
/* Structure definitions for the CAM control blocks, CCB's for the
|
||||
subsystem. */
|
||||
|
||||
/* Common CCB header definition. */
|
||||
typedef struct ccb_header
|
||||
{
|
||||
uint32 phys_addr; /* physical address of this CCB */
|
||||
uint16 cam_ccb_len; /* Length of the entire CCB */
|
||||
uchar cam_func_code; /* XPT function code */
|
||||
uchar cam_status; /* Returned CAM subsystem status */
|
||||
uchar cam_hrsvd0; /* Reserved field, for alignment */
|
||||
uchar cam_path_id; /* Path ID for the request */
|
||||
uchar cam_target_id; /* Target device ID */
|
||||
uchar cam_target_lun; /* Target LUN number */
|
||||
uint32 cam_flags; /* Flags for operation of the subsystem */
|
||||
} CCB_HEADER;
|
||||
|
||||
/* Common SCSI functions. */
|
||||
|
||||
/* Union definition for the CDB space in the SCSI I/O request CCB */
|
||||
typedef union cdb_un
|
||||
{
|
||||
uchar *cam_cdb_ptr; /* Pointer to the CDB bytes to send */
|
||||
uchar cam_cdb_bytes[ IOCDBLEN ]; /* Area for the CDB to send */
|
||||
} CDB_UN;
|
||||
|
||||
/* Get device type CCB */
|
||||
typedef struct ccb_getdev
|
||||
{
|
||||
CCB_HEADER cam_ch; /* Header information fields */
|
||||
char *cam_inq_data; /* Ptr to the inquiry data space */
|
||||
uchar cam_pd_type; /* Periph device type from the TLUN */
|
||||
} CCB_GETDEV;
|
||||
|
||||
/* Path inquiry CCB */
|
||||
typedef struct ccb_pathinq
|
||||
{
|
||||
CCB_HEADER cam_ch; /* Header information fields */
|
||||
uchar cam_version_num; /* Version number for the SIM/HBA */
|
||||
uchar cam_hba_inquiry; /* Mimic of INQ byte 7 for the HBA */
|
||||
uchar cam_target_sprt; /* Flags for target mode support */
|
||||
uchar cam_hba_misc; /* Misc HBA feature flags */
|
||||
uint16 cam_hba_eng_cnt; /* HBA engine count */
|
||||
uchar cam_vuhba_flags[ VUHBA ]; /* Vendor unique capabilities */
|
||||
uint32 cam_sim_priv; /* Size of SIM private data area */
|
||||
uint32 cam_async_flags; /* Event cap. for Async Callback */
|
||||
uchar cam_hpath_id; /* Highest path ID in the subsystem */
|
||||
uchar cam_initiator_id; /* ID of the HBA on the SCSI bus */
|
||||
uchar cam_prsvd0; /* Reserved field, for alignment */
|
||||
uchar cam_prsvd1; /* Reserved field, for alignment */
|
||||
char cam_sim_vid[ SIM_ID ]; /* Vendor ID of the SIM */
|
||||
char cam_hba_vid[ HBA_ID ]; /* Vendor ID of the HBA */
|
||||
uchar *cam_osd_usage; /* Ptr for the OSD specific area */
|
||||
} CCB_PATHINQ;
|
||||
|
||||
/* Release SIM Queue CCB */
|
||||
typedef struct ccb_relsim
|
||||
{
|
||||
CCB_HEADER cam_ch; /* Header information fields */
|
||||
} CCB_RELSIM;
|
||||
|
||||
/* SCSI I/O Request CCB */
|
||||
typedef struct ccb_scsiio
|
||||
{
|
||||
CCB_HEADER cam_ch; /* Header information fields */
|
||||
uchar *cam_pdrv_ptr; /* Ptr used by the Peripheral driver */
|
||||
CCB_HEADER *cam_next_ccb; /* Ptr to the next CCB for action */
|
||||
uchar *cam_req_map; /* Ptr for mapping info on the Req. */
|
||||
void (*cam_cbfcnp)(struct ccb_scsiio *);
|
||||
/* Callback on completion function */
|
||||
uchar *cam_data_ptr; /* Pointer to the data buf/SG list */
|
||||
uint32 cam_dxfer_len; /* Data xfer length */
|
||||
uchar *cam_sense_ptr; /* Pointer to the sense data buffer */
|
||||
uchar cam_sense_len; /* Num of bytes in the Autosense buf */
|
||||
uchar cam_cdb_len; /* Number of bytes for the CDB */
|
||||
uint16 cam_sglist_cnt; /* Num of scatter gather list entries */
|
||||
uint32 cam_sort; /* Value used by SIM to sort on */
|
||||
uchar cam_scsi_status; /* Returned scsi device status */
|
||||
uchar cam_sense_resid; /* Autosense resid length: 2's comp */
|
||||
uchar cam_osd_rsvd1[2]; /* OSD Reserved field, for alignment */
|
||||
int32 cam_resid; /* Transfer residual length: 2's comp */
|
||||
CDB_UN cam_cdb_io; /* Union for CDB bytes/pointer */
|
||||
uint32 cam_timeout; /* Timeout value */
|
||||
uchar *cam_msg_ptr; /* Pointer to the message buffer */
|
||||
uint16 cam_msgb_len; /* Num of bytes in the message buf */
|
||||
uint16 cam_vu_flags; /* Vendor unique flags */
|
||||
uchar cam_tag_action; /* What to do for tag queuing */
|
||||
uchar cam_iorsvd0[3]; /* Reserved field, for alignment */
|
||||
uchar cam_sim_priv[ SIM_PRIV ]; /* SIM private data area */
|
||||
} CCB_SCSIIO;
|
||||
|
||||
/* Set Async Callback CCB */
|
||||
typedef struct ccb_setasync
|
||||
{
|
||||
CCB_HEADER cam_ch; /* Header information fields */
|
||||
uint32 cam_async_flags; /* Event enables for Callback resp */
|
||||
void (*cam_async_func)(); /* Async Callback function address */
|
||||
uchar *pdrv_buf; /* Buffer set aside by the Per. drv */
|
||||
uchar pdrv_buf_len; /* The size of the buffer */
|
||||
} CCB_SETASYNC;
|
||||
|
||||
/* Set device type CCB */
|
||||
typedef struct ccb_setdev
|
||||
{
|
||||
CCB_HEADER cam_ch; /* Header information fields */
|
||||
uchar cam_dev_type; /* Val for the dev type field in EDT */
|
||||
} CCB_SETDEV;
|
||||
|
||||
/* SCSI Control Functions. */
|
||||
|
||||
/* Abort XPT Request CCB */
|
||||
typedef struct ccb_abort
|
||||
{
|
||||
CCB_HEADER cam_ch; /* Header information fields */
|
||||
CCB_HEADER *cam_abort_ch; /* Pointer to the CCB to abort */
|
||||
} CCB_ABORT;
|
||||
|
||||
/* Reset SCSI Bus CCB */
|
||||
typedef struct ccb_resetbus
|
||||
{
|
||||
CCB_HEADER cam_ch; /* Header information fields */
|
||||
} CCB_RESETBUS;
|
||||
|
||||
/* Reset SCSI Device CCB */
|
||||
typedef struct ccb_resetdev
|
||||
{
|
||||
CCB_HEADER cam_ch; /* Header information fields */
|
||||
} CCB_RESETDEV;
|
||||
|
||||
/* Terminate I/O Process Request CCB */
|
||||
typedef struct ccb_termio
|
||||
{
|
||||
CCB_HEADER cam_ch; /* Header information fields */
|
||||
CCB_HEADER *cam_termio_ch; /* Pointer to the CCB to terminate */
|
||||
} CCB_TERMIO;
|
||||
|
||||
/* Target mode structures. */
|
||||
|
||||
/* Host Target Mode Version 1 Enable LUN CCB */
|
||||
typedef struct ccb_en_lun
|
||||
{
|
||||
CCB_HEADER cam_ch; /* Header information fields */
|
||||
uint16 cam_grp6_len; /* Group 6 VU CDB length */
|
||||
uint16 cam_grp7_len; /* Group 7 VU CDB length */
|
||||
uchar *cam_ccb_listptr; /* Pointer to the target CCB list */
|
||||
uint16 cam_ccb_listcnt; /* Count of Target CCBs in the list */
|
||||
} CCB_EN_LUN;
|
||||
|
||||
/* Enable LUN CCB (HTM V2) */
|
||||
typedef struct ccb_enable_lun
|
||||
{
|
||||
CCB_HEADER cam_ch; /* Header information fields */
|
||||
uint16 cam_grp6_length; /* Group 6 Vendor Unique CDB Lengths */
|
||||
uint16 cam_grp7_length; /* Group 7 Vendor Unique CDB Lengths */
|
||||
uchar *cam_immed_notify_list; /* Ptr to Immediate Notify CCB list */
|
||||
uint32 cam_immed_notify_cnt; /* Number of Immediate Notify CCBs */
|
||||
uchar *cam_accept_targ_list; /* Ptr to Accept Target I/O CCB list */
|
||||
uint32 cam_accept_targ_cnt; /* Number of Accept Target I/O CCBs */
|
||||
uchar cam_sim_priv[ SIM_PRIV ]; /* SIM private data area */
|
||||
} CCB_ENABLE_LUN;
|
||||
|
||||
/* Immediate Notify CCB */
|
||||
typedef struct ccb_immed_notify
|
||||
{
|
||||
CCB_HEADER cam_ch; /* Header information fields */
|
||||
uchar *cam_pdrv_ptr; /* Ptr used by the Peripheral driver */
|
||||
void (*cam_cbfnot)(); /* Callback on notification function */
|
||||
uchar *cam_sense_ptr; /* Pointer to the sense data buffer */
|
||||
uchar cam_sense_len; /* Num of bytes in the Autosense buf */
|
||||
uchar cam_init_id; /* ID of Initiator that selected */
|
||||
uint16 cam_seq_id; /* Sequence Identifier */
|
||||
uchar cam_msg_code; /* Message Code */
|
||||
uchar cam_msg_args[7]; /* Message Arguments */
|
||||
} CCB_IMMED_NOTIFY;
|
||||
|
||||
/* Notify Acknowledge CCB */
|
||||
typedef struct ccb_notify_ack
|
||||
{
|
||||
CCB_HEADER cam_ch; /* Header information fields */
|
||||
uint16 cam_seq_id; /* Sequence Identifier */
|
||||
uchar cam_event; /* Event */
|
||||
uchar cam_rsvd;
|
||||
} CCB_NOTIFY_ACK;
|
||||
|
||||
/* Accept Target I/O CCB */
|
||||
typedef struct ccb_accept_targ
|
||||
{
|
||||
CCB_HEADER cam_ch; /* Header information fields */
|
||||
uchar *cam_pdrv_ptr; /* Ptr used by the Peripheral driver */
|
||||
CCB_HEADER *cam_next_ccb; /* Ptr to the next CCB for action */
|
||||
uchar *cam_req_map; /* Ptr for mapping info on the Req. */
|
||||
void (*cam_cbfcnot)(); /* Callback on completion function */
|
||||
uchar *cam_data_ptr; /* Pointer to the data buf/SG list */
|
||||
uint32 cam_dxfer_len; /* Data xfer length */
|
||||
uchar *cam_sense_ptr; /* Pointer to the sense data buffer */
|
||||
uchar cam_sense_len; /* Num of bytes in the Autosense buf */
|
||||
uchar cam_cdb_len; /* Number of bytes for the CDB */
|
||||
uint16 cam_sglist_cnt; /* Num of scatter gather list entries */
|
||||
uint32 cam_sort; /* Value used by SIM to sort on */
|
||||
uchar cam_scsi_status; /* Returned scsi device status */
|
||||
uchar cam_sense_resid; /* Autosense resid length: 2's comp */
|
||||
uchar cam_osd_rsvd1[2]; /* OSD Reserved field, for alignment */
|
||||
int32 cam_resid; /* Transfer residual length: 2's comp */
|
||||
CDB_UN cam_cdb_io; /* Union for CDB bytes/pointer */
|
||||
uint32 cam_timeout; /* Timeout value */
|
||||
uchar *cam_msg_ptr; /* Pointer to the message buffer */
|
||||
uint16 cam_msgb_len; /* Num of bytes in the message buf */
|
||||
uint16 cam_vu_flags; /* Vendor unique flags */
|
||||
uchar cam_tag_action; /* What to do for tag queuing */
|
||||
uchar cam_tag_id; /* Tag ID */
|
||||
uchar cam_initiator_id; /* Initiator ID */
|
||||
uchar cam_iorsvd0[1]; /* Reserved field, for alignment */
|
||||
uchar cam_sim_priv[ SIM_PRIV ]; /* SIM private data area */
|
||||
} CCB_ACCEPT_TARG;
|
||||
|
||||
/* Continue Target I/O CCB */
|
||||
typedef CCB_ACCEPT_TARG CCB_CONT_TARG;
|
||||
|
||||
/* HBA engine structures. */
|
||||
|
||||
typedef struct ccb_eng_inq
|
||||
{
|
||||
CCB_HEADER cam_ch; /* Header information fields */
|
||||
uint16 cam_eng_num; /* The number for this inquiry */
|
||||
uchar cam_eng_type; /* Returned engine type */
|
||||
uchar cam_eng_algo; /* Returned algorithm type */
|
||||
uint32 cam_eng_memory; /* Returned engine memory size */
|
||||
} CCB_ENG_INQ;
|
||||
|
||||
typedef struct ccb_eng_exec /* NOTE: must match SCSIIO size */
|
||||
{
|
||||
CCB_HEADER cam_ch; /* Header information fields */
|
||||
uchar *cam_pdrv_ptr; /* Ptr used by the Peripheral driver */
|
||||
uint32 cam_engrsvd0; /* Reserved field, for alignment */
|
||||
uchar *cam_req_map; /* Ptr for mapping info on the Req. */
|
||||
void (*cam_cbfcnp)(); /* Callback on completion function */
|
||||
uchar *cam_data_ptr; /* Pointer to the data buf/SG list */
|
||||
uint32 cam_dxfer_len; /* Data xfer length */
|
||||
uchar *cam_engdata_ptr; /* Pointer to the engine buffer data */
|
||||
uchar cam_engrsvd1; /* Reserved field, for alignment */
|
||||
uchar cam_engrsvd2; /* Reserved field, for alignment */
|
||||
uint16 cam_sglist_cnt; /* Num of scatter gather list entries */
|
||||
uint32 cam_dmax_len; /* Destination data maximum length */
|
||||
uint32 cam_dest_len; /* Destination data length */
|
||||
int32 cam_src_resid; /* Source residual length: 2's comp */
|
||||
uchar cam_engrsvd3[12]; /* Reserved field, for alignment */
|
||||
uint32 cam_timeout; /* Timeout value */
|
||||
uint32 cam_engrsvd4; /* Reserved field, for alignment */
|
||||
uint16 cam_eng_num; /* Engine number for this request */
|
||||
uint16 cam_vu_flags; /* Vendor unique flags */
|
||||
uchar cam_engrsvd5; /* Reserved field, for alignment */
|
||||
uchar cam_engrsvd6[3]; /* Reserved field, for alignment */
|
||||
uchar cam_sim_priv[ SIM_PRIV ]; /* SIM private data area */
|
||||
} CCB_ENG_EXEC;
|
||||
|
||||
/* The sim_module_info definition is used to define the entry points for
|
||||
the SIMs contained in the SCSI CAM subsystem. Each SIM file will
|
||||
contain a declaration for it's entry. The address for this entry will
|
||||
be stored in the cam_conftbl[] array along will all the other SIM
|
||||
entries. */
|
||||
|
||||
typedef struct sim_module_info sim_module_info;
|
||||
|
||||
struct sim_module_info {
|
||||
module_info minfo;
|
||||
};
|
||||
|
||||
typedef struct CAM_SIM_ENTRY CAM_SIM_ENTRY;
|
||||
|
||||
struct CAM_SIM_ENTRY {
|
||||
status_t (*sim_init)();
|
||||
int32 (*sim_action)();
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
/* Defines for the CAM status field in the CCB header. */
|
||||
|
||||
#define CAM_REQ_INPROG 0x00 /* CCB request is in progress */
|
||||
#define CAM_REQ_CMP 0x01 /* CCB request completed w/out error */
|
||||
#define CAM_REQ_ABORTED 0x02 /* CCB request aborted by the host */
|
||||
#define CAM_UA_ABORT 0x03 /* Unable to Abort CCB request */
|
||||
#define CAM_REQ_CMP_ERR 0x04 /* CCB request completed with an err */
|
||||
#define CAM_BUSY 0x05 /* CAM subsystem is busy */
|
||||
#define CAM_REQ_INVALID 0x06 /* CCB request is invalid */
|
||||
#define CAM_PATH_INVALID 0x07 /* Path ID supplied is invalid */
|
||||
#define CAM_DEV_NOT_THERE 0x08 /* SCSI device not installed/there */
|
||||
#define CAM_UA_TERMIO 0x09 /* Unable to Terminate I/O CCB req */
|
||||
#define CAM_SEL_TIMEOUT 0x0A /* Target selection timeout */
|
||||
#define CAM_CMD_TIMEOUT 0x0B /* Command timeout */
|
||||
#define CAM_MSG_REJECT_REC 0x0D /* Message reject received */
|
||||
#define CAM_SCSI_BUS_RESET 0x0E /* SCSI bus reset sent/received */
|
||||
#define CAM_UNCOR_PARITY 0x0F /* Uncorrectable parity err occurred */
|
||||
#define CAM_AUTOSENSE_FAIL 0x10 /* Autosense: Request sense cmd fail */
|
||||
#define CAM_NO_HBA 0x11 /* No HBA detected Error */
|
||||
#define CAM_DATA_RUN_ERR 0x12 /* Data overrun/underrun error */
|
||||
#define CAM_UNEXP_BUSFREE 0x13 /* Unexpected BUS free */
|
||||
#define CAM_SEQUENCE_FAIL 0x14 /* Target bus phase sequence failure */
|
||||
#define CAM_CCB_LEN_ERR 0x15 /* CCB length supplied is inadequate */
|
||||
#define CAM_PROVIDE_FAIL 0x16 /* Unable to provide requ. capability */
|
||||
#define CAM_BDR_SENT 0x17 /* A SCSI BDR msg was sent to target */
|
||||
#define CAM_REQ_TERMIO 0x18 /* CCB request terminated by the host */
|
||||
#define CAM_HBA_ERR 0x19 /* Unrecoverable host bus adaptor err*/
|
||||
#define CAM_BUS_RESET_DENIED 0x1A /* SCSI bus reset denied */
|
||||
|
||||
#define CAM_IDE 0x33 /* Initiator Detected Error Received */
|
||||
#define CAM_RESRC_UNAVAIL 0x34 /* Resource unavailable */
|
||||
#define CAM_UNACKED_EVENT 0x35 /* Unacknowledged event by host */
|
||||
#define CAM_MESSAGE_RECV 0x36 /* Msg received in Host Target Mode */
|
||||
#define CAM_INVALID_CDB 0x37 /* Invalid CDB recvd in HT Mode */
|
||||
#define CAM_LUN_INVALID 0x38 /* LUN supplied is invalid */
|
||||
#define CAM_TID_INVALID 0x39 /* Target ID supplied is invalid */
|
||||
#define CAM_FUNC_NOTAVAIL 0x3A /* The requ. func is not available */
|
||||
#define CAM_NO_NEXUS 0x3B /* Nexus is not established */
|
||||
#define CAM_IID_INVALID 0x3C /* The initiator ID is invalid */
|
||||
#define CAM_CDB_RECVD 0x3D /* The SCSI CDB has been received */
|
||||
#define CAM_LUN_ALLREADY_ENAB 0x3E /* LUN already enabled */
|
||||
#define CAM_SCSI_BUSY 0x3F /* SCSI bus busy */
|
||||
|
||||
#define CAM_SIM_QFRZN 0x40 /* The SIM queue is frozen w/this err */
|
||||
#define CAM_AUTOSNS_VALID 0x80 /* Autosense data valid for target */
|
||||
|
||||
#define CAM_STATUS_MASK 0x3F /* Mask bits for just the status # */
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
/* Defines for the CAM flags field in the CCB header. */
|
||||
|
||||
#define CAM_DIR_RESV 0x00000000 /* Data direction (00: reserved) */
|
||||
#define CAM_DIR_IN 0x00000040 /* Data direction (01: DATA IN) */
|
||||
#define CAM_DIR_OUT 0x00000080 /* Data direction (10: DATA OUT) */
|
||||
#define CAM_DIR_NONE 0x000000C0 /* Data direction (11: no data) */
|
||||
#define CAM_DIS_AUTOSENSE 0x00000020 /* Disable autosense feature */
|
||||
#define CAM_SCATTER_VALID 0x00000010 /* Scatter/gather list is valid */
|
||||
#define CAM_DIS_CALLBACK 0x00000008 /* Disable callback feature */
|
||||
#define CAM_CDB_LINKED 0x00000004 /* The CCB contains a linked CDB */
|
||||
#define CAM_QUEUE_ENABLE 0x00000002 /* SIM queue actions are enabled */
|
||||
#define CAM_CDB_POINTER 0x00000001 /* The CDB field contains a pointer */
|
||||
|
||||
#define CAM_DIS_DISCONNECT 0x00008000 /* Disable disconnect */
|
||||
#define CAM_INITIATE_SYNC 0x00004000 /* Attempt Sync data xfer, and SDTR */
|
||||
#define CAM_DIS_SYNC 0x00002000 /* Disable sync, go to async */
|
||||
#define CAM_SIM_QHEAD 0x00001000 /* Place CCB at the head of SIM Q */
|
||||
#define CAM_SIM_QFREEZE 0x00000800 /* Return the SIM Q to frozen state */
|
||||
#define CAM_SIM_QFRZDIS 0x00000400 /* Disable the SIM Q frozen state */
|
||||
#define CAM_ENG_SYNC 0x00000200 /* Flush resid bytes before cmplt */
|
||||
|
||||
#define CAM_ENG_SGLIST 0x00800000 /* The SG list is for the HBA engine */
|
||||
#define CAM_CDB_PHYS 0x00400000 /* CDB pointer is physical */
|
||||
#define CAM_DATA_PHYS 0x00200000 /* SG/Buffer data ptrs are physical */
|
||||
#define CAM_SNS_BUF_PHYS 0x00100000 /* Autosense data ptr is physical */
|
||||
#define CAM_MSG_BUF_PHYS 0x00080000 /* Message buffer ptr is physical */
|
||||
#define CAM_NXT_CCB_PHYS 0x00040000 /* Next CCB pointer is physical */
|
||||
#define CAM_CALLBCK_PHYS 0x00020000 /* Callback func ptr is physical */
|
||||
|
||||
#define CAM_SEND_STATUS 0x80000000 /* Send status after date phase */
|
||||
#define CAM_DISCONNECT 0x40000000 /* Disc. mandatory after cdb recv */
|
||||
#define CAM_TERM_IO 0x20000000 /* Terminate I/O Message supported */
|
||||
|
||||
#define CAM_DATAB_VALID 0x80000000 /* Data buffer valid */
|
||||
#define CAM_STATUS_VALID 0x40000000 /* Status buffer valid */
|
||||
#define CAM_MSGB_VALID 0x20000000 /* Message buffer valid */
|
||||
#define CAM_TGT_PHASE_MODE 0x08000000 /* The SIM will run in phase mode */
|
||||
#define CAM_TGT_CCB_AVAIL 0x04000000 /* Target CCB available */
|
||||
#define CAM_DIS_AUTODISC 0x02000000 /* Disable autodisconnect */
|
||||
#define CAM_DIS_AUTOSRP 0x01000000 /* Disable autosave/restore ptrs */
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
/* Defines for the SIM/HBA queue actions. These value are used in the
|
||||
SCSI I/O CCB, for the queue action field. [These values should match the
|
||||
defines from some other include file for the SCSI message phases. We may
|
||||
not need these definitions here. ] */
|
||||
|
||||
#define CAM_SIMPLE_QTAG 0x20 /* Tag for a simple queue */
|
||||
#define CAM_HEAD_QTAG 0x21 /* Tag for head of queue */
|
||||
#define CAM_ORDERED_QTAG 0x22 /* Tag for ordered queue */
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
/* Defines for the timeout field in the SCSI I/O CCB. At this time a value
|
||||
of 0xF-F indicates a infinite timeout. A value of 0x0-0 indicates that the
|
||||
SIM's default timeout can take effect. */
|
||||
|
||||
#define CAM_TIME_DEFAULT 0x00000000 /* Use SIM default value */
|
||||
#define CAM_TIME_INFINITY 0xFFFFFFFF /* Infinite timeout for I/O */
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
/* Defines for the Path Inquiry CCB fields. */
|
||||
|
||||
#define CAM_VERSION 0x25 /* Binary value for the current ver */
|
||||
|
||||
#define PI_MDP_ABLE 0x80 /* Supports MDP message */
|
||||
#define PI_WIDE_32 0x40 /* Supports 32 bit wide SCSI */
|
||||
#define PI_WIDE_16 0x20 /* Supports 16 bit wide SCSI */
|
||||
#define PI_SDTR_ABLE 0x10 /* Supports SDTR message */
|
||||
#define PI_LINKED_CDB 0x08 /* Supports linked CDBs */
|
||||
#define PI_TAG_ABLE 0x02 /* Supports tag queue message */
|
||||
#define PI_SOFT_RST 0x01 /* Supports soft reset */
|
||||
|
||||
#define PIT_PROCESSOR 0x80 /* Target mode processor mode */
|
||||
#define PIT_PHASE 0x40 /* Target mode phase cog. mode */
|
||||
|
||||
#define PIM_SCANHILO 0x80 /* Bus scans from ID 7 to ID 0 */
|
||||
#define PIM_NOREMOVE 0x40 /* Removable dev not included in scan */
|
||||
#define PIM_NOINQUIRY 0x20 /* Inquiry data not kept by XPT */
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
/* Defines for Asynchronous Callback CCB fields. */
|
||||
|
||||
#define AC_FOUND_DEVICES 0x80 /* During a rescan new device found */
|
||||
#define AC_SIM_DEREGISTER 0x40 /* A loaded SIM has de-registered */
|
||||
#define AC_SIM_REGISTER 0x20 /* A loaded SIM has registered */
|
||||
#define AC_SENT_BDR 0x10 /* A BDR message was sent to target */
|
||||
#define AC_SCSI_AEN 0x08 /* A SCSI AEN has been received */
|
||||
#define AC_UNSOL_RESEL 0x02 /* A unsolicited reselection occurred */
|
||||
#define AC_BUS_RESET 0x01 /* A SCSI bus RESET occurred */
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
/* Typedef for a scatter/gather list element. */
|
||||
|
||||
typedef struct sg_elem
|
||||
{
|
||||
uchar *cam_sg_address; /* Scatter/Gather address */
|
||||
uint32 cam_sg_count; /* Scatter/Gather count */
|
||||
} SG_ELEM;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
/* Defines for the "event" field in the CCB_NOTIFY_ACK */
|
||||
#define CAM_RESET_CLEARED 0x80 /* Reset Cleared */
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
/* Defines for the HBA engine inquiry CCB fields. */
|
||||
|
||||
#define EIT_BUFFER 0x00 /* Engine type: Buffer memory */
|
||||
#define EIT_LOSSLESS 0x01 /* Engine type: Lossless compression */
|
||||
#define EIT_LOSSLY 0x02 /* Engine type: Lossly compression */
|
||||
#define EIT_ENCRYPT 0x03 /* Engine type: Encryption */
|
||||
|
||||
#define EAD_VUNIQUE 0x00 /* Eng algorithm ID: vendor unique */
|
||||
#define EAD_LZ1V1 0x00 /* Eng algorithm ID: LZ1 var. 1*/
|
||||
#define EAD_LZ2V1 0x00 /* Eng algorithm ID: LZ2 var. 1*/
|
||||
#define EAD_LZ2V2 0x00 /* Eng algorithm ID: LZ2 var. 2*/
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
/* Unix OSD defines and data structures. */
|
||||
|
||||
#define INQLEN 36 /* Inquiry string length to store. */
|
||||
|
||||
#define CAM_SUCCESS 0 /* For signaling general success */
|
||||
#define CAM_FAILURE 1 /* For signaling general failure */
|
||||
|
||||
#define CAM_FALSE 0 /* General purpose flag value */
|
||||
#define CAM_TRUE 1 /* General purpose flag value */
|
||||
|
||||
#define XPT_CCB_INVALID -1 /* for signaling a bad CCB to free */
|
||||
|
||||
/* The typedef for the Async callback information. This structure is used to
|
||||
store the supplied info from the Set Async Callback CCB, in the EDT table
|
||||
in a linked list structure. */
|
||||
|
||||
typedef struct async_info
|
||||
{
|
||||
struct async_info *cam_async_next; /* pointer to the next structure */
|
||||
uint32 cam_event_enable; /* Event enables for Callback resp */
|
||||
void (*cam_async_func)(); /* Async Callback function address */
|
||||
uint32 cam_async_blen; /* Length of "information" buffer */
|
||||
uchar *cam_async_ptr; /* Address for the "information */
|
||||
} ASYNC_INFO;
|
||||
|
||||
/* The CAM EDT table contains the device information for all the
|
||||
devices, SCSI ID and LUN, for all the SCSI busses in the system. The
|
||||
table contains a CAM_EDT_ENTRY structure for each device on the bus.
|
||||
*/
|
||||
|
||||
typedef struct cam_edt_entry
|
||||
{
|
||||
int32 cam_tlun_found; /* Flag for the existence of the target/LUN */
|
||||
ASYNC_INFO *cam_ainfo; /* Async callback list info for this B/T/L */
|
||||
uint32 cam_owner_tag; /* Tag for the peripheral driver's ownership */
|
||||
char cam_inq_data[ INQLEN ]; /* storage for the inquiry data */
|
||||
} CAM_EDT_ENTRY;
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
/* ----------------------------- VENDOR UNIQUE DATA ----------------------------- */
|
||||
/* ============================================================================== */
|
||||
|
||||
/* ---
|
||||
Vendor unique XPT function codes
|
||||
--- */
|
||||
|
||||
#define XPT_EXTENDED_PATH_INQ (XPT_VUNIQUE + 1) /* Extended Path Inquiry */
|
||||
|
||||
/* Extended path inquiry CCB */
|
||||
|
||||
#define FAM_ID 16 /* ASCII string len for FAMILY ID */
|
||||
#define TYPE_ID 16 /* ASCII string len for TYPE ID */
|
||||
#define VERS 8 /* ASCII string len for SIM & HBA vers */
|
||||
|
||||
typedef struct ccb_extended_pathinq
|
||||
{
|
||||
CCB_PATHINQ cam_path; /* Default path inquiry */
|
||||
char cam_sim_version [ VERS ]; /* SIM version number */
|
||||
char cam_hba_version [ VERS ]; /* HBA version number */
|
||||
char cam_controller_family [ FAM_ID ]; /* Controller family */
|
||||
char cam_controller_type [ TYPE_ID ]; /* Controller type */
|
||||
} CCB_EXTENDED_PATHINQ;
|
||||
|
||||
|
||||
/* ---
|
||||
Vendor unique flags supported by Be OS (cam_vu_flags)
|
||||
--- */
|
||||
|
||||
enum {
|
||||
VU_RESERVED_0 = 0x0001,
|
||||
VU_RESERVED_1 = 0x0002,
|
||||
VU_DISABLE_SEL_W_ATN = 0x0004,
|
||||
VU_RESERVED_4 = 0x0008
|
||||
};
|
||||
|
||||
|
||||
/* ---
|
||||
XPT interface used by SCSI drivers
|
||||
--- */
|
||||
|
||||
typedef struct cam_for_driver_module_info cam_for_driver_module_info;
|
||||
|
||||
struct cam_for_driver_module_info {
|
||||
bus_manager_info minfo;
|
||||
CCB_HEADER * (*xpt_ccb_alloc)(void);
|
||||
void (*xpt_ccb_free)(void *ccb);
|
||||
long (*xpt_action)(CCB_HEADER *ccbh);
|
||||
};
|
||||
|
||||
#define B_CAM_FOR_DRIVER_MODULE_NAME "bus_managers/scsi/driver/v1"
|
||||
|
||||
/* ---
|
||||
XPT interface used by SCSI SIMs
|
||||
--- */
|
||||
|
||||
typedef struct cam_for_sim_module_info cam_for_sim_module_info;
|
||||
|
||||
struct cam_for_sim_module_info {
|
||||
bus_manager_info minfo;
|
||||
long (*xpt_bus_register) (CAM_SIM_ENTRY *sim);
|
||||
long (*xpt_bus_deregister) (long path);
|
||||
};
|
||||
|
||||
#define B_CAM_FOR_SIM_MODULE_NAME "bus_managers/scsi/sim/v1"
|
||||
|
||||
|
||||
/* General Union for Kernel Space allocation. Contains all the possible CCB
|
||||
structures. This union should never be used for manipulating CCB's its only
|
||||
use is for the allocation and deallocation of raw CCB space. */
|
||||
|
||||
typedef union ccb_size_union
|
||||
{
|
||||
CCB_SCSIIO csio; /* Please keep this first, for debug/print */
|
||||
CCB_GETDEV cgd;
|
||||
CCB_PATHINQ cpi;
|
||||
CCB_RELSIM crs;
|
||||
CCB_SETASYNC csa;
|
||||
CCB_SETDEV csd;
|
||||
CCB_ABORT cab;
|
||||
CCB_RESETBUS crb;
|
||||
CCB_RESETDEV crd;
|
||||
CCB_TERMIO ctio;
|
||||
CCB_EN_LUN cel;
|
||||
CCB_ENABLE_LUN cel2;
|
||||
CCB_IMMED_NOTIFY cin;
|
||||
CCB_NOTIFY_ACK cna;
|
||||
CCB_ACCEPT_TARG cat;
|
||||
CCB_ENG_INQ cei;
|
||||
CCB_ENG_EXEC cee;
|
||||
CCB_EXTENDED_PATHINQ cdpi;
|
||||
} CCB_SIZE_UNION;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,45 +0,0 @@
|
||||
/********************************************************************************
|
||||
/
|
||||
/ File: D2A.h
|
||||
/
|
||||
/ Description: Digital-To-Analog converter class header.
|
||||
/
|
||||
/ Copyright 1996-98, Be Incorporated, All Rights Reserved.
|
||||
/
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
#ifndef _D2A_H
|
||||
#define _D2A_H
|
||||
|
||||
#include <BeBuild.h>
|
||||
#include <stddef.h>
|
||||
#include <SupportDefs.h>
|
||||
|
||||
/* -----------------------------------------------------------------------*/
|
||||
class BD2A {
|
||||
|
||||
public:
|
||||
BD2A();
|
||||
virtual ~BD2A();
|
||||
|
||||
status_t Open(const char *portName);
|
||||
void Close(void);
|
||||
bool IsOpen(void);
|
||||
|
||||
ssize_t Read(uint8 *buf);
|
||||
ssize_t Write(uint8 value);
|
||||
|
||||
/* -----------------------------------------------------------------------*/
|
||||
|
||||
private:
|
||||
|
||||
virtual void _ReservedD2A1();
|
||||
virtual void _ReservedD2A2();
|
||||
virtual void _ReservedD2A3();
|
||||
|
||||
int ffd;
|
||||
uint32 _fReserved[3];
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,54 +0,0 @@
|
||||
/********************************************************************************
|
||||
/
|
||||
/ File: DigitalPort.h
|
||||
/
|
||||
/ Description: Digital Port class header.
|
||||
/
|
||||
/ Copyright 1996-98, Be Incorporated, All Rights Reserved.
|
||||
/
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
#ifndef _DIGITAL_PORT_H
|
||||
#define _DIGITAL_PORT_H
|
||||
|
||||
#include <BeBuild.h>
|
||||
#include <stddef.h>
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------*/
|
||||
class BDigitalPort {
|
||||
|
||||
public:
|
||||
BDigitalPort();
|
||||
virtual ~BDigitalPort();
|
||||
|
||||
status_t Open(const char *portName);
|
||||
void Close(void);
|
||||
bool IsOpen(void);
|
||||
|
||||
ssize_t Read(uint8 *buf);
|
||||
ssize_t Write(uint8 value);
|
||||
|
||||
status_t SetAsOutput (void);
|
||||
bool IsOutput (void);
|
||||
|
||||
status_t SetAsInput (void);
|
||||
bool IsInput (void);
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------*/
|
||||
|
||||
private:
|
||||
|
||||
virtual void _ReservedDigitalPort1();
|
||||
virtual void _ReservedDigitalPort2();
|
||||
virtual void _ReservedDigitalPort3();
|
||||
|
||||
int ffd;
|
||||
bool fIsInput;
|
||||
uint32 _fReserved[3];
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,118 +0,0 @@
|
||||
/********************************************************************************
|
||||
/
|
||||
/ File: Joystick.h
|
||||
/
|
||||
/ Description: Joystick port class header.
|
||||
/
|
||||
/ Copyright 1996-98, Be Incorporated, All Rights Reserved.
|
||||
/
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
#ifndef _JOYSTICK_H
|
||||
#define _JOYSTICK_H
|
||||
|
||||
#include <BeBuild.h>
|
||||
#include <SupportDefs.h>
|
||||
#include <OS.h>
|
||||
|
||||
class BList;
|
||||
struct _extended_joystick;
|
||||
class _IMPEXP_DEVICE _BJoystickTweaker;
|
||||
|
||||
/* -----------------------------------------------------------------------*/
|
||||
class BJoystick {
|
||||
|
||||
public:
|
||||
BJoystick();
|
||||
virtual ~BJoystick();
|
||||
|
||||
status_t Open(const char *portName); /* always goes for enhanced mode */
|
||||
status_t Open(const char *portName, bool enter_enhanced);
|
||||
void Close(void);
|
||||
|
||||
status_t Update(void);
|
||||
status_t SetMaxLatency(
|
||||
bigtime_t max_latency);
|
||||
|
||||
bigtime_t timestamp;
|
||||
int16 horizontal;
|
||||
int16 vertical;
|
||||
bool button1; /* NOTE: true == off */
|
||||
bool button2;
|
||||
|
||||
int32 CountDevices();
|
||||
status_t GetDeviceName(int32 n, char * name,
|
||||
size_t bufSize = B_OS_NAME_LENGTH);
|
||||
|
||||
/* if you care about more than just the first two axes/buttons, here's where you go */
|
||||
bool EnterEnhancedMode(
|
||||
const entry_ref * ref = NULL);
|
||||
int32 CountSticks();
|
||||
int32 CountAxes();
|
||||
int32 CountHats();
|
||||
int32 CountButtons();
|
||||
status_t GetAxisValues(
|
||||
int16 * out_values,
|
||||
int32 for_stick = 0); /* CountAxes() elements */
|
||||
status_t GetHatValues(
|
||||
uint8 * out_hats,
|
||||
int32 for_stick = 0);
|
||||
uint32 ButtonValues(
|
||||
int32 for_stick = 0); /* NOTE: Buttons() are 1 == on */
|
||||
status_t GetAxisNameAt(
|
||||
int32 index,
|
||||
BString * out_name);
|
||||
status_t GetHatNameAt(
|
||||
int32 index,
|
||||
BString * out_name);
|
||||
status_t GetButtonNameAt(
|
||||
int32 index,
|
||||
BString * out_name);
|
||||
status_t GetControllerModule(
|
||||
BString * out_name);
|
||||
status_t GetControllerName(
|
||||
BString * out_name);
|
||||
|
||||
bool IsCalibrationEnabled();
|
||||
status_t EnableCalibration(
|
||||
bool calibrates = true);
|
||||
|
||||
/* -----------------------------------------------------------------------*/
|
||||
|
||||
protected:
|
||||
|
||||
virtual void Calibrate(
|
||||
struct _extended_joystick * reading);
|
||||
|
||||
private:
|
||||
friend class _BJoystickTweaker;
|
||||
|
||||
struct _joystick_info;
|
||||
|
||||
void ScanDevices(
|
||||
bool use_disabled = false);
|
||||
status_t gather_enhanced_info(
|
||||
const entry_ref * ref = NULL);
|
||||
status_t save_config(
|
||||
const entry_ref * ref = NULL);
|
||||
|
||||
void _ReservedJoystick1();
|
||||
virtual void _ReservedJoystick2();
|
||||
virtual void _ReservedJoystick3();
|
||||
|
||||
bool _mBeBoxMode;
|
||||
bool _mReservedBool;
|
||||
int ffd;
|
||||
BList * _fDevices;
|
||||
_joystick_info * m_info;
|
||||
char * m_dev_name;
|
||||
#if !_PR3_COMPATIBLE_
|
||||
virtual status_t _Reserved_Joystick_4(void *, ...);
|
||||
virtual status_t _Reserved_Joystick_5(void *, ...);
|
||||
virtual status_t _Reserved_Joystick_6(void *, ...);
|
||||
uint32 _reserved_Joystick_[10];
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,109 +0,0 @@
|
||||
/********************************************************************************
|
||||
/
|
||||
/ File: SerialPort.h
|
||||
/
|
||||
/ Description: Serial Port class header.
|
||||
/
|
||||
/ Copyright 1995-98, Be Incorporated, All Rights Reserved.
|
||||
/
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
#ifndef _SERIAL_PORT_H
|
||||
#define _SERIAL_PORT_H
|
||||
|
||||
#include <BeBuild.h>
|
||||
#include <stddef.h>
|
||||
#include <OS.h>
|
||||
#include <SupportDefs.h>
|
||||
|
||||
class BList;
|
||||
|
||||
enum data_rate { B_0_BPS = 0, B_50_BPS, B_75_BPS, B_110_BPS, B_134_BPS,
|
||||
B_150_BPS, B_200_BPS, B_300_BPS, B_600_BPS, B_1200_BPS,
|
||||
B_1800_BPS, B_2400_BPS, B_4800_BPS, B_9600_BPS, B_19200_BPS,
|
||||
B_38400_BPS, B_57600_BPS, B_115200_BPS,
|
||||
B_230400_BPS, B_31250_BPS };
|
||||
|
||||
enum data_bits { B_DATA_BITS_7, B_DATA_BITS_8 };
|
||||
|
||||
enum stop_bits { B_STOP_BITS_1, B_STOP_BITS_2 };
|
||||
#define B_STOP_BIT_1 B_STOP_BITS_1
|
||||
|
||||
enum parity_mode { B_NO_PARITY, B_ODD_PARITY, B_EVEN_PARITY };
|
||||
|
||||
enum { B_NOFLOW_CONTROL = 0, B_HARDWARE_CONTROL = 0x00000001,
|
||||
B_SOFTWARE_CONTROL = 0x00000002 };
|
||||
|
||||
/* -----------------------------------------------------------------------*/
|
||||
class BSerialPort {
|
||||
|
||||
public:
|
||||
BSerialPort();
|
||||
virtual ~BSerialPort();
|
||||
|
||||
status_t Open(const char *portName);
|
||||
void Close(void);
|
||||
|
||||
ssize_t Read(void *buf, size_t count);
|
||||
ssize_t Write(const void *buf, size_t count);
|
||||
void SetBlocking(bool Blocking);
|
||||
status_t SetTimeout(bigtime_t microSeconds);
|
||||
|
||||
status_t SetDataRate(data_rate bitsPerSecond);
|
||||
data_rate DataRate(void);
|
||||
|
||||
void SetDataBits(data_bits numBits);
|
||||
data_bits DataBits(void);
|
||||
void SetStopBits(stop_bits numBits);
|
||||
stop_bits StopBits(void);
|
||||
|
||||
void SetParityMode(parity_mode which);
|
||||
parity_mode ParityMode(void);
|
||||
|
||||
void ClearInput(void);
|
||||
void ClearOutput(void);
|
||||
|
||||
void SetFlowControl(uint32 method);
|
||||
uint32 FlowControl(void);
|
||||
|
||||
status_t SetDTR(bool asserted);
|
||||
status_t SetRTS(bool asserted);
|
||||
status_t NumCharsAvailable(int32 *wait_until_this_many);
|
||||
|
||||
bool IsCTS(void);
|
||||
bool IsDSR(void);
|
||||
bool IsRI(void);
|
||||
bool IsDCD(void);
|
||||
ssize_t WaitForInput(void);
|
||||
/* -----------------------------------------------------------------------*/
|
||||
|
||||
int32 CountDevices();
|
||||
status_t GetDeviceName(int32 n, char * name,
|
||||
size_t bufSize = B_OS_NAME_LENGTH);
|
||||
|
||||
private:
|
||||
|
||||
void ScanDevices();
|
||||
|
||||
virtual void _ReservedSerialPort1();
|
||||
virtual void _ReservedSerialPort2();
|
||||
virtual void _ReservedSerialPort3();
|
||||
virtual void _ReservedSerialPort4();
|
||||
|
||||
int ffd;
|
||||
data_rate fBaudRate;
|
||||
data_bits fDataBits;
|
||||
stop_bits fStopBits;
|
||||
parity_mode fParityMode;
|
||||
uint32 fFlow;
|
||||
bigtime_t fTimeout;
|
||||
bool fBlocking;
|
||||
|
||||
int DriverControl();
|
||||
|
||||
BList * _fDevices;
|
||||
uint32 _fReserved[3];
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,20 +0,0 @@
|
||||
#if !defined(_GRAPHIC_DRIVER_H_)
|
||||
#define _GRAPHIC_DRIVER_H_
|
||||
|
||||
#include <Drivers.h>
|
||||
|
||||
/* The API for driver access is C, not C++ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum {
|
||||
B_GET_ACCELERANT_SIGNATURE = B_GRAPHIC_DRIVER_BASE
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,178 +0,0 @@
|
||||
/******************************************************************************
|
||||
/
|
||||
/ File: scsi.h
|
||||
/
|
||||
/ Description: Data structures and control calls for using the scsi driver.
|
||||
/
|
||||
/ Copyright 1992-98, Be Incorporated
|
||||
/
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
#ifndef _SCSI_H
|
||||
#define _SCSI_H
|
||||
|
||||
#include <SupportDefs.h>
|
||||
#include <OS.h>
|
||||
#include <Drivers.h>
|
||||
|
||||
|
||||
/* scsi device types */
|
||||
/*------------------------*/
|
||||
#define B_SCSI_DISK 0x00
|
||||
#define B_SCSI_TAPE 0x01
|
||||
#define B_SCSI_PRINTER 0x02
|
||||
#define B_SCSI_CPU 0x03
|
||||
#define B_SCSI_WORM 0x04
|
||||
#define B_SCSI_CD 0x05
|
||||
#define B_SCSI_SCANNER 0x06
|
||||
#define B_SCSI_OPTICAL 0x07
|
||||
#define B_SCSI_JUKEBOX 0x08
|
||||
#define B_SCSI_NETWORK 0x09
|
||||
|
||||
|
||||
/* scsi device masks */
|
||||
/*----------------------------------*/
|
||||
#define B_SCSI_ALL_DEVICES_MASK 0xffffffff
|
||||
#define B_SCSI_DISK_MASK (1 << (B_SCSI_DISK))
|
||||
#define B_SCSI_TAPE_MASK (1 << (B_SCSI_TAPE))
|
||||
#define B_SCSI_PRINTER_MASK (1 << (B_SCSI_PRINTER))
|
||||
#define B_SCSI_CPU_MASK (1 << (B_SCSI_CPU))
|
||||
#define B_SCSI_WORM_MASK (1 << (B_SCSI_WORM))
|
||||
#define B_SCSI_CD_MASK (1 << (B_SCSI_CD))
|
||||
#define B_SCSI_SCANNER_MASK (1 << (B_SCSI_SCANNER))
|
||||
#define B_SCSI_OPTICAL_MASK (1 << (B_SCSI_OPTICAL))
|
||||
#define B_SCSI_JUKEBOX_MASK (1 << (B_SCSI_JUKEBOX))
|
||||
#define B_SCSI_NETWORK_MASK (1 << (B_SCSI_NETWORK))
|
||||
|
||||
/* control call codes for rescan scsi driver (/dev/scsi/rescan) */
|
||||
/*-----------------------------------------------------*/
|
||||
enum {
|
||||
B_SCSI_SCAN_FOR_DEVICES = B_DEVICE_OP_CODES_END + 1,
|
||||
B_SCSI_ENABLE_PROFILING
|
||||
};
|
||||
|
||||
|
||||
/* control calls for all individual scsi device drivers */
|
||||
/*------------------------------------------------------*/
|
||||
enum {
|
||||
B_SCSI_INQUIRY = B_DEVICE_OP_CODES_END + 100,
|
||||
B_SCSI_EJECT,
|
||||
B_SCSI_PREVENT_ALLOW,
|
||||
B_RAW_DEVICE_COMMAND
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
uchar inquiry_data[36]; /* inquiry data (see SCSI standard) */
|
||||
} scsi_inquiry;
|
||||
|
||||
|
||||
/* control calls for scsi cd-rom driver */
|
||||
/*--------------------------------------*/
|
||||
enum {
|
||||
B_SCSI_GET_TOC = B_DEVICE_OP_CODES_END + 200,
|
||||
B_SCSI_PLAY_TRACK,
|
||||
B_SCSI_PLAY_POSITION,
|
||||
B_SCSI_STOP_AUDIO,
|
||||
B_SCSI_PAUSE_AUDIO,
|
||||
B_SCSI_RESUME_AUDIO,
|
||||
B_SCSI_GET_POSITION,
|
||||
B_SCSI_SET_VOLUME,
|
||||
B_SCSI_GET_VOLUME,
|
||||
B_SCSI_READ_CD,
|
||||
B_SCSI_SCAN,
|
||||
B_SCSI_DATA_MODE
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
uchar toc_data[804]; /* table of contents data (see SCSI standard) */
|
||||
} scsi_toc;
|
||||
|
||||
typedef struct {
|
||||
uchar start_track; /* starting track */
|
||||
uchar start_index; /* starting index */
|
||||
uchar end_track; /* ending track */
|
||||
uchar end_index; /* ending index */
|
||||
} scsi_play_track;
|
||||
|
||||
typedef struct {
|
||||
uchar start_m; /* starting minute */
|
||||
uchar start_s; /* starting second */
|
||||
uchar start_f; /* starting frame */
|
||||
uchar end_m; /* ending minute */
|
||||
uchar end_s; /* ending second */
|
||||
uchar end_f; /* ending frame */
|
||||
} scsi_play_position;
|
||||
|
||||
typedef struct {
|
||||
uchar position[16]; /* position data (see SCSI standard) */
|
||||
} scsi_position;
|
||||
|
||||
typedef struct {
|
||||
uchar flags; /* A 1 in any position means change that field */
|
||||
/* with port0_channel as bit 0 and port3_volume */
|
||||
/* as bit 7. */
|
||||
uchar port0_channel;
|
||||
uchar port0_volume;
|
||||
uchar port1_channel;
|
||||
uchar port1_volume;
|
||||
uchar port2_channel;
|
||||
uchar port2_volume;
|
||||
uchar port3_channel;
|
||||
uchar port3_volume;
|
||||
} scsi_volume;
|
||||
|
||||
#define B_SCSI_PORT0_CHANNEL 0x01
|
||||
#define B_SCSI_PORT0_VOLUME 0x02
|
||||
#define B_SCSI_PORT1_CHANNEL 0x04
|
||||
#define B_SCSI_PORT1_VOLUME 0x08
|
||||
#define B_SCSI_PORT2_CHANNEL 0x10
|
||||
#define B_SCSI_PORT2_VOLUME 0x20
|
||||
#define B_SCSI_PORT3_CHANNEL 0x40
|
||||
#define B_SCSI_PORT3_VOLUME 0x80
|
||||
|
||||
typedef struct {
|
||||
uchar start_m; /* starting minute */
|
||||
uchar start_s; /* starting second */
|
||||
uchar start_f; /* starting frame */
|
||||
uchar length_m; /* transfer length minute */
|
||||
uchar length_s; /* transfer length second */
|
||||
uchar length_f; /* transfer length frame */
|
||||
long buffer_length; /* size of read buffer */
|
||||
char* buffer; /* buffer to hold requested data */
|
||||
bool play; /* FALSE = don't play, TRUE = play */
|
||||
} scsi_read_cd;
|
||||
|
||||
typedef struct {
|
||||
char speed; /* 0 = slow - 5x, 1 = fast - 12x */
|
||||
char direction; /* 1 = forward, 0 = stop scan, -1 = backward */
|
||||
} scsi_scan;
|
||||
|
||||
typedef struct {
|
||||
off_t block;
|
||||
int32 mode;
|
||||
} scsi_data_mode;
|
||||
|
||||
/* raw device commands */
|
||||
|
||||
typedef struct {
|
||||
uint8 command[16];
|
||||
uint8 command_length;
|
||||
uint8 flags;
|
||||
uint8 scsi_status; /* SCSI Status Byte */
|
||||
/* (0 = success, 2 = check cond, ... */
|
||||
uint8 cam_status; /* CAM_* status conditions from CAM.h */
|
||||
void *data;
|
||||
size_t data_length;
|
||||
void *sense_data; /* buffer to return mode sense data in */
|
||||
size_t sense_data_length; /* size of optional buffer for mode sense */
|
||||
bigtime_t timeout;
|
||||
} raw_device_command;
|
||||
|
||||
enum {
|
||||
B_RAW_DEVICE_DATA_IN = 0x01,
|
||||
B_RAW_DEVICE_REPORT_RESIDUAL = 0x02,
|
||||
B_RAW_DEVICE_SHORT_READ_VALID = 0x04
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
** Copyright 2002-04, Thomas Kurschel. All rights reserved.
|
||||
** Distributed under the terms of the OpenBeOS License.
|
||||
*/
|
||||
|
||||
/*
|
||||
Part of Open SCSI bus manager
|
||||
|
||||
Devfs entry for raw bus access.
|
||||
|
||||
This interface will go away. It's used by scsi_probe as
|
||||
long as we have no proper pnpfs where all the info can
|
||||
be retrieved from.
|
||||
*/
|
||||
|
||||
#ifndef _SCSI_BUS_RAW_DRIVER_H
|
||||
#define _SCSI_BUS_RAW_DRIVER_H
|
||||
|
||||
#include <Drivers.h>
|
||||
|
||||
// we start with +300 to not collide with any other SCSI opcode defined
|
||||
// in scsiprobe_driver.h or scsi.h;
|
||||
// all ioctl calls return the subsystem status (see SCSI.h)
|
||||
enum {
|
||||
B_SCSI_BUS_RAW_RESET = B_DEVICE_OP_CODES_END + 300,
|
||||
B_SCSI_BUS_RAW_PATH_INQUIRY
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,29 +1,22 @@
|
||||
/******************************************************************************
|
||||
/
|
||||
/ File: Beep.h
|
||||
/
|
||||
/ Description: System beep function.
|
||||
/
|
||||
/ Copyright 1993-98, Be Incorporated
|
||||
/
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _BEEP_H
|
||||
#define _BEEP_H
|
||||
|
||||
|
||||
#include <BeBuild.h>
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
_IMPEXP_BE status_t beep();
|
||||
_IMPEXP_BE status_t system_beep(const char * event_name);
|
||||
#ifdef __cplusplus
|
||||
// These functions are only exported for C++
|
||||
|
||||
status_t beep();
|
||||
status_t system_beep(const char* eventName);
|
||||
status_t add_system_beep_event(const char* eventName, uint32 flags = 0);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#define _BEEP_FLAGS = 0
|
||||
#else
|
||||
#define _BEEP_FLAGS
|
||||
#endif
|
||||
_IMPEXP_BE status_t add_system_beep_event(const char * event_name, uint32 flags _BEEP_FLAGS);
|
||||
|
||||
|
||||
#endif /* _BEEP_H */
|
||||
#endif // _BEEP_H
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
/******************************************************************************
|
||||
/
|
||||
/ File: BufferIO.h
|
||||
/
|
||||
/ Description: A buffered adapter for BPositionIO
|
||||
/
|
||||
/ Copyright 1998, Be Incorporated
|
||||
/
|
||||
******************************************************************************/
|
||||
|
||||
#if !defined(_BUFFER_IO_H)
|
||||
#define _BUFFER_IO_H
|
||||
|
||||
#include <DataIO.h>
|
||||
|
||||
class BBufferIO : public BPositionIO
|
||||
{
|
||||
public:
|
||||
enum {
|
||||
DEFAULT_BUF_SIZE = 65536L
|
||||
};
|
||||
|
||||
BBufferIO(
|
||||
BPositionIO * stream,
|
||||
size_t buf_size = DEFAULT_BUF_SIZE,
|
||||
bool owns_stream = true);
|
||||
virtual ~BBufferIO();
|
||||
|
||||
virtual ssize_t ReadAt(
|
||||
off_t pos,
|
||||
void *buffer,
|
||||
size_t size);
|
||||
virtual ssize_t WriteAt(
|
||||
off_t pos,
|
||||
const void *buffer,
|
||||
size_t size);
|
||||
virtual off_t Seek(
|
||||
off_t position,
|
||||
uint32 seek_mode);
|
||||
virtual off_t Position() const;
|
||||
virtual status_t SetSize(
|
||||
off_t size);
|
||||
virtual status_t Flush();
|
||||
BPositionIO * Stream() const;
|
||||
size_t BufferSize() const;
|
||||
bool OwnsStream() const;
|
||||
void SetOwnsStream(
|
||||
bool owns_stream);
|
||||
|
||||
void PrintToStream() const;
|
||||
|
||||
private:
|
||||
|
||||
off_t m_buffer_start;
|
||||
BPositionIO * m_stream;
|
||||
char * m_buffer;
|
||||
size_t m_buffer_phys;
|
||||
size_t m_buffer_used;
|
||||
uint32 _reserved_ints[6];
|
||||
bool m_buffer_dirty;
|
||||
bool m_owns_stream;
|
||||
bool _reserved_bools[6];
|
||||
|
||||
virtual status_t _Reserved_BufferIO_0(void *);
|
||||
virtual status_t _Reserved_BufferIO_1(void *);
|
||||
virtual status_t _Reserved_BufferIO_2(void *);
|
||||
virtual status_t _Reserved_BufferIO_3(void *);
|
||||
virtual status_t _Reserved_BufferIO_4(void *);
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif /* _BUFFER_IO_H */
|
||||
@@ -1,38 +1,24 @@
|
||||
/******************************************************************************
|
||||
/
|
||||
/ File: ClassInfo.h
|
||||
/
|
||||
/ Description: C++ class identification and casting macros
|
||||
/
|
||||
/ Copyright 1993-98, Be Incorporated
|
||||
/
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _CLASS_INFO_H
|
||||
#define _CLASS_INFO_H
|
||||
|
||||
|
||||
#include <typeinfo>
|
||||
|
||||
|
||||
// deprecated, use standard RTTI calls instead
|
||||
// TODO: maybe get rid of this header completely?
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
namespace OpenBeOS {
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*--------- Class Info Macros ---------------------------------*/
|
||||
|
||||
#define class_name(ptr) ((typeid(*(ptr))).name())
|
||||
#define cast_as(ptr, class) (dynamic_cast<class*>(ptr))
|
||||
#define is_kind_of(ptr, class) (cast_as(ptr, class) != 0)
|
||||
#define is_instance_of(ptr, class) (typeid(*(ptr)) == typeid(class))
|
||||
#define class_name(object) \
|
||||
((typeid(*(object))).name())
|
||||
#define cast_as(object, class) \
|
||||
(dynamic_cast<class*>(object))
|
||||
#define is_kind_of(object, class) \
|
||||
(dynamic_cast<class*>(object) != NULL)
|
||||
#define is_instance_of(object, class) \
|
||||
(typeid(*(object)) == typeid(class))
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*-------------------------------------------------------------*/
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
} // namespace OpenBeOS
|
||||
using namespace OpenBeOS;
|
||||
#endif
|
||||
|
||||
#endif /* _CLASS_INFO_H */
|
||||
#endif // _CLASS_INFO_H
|
||||
|
||||
@@ -1,70 +1,59 @@
|
||||
/******************************************************************************
|
||||
/
|
||||
/ File: UTF8.h
|
||||
/
|
||||
/ Description: UTF-8 conversion functions.
|
||||
/
|
||||
/ Copyright 1993-98, Be Incorporated
|
||||
/
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _UTF8_H
|
||||
#define _UTF8_H
|
||||
|
||||
|
||||
#include <BeBuild.h>
|
||||
#include <InterfaceDefs.h>
|
||||
#include <SupportDefs.h>
|
||||
|
||||
/*------------------------------------------------------------*/
|
||||
/*------- Conversion Flavors ---------------------------------*/
|
||||
|
||||
// Conversion Flavors
|
||||
enum {
|
||||
B_ISO1_CONVERSION, /* ISO 8859-1 */
|
||||
B_ISO2_CONVERSION, /* ISO 8859-2 */
|
||||
B_ISO3_CONVERSION, /* ISO 8859-3 */
|
||||
B_ISO4_CONVERSION, /* ISO 8859-4 */
|
||||
B_ISO5_CONVERSION, /* ISO 8859-5 */
|
||||
B_ISO6_CONVERSION, /* ISO 8859-6 */
|
||||
B_ISO7_CONVERSION, /* ISO 8859-7 */
|
||||
B_ISO8_CONVERSION, /* ISO 8859-8 */
|
||||
B_ISO9_CONVERSION, /* ISO 8859-9 */
|
||||
B_ISO10_CONVERSION, /* ISO 8859-10 */
|
||||
B_MAC_ROMAN_CONVERSION, /* Macintosh Roman */
|
||||
B_SJIS_CONVERSION, /* Shift-JIS */
|
||||
B_EUC_CONVERSION, /* EUC Packed Japanese */
|
||||
B_JIS_CONVERSION, /* JIS X 0208-1990 */
|
||||
B_MS_WINDOWS_CONVERSION, /* MS-Windows Codepage 1252 */
|
||||
B_UNICODE_CONVERSION, /* Unicode 2.0 */
|
||||
B_KOI8R_CONVERSION, /* KOI8-R */
|
||||
B_MS_WINDOWS_1251_CONVERSION, /* MS-Windows Codepage 1251 */
|
||||
B_MS_DOS_866_CONVERSION, /* MS-DOS Codepage 866 */
|
||||
B_MS_DOS_CONVERSION, /* MS-DOS Codepage 437 */
|
||||
B_EUC_KR_CONVERSION, /* EUC Korean */
|
||||
B_ISO13_CONVERSION, /* ISO 8859-13 */
|
||||
B_ISO14_CONVERSION, /* ISO 8859-14 */
|
||||
B_ISO15_CONVERSION, /* ISO 8859-15 */
|
||||
B_ISO1_CONVERSION, // ISO 8859-x
|
||||
B_ISO2_CONVERSION,
|
||||
B_ISO3_CONVERSION,
|
||||
B_ISO4_CONVERSION,
|
||||
B_ISO5_CONVERSION,
|
||||
B_ISO6_CONVERSION,
|
||||
B_ISO7_CONVERSION,
|
||||
B_ISO8_CONVERSION,
|
||||
B_ISO9_CONVERSION,
|
||||
B_ISO10_CONVERSION,
|
||||
B_MAC_ROMAN_CONVERSION, // Macintosh Roman
|
||||
B_SJIS_CONVERSION, // Shift-JIS
|
||||
B_EUC_CONVERSION, // EUC Packed Japanese
|
||||
B_JIS_CONVERSION, // JIS X 0208-1990
|
||||
B_MS_WINDOWS_CONVERSION, // Windows Latin-1 Codepage 1252
|
||||
B_UNICODE_CONVERSION, // Unicode 2.0, UCS-2
|
||||
B_KOI8R_CONVERSION, // KOI8-R
|
||||
B_MS_WINDOWS_1251_CONVERSION, // Windows Cyrillic Codepage 1251
|
||||
B_MS_DOS_866_CONVERSION, // MS-DOS Codepage 866
|
||||
B_MS_DOS_CONVERSION, // MS-DOS Codepage 437
|
||||
B_EUC_KR_CONVERSION, // EUC Korean
|
||||
B_ISO13_CONVERSION,
|
||||
B_ISO14_CONVERSION,
|
||||
B_ISO15_CONVERSION,
|
||||
B_BIG5_CONVERSION, // Chinese Big5
|
||||
B_GBK_CONVERSION, // Chinese GB18030
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*------- Conversion Functions --------------------------------*/
|
||||
|
||||
_IMPEXP_TEXTENCODING status_t convert_to_utf8(uint32 srcEncoding,
|
||||
const char *src,
|
||||
int32 *srcLen,
|
||||
char *dst,
|
||||
int32 *dstLen,
|
||||
int32 *state,
|
||||
char substitute = B_SUBSTITUTE);
|
||||
// Conversion Functions
|
||||
|
||||
_IMPEXP_TEXTENCODING status_t convert_from_utf8(uint32 dstEncoding,
|
||||
const char *src,
|
||||
int32 *srcLen,
|
||||
char *dst,
|
||||
int32 *dstLen,
|
||||
int32 *state,
|
||||
char substitute = B_SUBSTITUTE);
|
||||
#ifdef __cplusplus
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*-------------------------------------------------------------*/
|
||||
status_t convert_to_utf8(uint32 sourceEncoding, const char* source,
|
||||
int32* sourceLength, char* dest, int32* destLength, int32* state,
|
||||
char substitute = B_SUBSTITUTE);
|
||||
|
||||
status_t convert_from_utf8(uint32 destEncoding, const char* source,
|
||||
int32* sourceLength, char* dest, int32* destLength, int32* state,
|
||||
char substitute = B_SUBSTITUTE);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _UTF8_H */
|
||||
|
||||
Reference in New Issue
Block a user